Hi, I am trying to use the multi-role project (below link) to discover all characteristic of the SimpleProfile service.
http://processors.wiki.ti.com/index.php/Cc2640_MultiRole_Demo_2_1
The original code using GATT_ReadUsingCharUUID can only find one characteristic by UUID.
I found there is a function GATT_DiscAllChars used to discover all characteristic of the given service.
However, as multi-role connects to the SimpleBLEPeripheral with 5 characteristics in the SimpleProfile service, the number of characteristic found from ATT response is only 3. why does this happen?
// If procedure complete
if (((pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP) &&
(pMsg->hdr.status == bleProcedureComplete)) ||
(pMsg->method == ATT_ERROR_RSP))
{
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);
VOID GATT_DiscAllChars(connHandle, svcStartHdl, svcEndHdl, selfEntity);
}
}
}
else if (discState == BLE_DISC_STATE_CHAR)
{
// Characteristic found, store handle
if ((pMsg->method == ATT_READ_BY_TYPE_RSP) &&
(pMsg->msg.readByTypeRsp.numPairs > 0))
{
LCD_WRITE_STRING_VALUE("numPairs:", pMsg->msg.readByTypeRsp.numPairs, 10, LCD_PAGE7);
//find index to store handle
uint8_t connIndex = gapRoleInfo_Find(connHandle);
charHdl[connIndex] = BUILD_UINT16(pMsg->msg.readByTypeRsp.pDataList[0],
pMsg->msg.readByTypeRsp.pDataList[1]);