Part Number:CC2642R
环境:simplelink_cc13xx_cc26xx_sdk_7_40_00_77
示例:simple_central
关于特征值发现过程的疑问点:
在SimpleCentral_processGATTDiscEvent中处理特征值发现的时候,需要将成功发现到的特征值charHandle进行存储,用于后续的特征值读写,如下面语句:
else if (discState == BLE_DISC_STATE_CHAR){// Characteristic found, store handleif ((pMsg->method == ATT_READ_BY_TYPE_RSP) &&(pMsg->msg.readByTypeRsp.numPairs > 0)){uint8_t connIndex = SimpleCentral_getConnIndex(scConnHandle);// connIndex cannot be equal to or greater than MAX_NUM_BLE_CONNSSIMPLECENTRAL_ASSERT(connIndex < MAX_NUM_BLE_CONNS);// Store the handle of the simpleprofile characteristic 1 valueconnList[connIndex].charHandle= BUILD_UINT16(pMsg->msg.readByTypeRsp.pDataList[3],pMsg->msg.readByTypeRsp.pDataList[4]);... ...}discState = BLE_DISC_STATE_IDLE;}
其中存储特征值charHandle的时候:
connList[connIndex].charHandle = BUILD_UINT16(pMsg->msg.readByTypeRsp.pDataList[3], pMsg->msg.readByTypeRsp.pDataList[4]);
pDataList中数据对应的格式是怎样的?为什么pDataList[3]和pDataList[4]组成了charHandle?关于这个问题,哪里有文档说明?或者代码上有相关定义吗?
Yolande Wang:
您好,
关于您的问题我询问了,更了解此 SDK 的工程师,请关注链接回复:https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1341269/cc2642r-doubts-about-the-eigenvalue-discovery-process
,
Yolande Wang:
pDataList 的格式由蓝牙规范定义,在该规范中它被称为属性数据列表。请检查蓝牙 Core_v5.3 规范中的以下部分:
3.4.4.2属性数据列表格式的ATT_READ_BY_TYPE_RSP
3.3.1属性值字段 格式的特征声明。
正如您所看到的,从这些表中,特征值句柄从属性数据列表的第 4 个字节开始。
您还可以在我们的蓝牙低功耗自定义配置文件 SLA中找到更多信息。
我希望这有帮助,