Hi there,
I am working on CC2640R2 launchpad with SDK 1.50.0.58 simple_central_cc2640r2lp_app.
I am trying to find CCCD of CHAR5(UUID FFF5). CHAR4(UUID FFF4).
What I did:
1. I noticed the procedure to find CHAR1 value handle is like this from sample code:
first, issue a read request with GATT_ReadUsingCharUUID:
if (svcStartHdl != 0) { attReadByTypeReq_t req; // Discover characteristic discState = BLE_DISC_STATE_CHAR; req.startHandle = svcStartHdl; req.endHandle = svcEndHdl; req.type.len = ATT_BT_UUID_SIZE; req.type.uuid[0] = LO_UINT16(SIMPLEPROFILE_CHAR1_UUID); req.type.uuid[1] = HI_UINT16(SIMPLEPROFILE_CHAR1_UUID); VOID GATT_ReadUsingCharUUID(connHandle, &req, selfEntity); }
then, get the handle of CHAR1 value from ATT response like this:
// Characteristic found, store handle if ((pMsg->method == ATT_READ_BY_TYPE_RSP) && (pMsg->msg.readByTypeRsp.numPairs > 0)) { charHdl = BUILD_UINT16(pMsg->msg.readByTypeRsp.pDataList[0], pMsg->msg.readByTypeRsp.pDataList[1]); Display_print0(dispHandle, 2, 0, "Simple Svc Found"); }
2. So I follow this process and add my code after the example process:
same as example code, issue a read request with GATT_ReadUsingCharUUID
attReadByTypeReq_t req; req.startHandle = svcStartHdl; req.endHandle = svcEndHdl; req.type.len = ATT_BT_UUID_SIZE; req.type.uuid[0] = LO_UINT16(GATT_CLIENT_CHAR_CFG_UUID); req.type.uuid[1] = HI_UINT16(GATT_CLIENT_CHAR_CFG_UUID); VOID GATT_ReadUsingCharUUID(connHandle, &req, selfEntity);
3. the weird result is that the ble stack still send a read request with UUID of CHAR1(0xFFF1), what I expect is send a read request with UUID of CCCD(0x2902)
here I attached sniffer result:
you can see that:
#870 is sample code send a read request with UUID 0xfff1
#878 is slave response
#885 is my code to send a read request with UUID(should be 0x2902), but it send a request with same UUID of 0xfff1
Finally, I attached my project(it's portable), you can import to your ccs easily.