Other Parts Discussed in Thread: CC2640, SIMPLELINK-CC13XX-CC26XX-SDK
主题中讨论的其他器件:CC2640
大家好、
主器件为 cc2642、从器件为 cc2640。
当一个主站有6个从站时、 我可以开启"通知"并执行数据传输。 当一个主器件 有7个从器件时、第七个从器件无法开启"通知"。 当一个主器件有8个从器件时、第七个从器件 也无法开启"通知"。 如果 连接到主器件的从器件数量超过6个、我应该进行哪些修改来解决这个问题?
for(i=0;i<MAX_NUM_BLE_CONNS;i++)
{
req.pValue = GATT_bm_alloc(connList[i].connHandle, ATT_WRITE_REQ, 2, NULL);
if ( req.pValue != NULL )
{
if(index ==SIMPLEPROFILE_CHAR1)
{
req.handle = connList[i].charHandle+1;
}
else if(index ==SIMPLEPROFILE_CHAR2)
{
req.handle = connList[i].charHandle+5;
}
req.len = 2;
req.pValue[0] = LO_UINT16(GATT_CLIENT_CFG_NOTIFY); //0x0001 is to turn on 'notify'.
req.pValue[1] = HI_UINT16(GATT_CLIENT_CFG_NOTIFY);
req.sig = 0;
req.cmd = 0;
uint8_t status = GATT_WriteCharValue(connList[i].connHandle, &req, selfEntity);
// System_printf("Notification connHandle:%d,%d\r\n",connList[i].connHandle,i);
CPUdelay(100);//250 * 48 / 4 //6*3
if ( status != SUCCESS )
{
GATT_bm_free((gattMsg_t *)&req, ATT_WRITE_REQ);
#ifdef uart_debug
// System_printf("Notification failed:%d\r\n",i);
pStrAddr = (uint8_t*) Util_convertBdAddr2Str(connList[i].addr);
System_printf( "Notification failed:%d , %s\r\n", i,pStrAddr);
#endif
// return false;
i--;
// CPUdelay(6*3);
}
// else
// {
// // SimpleCentral_autoConnect();
// // System_printf("Notification success:%d\r\n",i);
// return true;//return use careful!
// }
}
}
此致、
Katherine