When I tried to use the sd_ble_gatts_value_get() function and found no error but no corresponding value returned, I was sure I had the right value in my feature because it was something I had read and written with another application. Is there anything wrong with my use?
uint32_t gatts_char_value_get(uint16_t handle)
{
uint32_t error_code = NRF_SUCCESS;
ble_gatts_value_t r_value;
r_value.p_value = NULL;
error_code = sd_ble_gatts_value_get(BLE_CONN_HANDLE_INVALID, handle, &r_value);
if (error_code != NRF_SUCCESS)
{
usb_printf_variadic("GATTS Value Get Error Code: 0x%04x", error_code);
return error_code;
}
usb_printf_variadic("GATTS Value Get OK\n");
usb_printf_variadic("Handle: %04X, Value Length: %d, Value: %s\n", handle, r_value.len, r_value.p_value);
return error_code;
}