Timing Exception
in C#
I have a Droid app written in C#, Xamarin. Works well to connect to the MetaMotion device to gather readings including a custom sensor. I'm trying to track down an exception that is thrown. It takes a long time (8+ hours) for this exception to finally get triggered, so debugging is a bit tough.
Any thoughts on where this is coming from and what I should look at:
"Unhandled Exception:
System.TimeoutException: Did not receive a response for command [0x11, 0x92] within 250ms"
Thanks
Carlton
Comments
Also, after this exception is thrown, I have to restart my application to get the device to talk again.
How are you configuring your metamotion device?
What are the steps to reproduce this issue?
Best I just share the function. This function runs every 10 minutes and works for a long time. I've set some additional debug message to help track down where the problem might be but wanted to ask in case this was something that is known.
Thanks
public async Task QueryBiometricBraceletV2()
{
// QUERY MetaWear Bracelet
// 1) Connect to bracelet
try
{
await BluetoothLeGatt2.DiscoverMetaWearAsync(scanTimeout: 20000, macAddress: MainActivity.Settings.BraceletID);
}
catch (Exception ex)
{
SettingsLog.WriteLog("EXC", string.Format(ex.Message));
}
Which line exactly fails? And why are you not retrying the command?
I've isolated it to this:
After a long period of time, the above function no longer works. Actually, I'm not sure it works at all. It always returns false even when I have a battery connected and it should be charging.
Thoughts?
My function is now:
Because I wasn't catching the exception, any code after the above didn't execute. Now that I am capturing the exception, function seems to be working ok.
After period of time, the ChargeStatus.ReadAsync() begins to work again. What's odd is that the functions after this function do work, so I'm not loosing a connection w/ the metawear board.
I'll keep this in our development log and if something else pops up, will re-open this discussion.