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

Unexpected return value when calling sd_ble_gatts_hvx() when notifications are not enabled

This issue concerns code using Softdevice S132 v6.1.1. v5.0.0. I did not test with any other version.

From the documentation of sd_ble_gatts_hvx in ble_gatts.h, I expect that the return value when calling this function while notifications are disabled for the characteristic in question is NRF_ERROR_INVALID_STATE.

Instead, the function returns BLE_ERROR_NOT_ENABLED, which suggests that the softdevice is not enabled, but this is of course not the case because the device in question is connected when the issue arises.

Parents Reply
  • Have you enabled the SoftDevice?

    As I mentioned in my initial question, the softdevice is enabled. Even a BLE connection has been established at the point that issue arises, so the behaviour of this call is indeed not as documented.

    I just assume that there was a simple mishap when implementing the function, "BLE_ERROR_NOT_ENABLED" by itself does sound like the right error to return when notifications are "not enabled"... ;-)

Children
Related