Hello,
I used this tutorial : devzone.nordicsemi.com/.../
But I can't resolve the "Challenge 1" (write 4 bytes on the characteristic). Can you explain me, please ? :-)
Thanks a lot !
Hello,
I used this tutorial : devzone.nordicsemi.com/.../
But I can't resolve the "Challenge 1" (write 4 bytes on the characteristic). Can you explain me, please ? :-)
Thanks a lot !
ps : I tried to do it on the example "ble_lbs", so currently, I have :
uint32_t ble_lbs_on_button_change(ble_lbs_t * p_lbs, uint8_t button_state)
{
ble_gatts_hvx_params_t params;
uint16_t len = sizeof(button_state);
memset(¶ms, 0, sizeof(params));
params.type = BLE_GATT_HVX_NOTIFICATION;
params.handle = p_lbs->button_char_handles.value_handle;
params.p_data = &button_state;
params.p_len = &len;
return sd_ble_gatts_hvx(p_lbs->conn_handle, ¶ms);
}
I think I have to modify this function, because when I use it, it only changes the first byte (and the 3 others are 34 56 78).
ps : I tried to do it on the example "ble_lbs", so currently, I have :
uint32_t ble_lbs_on_button_change(ble_lbs_t * p_lbs, uint8_t button_state)
{
ble_gatts_hvx_params_t params;
uint16_t len = sizeof(button_state);
memset(¶ms, 0, sizeof(params));
params.type = BLE_GATT_HVX_NOTIFICATION;
params.handle = p_lbs->button_char_handles.value_handle;
params.p_data = &button_state;
params.p_len = &len;
return sd_ble_gatts_hvx(p_lbs->conn_handle, ¶ms);
}
I think I have to modify this function, because when I use it, it only changes the first byte (and the 3 others are 34 56 78).