BLE : Cannot enable notification on the client characteristic configuration descriptor (0x2902)
Hello,
i defined a characteristic with notify propriety :
ret = aci_gatt_add_char(
Service2_Handle1,
UUID_TYPE_128,
&char_uuid,
26,
CHAR_PROP_NOTIFY | CHAR_PROP_WRITE | CHAR_PROP_WRITE_WITHOUT_RESP,
ATTR_PERMISSION_NONE,
GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
16,
1,
&Service2_Char_Notify_Handle);
with CHAR_PROP_NOTIFY it is generate CCCD and by default Client Notification is disabled.
I need to enable it on the server, so i tryed with this code :
Service2_Char_Notify_NotifDesc_Handle = Service2_Char_Notify_Handle+2;
ret = aci_gatt_set_access_permission(
Service2_Handle1,
Service2_Char_Notify_NotifDesc_Handle,
(0x01 | 0x02)); //Access_Permissions
uint8_t char_notify_ennotifdesc_val[2] = {0x01,0x00};
ret = aci_gatt_write_char_desc(connection_handle, Service2_Char_Notify_NotifDesc_Handle, 2, char_notify_ennotifdesc_val);
But in debugging with an android app, the notification will stil disabled !
How can i enable the notification to the client from the server ?
Thank you,
Sincerely.
