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

Hardfault ble_nus_send_data - SDK 17

Hi,

I've noticed that there was an issue with ble_nus in SDK 15.3 - detailed in this post.

I'm using SDK 17, and in my application, I don't check data_handler != NULL. When BLE_GATTS_EVT_HVN_TX_COMPLETE occurs, I just define ble_nus_evt_t evt and calls p_nus->data_handler. Probably took it from an example, I can't remember.

Is it safe? Should I use something else?

Thanks!

Parents Reply
  • To be frank, I am seeing only pieces of your modified NUS implementation, and without having the full picture I cannot give any guarantees of anything. If you set p_context to a valid value, then it is safe to use it. If not, then don't. You do check if it is NULL, so unless you put in same random address that check will suffice. So I cannot imagine that there will be an issue here, and if it is, that would be something with your code which I do not see, and not related to the earlier mentioned issue which is fixed in the SDK and also in your code.

Children
Related