I'm using nRF51822 and i want to send a notification to the central to notify it for the changing of a characteristic value (major_value) after using the sd_ble_gatts_value_set ? here is my code:
const ble_bcs_init_t * p_bcs_init;
ble_bcs_t *p_bcs;
p_bcs = &m_bcs ;
uint16_t len =4;
uint8_t value[4];
value[0]=0;
value[1]=1;
value[2]=0;
value[3]=0;
err_code = sd_ble_gatts_value_set(p_bcs->beacon_maj_min_char_handles.value_handle,0,&len,value);
APP_ERROR_CHECK(err_code);
if((p_bcs->conn_handle != BLE_CONN_HANDLE_INVALID) && p_bcs->is_notifying)
{
ble_gatts_hvx_params_t params;
memset(¶ms, 0, sizeof(params));
// len = sizeof(uint16_t);
params.handle =p_bcs->beacon_maj_min_char_handles.value_handle ;
params.type = BLE_GATT_HVX_NOTIFICATION;
params.p_len = &len;
params.offset = 0;
params.p_data = value;
uint32_t err_code2=sd_ble_gatts_hvx(p_bcs->conn_handle, ¶ms);
APP_ERROR_CHECK(err_code2);
The problem is that the central is not able to read those changes. But when cheking the value of the characteristic from the master control panel , it reads the correct value ( updated) . Is there something wrong with my code ? if so is there an example ?