sd_ble_gatts_value_get and sd_ble_gatts_value_set when not in connection requires different handles


when I am not in a connection, I want to call sd_ble_gatts_value_get() and sd_ble_gatts_value_set(). Both require a connection handle.

For the  sd_ble_gatts_value_get() I must use "0" as connection handle - else it crashes

For the sd_ble_gatts_value_set() I must use "BLE_CONN_HANDLE_INVALID" (0xFFFF) - else it crashes

Why does this functions need different handles when I am not in a connection? This is very ugly, if I can not use a common connection handle for my whole program.

Is this a bug? Is there any solution to this, except the workaround of using different connection handles for the functions (have to check before every call, if the system is in a valid connection by checking a custom variable - thats bad)

Thank you,

I use SDK 15.2.

No Data
Reply Children
No Data