ShimmerEngineering / Shimmer-C-API

26 stars 17 forks source link

Returned state of ShimmerBluetooth failed #95

Open varoGraf opened 2 years ago

varoGraf commented 2 years ago

I have encountered an issue when trying to determine in which state the Shimmer currently is. When the Shimmer is connected and is powered off (manually or because the battery ran out), the State returned is not none (in this case is SHIMMER_STATE_STREAMING) and the value isConnected is still true.

This led to errors and exceptions in runtime (InvalidOperationException), trying to disconnect the Shimmer even if it is already powered off.

The type of Shimmer used in code is ShimmerLogAndStreamSystemSerialPort, the version of the firmware is 13.0, and the version of the ShimmerAPI is 1.0.1. The application uses .NET Core 3.1.29.

JongChern commented 2 years ago

hi, thanks for getting in touch. can you try using the master branch. I've tested it and you should see the following, before the state changes to disconnected. You should be able to test this using the shimmer capture example.

image