2022-11-07 12:27 AM
Please support on following:
I am using the STM32WB55 as a BLE client (central).
As I understand there are several types of descriptors.
How do I know the characteristic descriptor I discovered is a Client Characteristic Configuration Descriptor(CCDA), and can be written?
I am using :
aci_gatt_disc_all_char_desc
That generates ACI_ATT_FIND_INFO_RESP_EVENT.
But the event does not hold a 'type' for the descriptor or a field indicating if it can be written. As according to AN5270 it holds : connection handle, format, length and data which i don't believe can help me that much.
I took a quick look into your example for BLE_p2pClient.
I see that the descriptor is found using the ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE to discover the CCDA. But this doesn't help me because I do not know the UUID of the CCDA in advance.
case ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE:
...
if(uuid == P2P_NOTIFY_CHAR_UUID)
{
#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- GATT : NOTIFICATION_CHAR_UUID FOUND - connection handle 0x%x\n", aP2PClientContext[index].connHandle);
#endif
aP2PClientContext[index].state = APP_BLE_DISCOVER_NOTIFICATION_CHAR_DESC;
aP2PClientContext[index].P2PNotificationCharHdle = handle;
}
}
...
break;
Thanks!
Solved! Go to Solution.
2022-11-09 05:53 AM
Hello,
The Client Characteristic Config Descriptor (CCCD) UUID is always the same according to BLE_p2pClient example the UUID is equal to 0x2902:
#define CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID (0x2902)
See ACI_ATT_FIND_INFO_RESP_VSEVT_CODE event in the code.
Best Regards
2022-11-09 05:53 AM
Hello,
The Client Characteristic Config Descriptor (CCCD) UUID is always the same according to BLE_p2pClient example the UUID is equal to 0x2902:
#define CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID (0x2902)
See ACI_ATT_FIND_INFO_RESP_VSEVT_CODE event in the code.
Best Regards