-
I unfortunately cannot send a demo app because this is part of our commercial product. I am encountering the following callstack when I attempt to re-connect to a peripheral after having connected/subscribed previously. This appears to be all internal Shiny code - it's not called explicitly by my app:
I believe the repro steps are:
The exception is thrown. I expect I should be able to (and should be required to) re-connect to the device after having turned off bluetooth, and I'm not sure why I'm getting this exception. Update 1If I connect without subscribing, the error does not occur. This is to be expected because the error indicates a particular service UUID which could only be obtained through the subscribe call. If I subscribe with the following code... Peripheral.NotifyCharacteristic(WriteServiceUuid, NotificationCharacteristicUuid)
.Subscribe(HandleNotificationSubscription); ...then the connection attempt after toggling OS-level bluetooth off/on seems to fail. Does this mean I must somehow unsubscribe from the characteristic? Or should I not be doing a connect explicitly after I've successfully notified? Any help would be appreciated, thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Subscribe has an overload to trap errors. Please read on reactive extensions in order to use RX properly |
Beta Was this translation helpful? Give feedback.
-
For future readers: Peripheral.NotifyCharacteristic(WriteServiceUuid, NotificationCharacteristicUuid)
.Subscribe(HandleNotificationSubscription, HandleException);
// ...
private void HandleException(Exception exception)
{
// do we care to do anything here? I think we just tolerate it...
} |
Beta Was this translation helpful? Give feedback.
For future readers: