Hi Dialog_Support,
I am using ble_app_peripheral reference example in my project. I have added "Notify" characteristic, i wanted to update data whenever i enable the "Notify" characteristic in BLE_Scanner app . And this is happening perfectly but the issue is if i disable the "Notify" then also i am getting data updated in BLE_Scanner app. Not understanding where i am going wrong.
can any one suggest me what is the issue ?
Device:
Hi Rajapurerohit,
Well, when you enable and disable the notifications the gattc_write_cmd_ind_handler() is triggered and writes the Client Configuration Characteristic with the corresponding value, the functions that actually updates the value is:
if (status == PRF_ERR_OK)
{
// Set Client Characteristic Configuration value
status = attmdb_att_set_value(param->handle, param->length, (uint8_t*)&(param->value[0]));
}
So you can check this value when you disable the notification if it is set to zero. If that value is zero when you send the message to update the value and send the notification, the code should check if the CCC is enabled or not via this function attmdb_att_get_value(cfg_hdl, &length, &cfg_val); if the value in the cfg_hdl has the PRF_CLI_START_NTF value then the device will keep on sending the notifications. So i suppose that the error is somewhere there. The ble_app_peripheral also uses notifications in order to update the ADC value, so you can have a look at that example.
Thanks MT_dialog