如下所示:使用例程中蓝牙从机,一共5个Characteristic,在主机中获取了一个句柄charHdl ,可以对第一个Characteristic进行写数据,第3个Characteristic也可以写,句柄怎么获取?
else if(centralConnList[connItem].discState == BLE_DISC_STATE_CHAR)
{
// Characteristic found, store handle
if(pMsg->method == ATT_READ_BY_TYPE_RSP &&
pMsg->msg.readByTypeRsp.numPairs > 0)
{
centralConnList[connItem].charHdl = BUILD_UINT16(pMsg->msg.readByTypeRsp.pDataList[0],
pMsg->msg.readByTypeRsp.pDataList[1]);
centralConnList[connItem].procedureInProgress = FALSE;
// Start do read or write
tmos_start_task(centralConnList[connItem].taskID, START_READ_OR_WRITE_EVT, DEFAULT_READ_OR_WRITE_DELAY); //开启一个读写测试任务
// Display Characteristic 1 handle
PRINT("numPairs:%d Found Characteristic 1 handle : %x \n",pMsg->msg.readByTypeRsp.numPairs, centralConnList[0].charHdl); //输出handle值
}