2023-09-01 01:55 PM
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.
Solved! Go to Solution.
2023-09-02 01:37 AM
it is ok, i resolved the problem with aci_gatt_set_desc_value
it is look like aci_gatt_write_char_desc is specific for cilent side,
but aci_gatt_set_desc_value work on the server side
2023-09-01 02:23 PM
2023-09-02 01:37 AM
it is ok, i resolved the problem with aci_gatt_set_desc_value
it is look like aci_gatt_write_char_desc is specific for cilent side,
but aci_gatt_set_desc_value work on the server side