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

Service Notification problem - BLE_ERROR_INVALID_ATTR_HANDLE

Hello everyone,

I am trying to enable notification on a characteristic based on the code example from nAN36. Unfortunately the sd_ble_gatts_hvx() function returns:

BLE_ERROR_INVALID_ATTR_HANDLE - "Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate."

I can't quite get the meaning of the "attributes added directly by the application". Any ideas how to interpret that or general guidelines how to approach this problem?

The setup is: ARMGCC + S110 + 51822. I am testing it with the nRF Master Control Panel, where it says that the notifications are enabled.

Thank you in advance!

Parents
  • Services, characteristics and descriptors are attributes. You add them by with

    sd_ble_gatts_service_add() sd_ble_gatts_characteristic_add() sd_ble_gatts_descriptor_add()

    These return the attribute handles that are use in the attribute table.

    So when you call sd_ble_gatts_hvx() you need to ensure that you use the correct attribute handle of the characteristic value that you want to send a notifcation from.

Reply
  • Services, characteristics and descriptors are attributes. You add them by with

    sd_ble_gatts_service_add() sd_ble_gatts_characteristic_add() sd_ble_gatts_descriptor_add()

    These return the attribute handles that are use in the attribute table.

    So when you call sd_ble_gatts_hvx() you need to ensure that you use the correct attribute handle of the characteristic value that you want to send a notifcation from.

Children
No Data
Related