Are you asking how to Enable All Notifications using a function in the CyBle_ library? I don't think there is a specific one that does that. If you look at the CySmart log output (bottom of screen, or saved in file) I bet it is sending multiple packets to change each CCCD individually, and then changing the Service Changed CCCD as well.
CCCD's have a specific UUID value that you can look for/compare with to find all CCCD values in a BLE profile, and thus enable/disable all CCCD values.
I see. The log indicates it is writing a '2' to service changed CCCD and then reading back to ensure that it was received correctly. It then writes to the notification flag for each CCCD.
I was unsure if Service Changed was intended to act as some mega switch that turned everything on, but it seems that no such mega switch was intended and everything is self contained.
If I wanted to check Service Changed would I use 0x000Au or 0x000Bu while operating in a server role based on this section of code in CYBLE_gatt.c? Or am I looking in the wrong place?
const CYBLE_GATTS_T cyBle_gatts =
0x0008u, /* Handle of the GATT service */
0x000Au, /* Handle of the Service Changed characteristic */
0x000Bu, /* Handle of the Client Characteristic Configuration descriptor */
1 of 1 people found this helpful
The 'Service Changed' characteristic is used by the GATT server to indicate to the GATT client if there was any change in the GATT DB when the two are connected.
On CySmart, when you click ' Enable All Notifications', as e.pratt_1639216 rightly said, CySmart sends a write request to every CCCD one after the other.
The 'Service Changed' characteristic has a CCCD which is used to enable/disable Indications. When you 'Enable All Notifications', CySmart sends a 0x02, which is the value to enable indications.
The Service Changed characteristic, whose handle is 0x000Au in your case will have the starting handle and ending handle of the affected attribute range.