Skip to content

How can I diagnose why BLE NotifyCharacteristic is not working? #1409

Closed Answered by vchelaru
vchelaru asked this question in Q&A
Discussion options

You must be logged in to vote

For future readers, I believe the reason this wasn't working is because I wasn't subscribing to the NotifyCharacterstic response. The code should be:

peripheral.NotifyCharacteristic(notifyCharacteristic).Subscribe(HandleNotificationSubscription);
...
private void HandleNotificationSubscription(BleCharacteristicResult result)
{
    int m = 3;
}

Unfortunately I struggled with this longer than probably would have been necessary but the docs are incomplete here:
https://shinylib.net/client/ble/gatt/

But the following line provides clues:

Notifications will stay hooked as long as you hold a subscription to it. Make sure you dispose of it when you are done
I hope this helps future readers.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aritchie
Comment options

Answer selected by vchelaru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants