This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how do i use the notification feature in ble?

im very new to ble, i wanna use the notification feature but i cant tell how to do that. i searched some question but havnt found anything straight forward. maybe idk what to look for exactly.

any help would be very appreciated guys!

Parents
  • Yes, you are basically there. Here is message sequence chart and example of actual code snippets can be found all over the SDK, just search in full-text for all sd_ble_gatts_hvx function calls in *.c files. Note that both Indication and Notification require to a) provision correctly GATT Server Characteristic capabilities (when you init GATT Services during Soft Device init) and then they need to be enabled through GATT Write to Client Characteristic Configuration Descriptor (CCCD) which is automatically created on the stack (by SD) for every Characteristic which supports at least one of these methods. You can either blindly shoot sd_ble_gatts_hvx and learn from return code if it was enabled or better watch Write events to the CCCD handle and parse data.

Reply
  • Yes, you are basically there. Here is message sequence chart and example of actual code snippets can be found all over the SDK, just search in full-text for all sd_ble_gatts_hvx function calls in *.c files. Note that both Indication and Notification require to a) provision correctly GATT Server Characteristic capabilities (when you init GATT Services during Soft Device init) and then they need to be enabled through GATT Write to Client Characteristic Configuration Descriptor (CCCD) which is automatically created on the stack (by SD) for every Characteristic which supports at least one of these methods. You can either blindly shoot sd_ble_gatts_hvx and learn from return code if it was enabled or better watch Write events to the CCCD handle and parse data.

Children
No Data
Related