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!
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!
Hi Luke, you will need to tell us first what system (HW+SW) do you have to start with. Otherwise GATT Notify method is used in pretty much any nRF5 SDK BLE example which uses GAP&GATT layers so it's hard to imagine something more straight forward;)
custom hardware and sdk11.. so what im trying to learn is sending a notification through ble.. but it seems ill just send it as information via sd_ble_gatts_hvx function accepting a parameter of ble_gatts_hvx_params_t kind of struct with type element of BLE_GATT_HVX_NOTIFICATION. am i heading in the right direction?
if i am not giving right or clear description plz keep letting me know =)
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.
@luke you could also take a look at this tutorial.
oh thats great to understand ble better.. thanks run_ar!