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

cannot update notification value

Once I call sd_ble_gatts_hvx() while ble connection handle is invalid(BLE_CONN_HANDLE_INVALID), I can never update notification value using sd_ble_gatts_hvx() though function result is NRF_SUCCESS.

Is this softdevice bug?

The expected operation is that the value can be updated whenever sd_ble_gatts_hvx() return NRF_SUCCESS.

7/19 22:01 sd_ble_gatts_hvx() returns NRF_SUCCESS, but the value client get is the same as the first value I set with sd_ble_gatts_hvx() while ble connection handle is invalid.

Parents
  • Not really, sd_ble_gatts_hvx() returning NRF_SUCCESSonly means that packet got stored into one of Tx buffers inside Soft Device. Once it goes really out you will get specific event (in the latest SDK it's called BLE_GATTS_EVT_HVN_TX_COMPLETE) and only then another Handle Value Notification packet gets out. Note that there isn't only one Tx buffer in the SD so you can "stack" at least 6 packets in advance. Apart from this all works without problems, no bug known that SD would not transport data out or that you wouldn't be able to transport other data then first string you provide to the function. Are you sure it's not bug in your code before calling sd_ble_gatts_hvx() function?

Reply
  • Not really, sd_ble_gatts_hvx() returning NRF_SUCCESSonly means that packet got stored into one of Tx buffers inside Soft Device. Once it goes really out you will get specific event (in the latest SDK it's called BLE_GATTS_EVT_HVN_TX_COMPLETE) and only then another Handle Value Notification packet gets out. Note that there isn't only one Tx buffer in the SD so you can "stack" at least 6 packets in advance. Apart from this all works without problems, no bug known that SD would not transport data out or that you wouldn't be able to transport other data then first string you provide to the function. Are you sure it's not bug in your code before calling sd_ble_gatts_hvx() function?

Children
Related