Hello, I would like to send an int32 value every 500ms and use for this the same procedure as it is shown in the heart-rate-example. The code for sending is:
// Send value if connected and notifying
if ((p_ad->conn_handle != BLE_CONN_HANDLE_INVALID)
&& (p_ad->is_notification_supported))
{
uint8_t encoded_adValue[10];
uint16_t hvx_len;
ble_gatts_hvx_params_t hvx_params;
hvx_len = uint32_encode(SActualValue.i32Value, encoded_adValue);
memset(&hvx_params, 0, sizeof(hvx_params));
hvx_params.handle = p_ad->ad_actualValue_handles.value_handle;
hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
hvx_params.offset = 0;
hvx_params.p_len = &hvx_len;
hvx_params.p_data = encoded_adValue;
err_code = sd_ble_gatts_hvx(p_ad->conn_handle, &hvx_params);
if (err_code == NRF_SUCCESS)
{
err_code = NRF_ERROR_DATA_SIZE;
}
}
else
{
err_code = NRF_ERROR_INVALID_STATE;
}
return err_code;
I suppose having initialized correctly everything (also in services_init()); looking at this forum I tried already the inclusion of
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
err_code = sd_ble_gatts_sys_attr_set(p_ble_evt->evt.gatts_evt.conn_handle, NULL, 0, 0);
APP_ERROR_CHECK(err_code);
break;
in the function on_ble_event() but when debugging with a breakpoint I see that this part of code is never reached... What can I do next?