How to add multiple notification characteristics in a single service and how to change notification time interval for different notification.
How to add multiple notification characteristics in a single service and how to change notification time interval for different notification.
I suggest to take a look at the ble blinky or ble uart examples:
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_blinky.html
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_nus_eval.html
Basically you during initialization have a services_init() function where you setup the services and characteristics you want your GATT server to contain, this is done by calling sd_ble_gatts_service_add() and sd_ble_gatts_characteristic_add() if you look into the code. It's important that when you initialize a characteristic that support notification that you buffer the char_handle that the sd_ble_gatts_characteristic_add() return, since this char_handle is required every time you want to send notification data.
To send a notification data you call sd_ble_gatts_hvx() with the char_handle for the characteristic you want to notify, how often you call sd_ble_gatts_hvx() is entirely up to you.
Best regards,
Kenneth
I suggest to take a look at the ble blinky or ble uart examples:
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_blinky.html
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_nus_eval.html
Basically you during initialization have a services_init() function where you setup the services and characteristics you want your GATT server to contain, this is done by calling sd_ble_gatts_service_add() and sd_ble_gatts_characteristic_add() if you look into the code. It's important that when you initialize a characteristic that support notification that you buffer the char_handle that the sd_ble_gatts_characteristic_add() return, since this char_handle is required every time you want to send notification data.
To send a notification data you call sd_ble_gatts_hvx() with the char_handle for the characteristic you want to notify, how often you call sd_ble_gatts_hvx() is entirely up to you.
Best regards,
Kenneth