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

Notification Issues

Hi, I have a custom service with 3 characteristics and i've been attempting to send one of them as a notification so I can use it in the HRS sensor app by changing the UUIDs. I have managed to get notifications on both the light blue app(ios) and master control panel app(android) but they aren't continuous (it listens once) so I have to press listen each time to get a value (and sometimes I have to press multiple times before it updates). Please how do I make it that my code continuously sends notifications. Thanks.

Parents
  • I think the issue here might be that you are trying to send notifications without checking if you are in the BLE_LBS_EVT_NOTIFICATION_ENABLED state. I did not run your example to check if it crashed before that, but conceptually you have to wait until the peer has enabled notifications before you can start sending them.

    You can skip this step if you are bonded and are restoring system parameters that enable notifications, but you should still check if you are in the enabled state before allowing the application to call sd_ble_gatts_hvx().

Reply
  • I think the issue here might be that you are trying to send notifications without checking if you are in the BLE_LBS_EVT_NOTIFICATION_ENABLED state. I did not run your example to check if it crashed before that, but conceptually you have to wait until the peer has enabled notifications before you can start sending them.

    You can skip this step if you are bonded and are restoring system parameters that enable notifications, but you should still check if you are in the enabled state before allowing the application to call sd_ble_gatts_hvx().

Children
Related