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

Add an include declaration with BLE_GATT_HANDLE_INVALID

Hi

I'm using S132 V5.0.0 with the nRF52832.

I tried to add an include declaration to the last added primary service by using BLE_GATT_HANDLE_INVALID as service handle. According to the description of the function sd_ble_gatts_include_add, this handle could be used to place the declaration sequentually, but I receive the error NRF_ERROR_NOT_SUPPORTED. As soon as I use the actual service handle it works.

What am I missing? Is the description incorrect or is this a bug?

Many thanks in advance for your help.

Kind regards

Parents
  • Hi Remo, 

     

    It seems like a bug in the documentation. In the source we didn't really check if BLE_GATT_HANDLE_INVALID is used for service_handle. For now please simply use the actual service handle. I will report this bug.

     

  • Hi Hung

    Thank you very much for the fast answer. I've a further question. The documentation states also that BLE_GATT_HANDLE_INVALID can be used for adding a characteristic or descriptor, which works as expected. Would you suggest using the actual handle also for these cases? Or would you still use the "invalid handle"?

  • Hi Remo, 

     

    For the sd_ble_gatts_characteristic_add() and sd_ble_gatts_descriptor_add(), the BLE_GATT_HANDLE_INVALID  is accepted. 

    Actually by the nature of how our attribute table is populated, (only allow sequential adding) we don't really use the service_handle provided, other than checking if it's the last service handle or BLE_GATT_HANDLE_INVALID.

     

    It's not the same with sd_ble_gatts_include_add(), in that function we throw an error when we see BLE_GATT_HANDLE_INVALID. This can be fixed. 

     

Reply
  • Hi Remo, 

     

    For the sd_ble_gatts_characteristic_add() and sd_ble_gatts_descriptor_add(), the BLE_GATT_HANDLE_INVALID  is accepted. 

    Actually by the nature of how our attribute table is populated, (only allow sequential adding) we don't really use the service_handle provided, other than checking if it's the last service handle or BLE_GATT_HANDLE_INVALID.

     

    It's not the same with sd_ble_gatts_include_add(), in that function we throw an error when we see BLE_GATT_HANDLE_INVALID. This can be fixed. 

     

Children
Related