1. CC2640R2F可以使用不同特征值同时发送数据吗?按下面程序这样发, 两个特征接着发
attWriteReq_t req;
req.pValue = GATT_bm_alloc(connHandle, ATT_WRITE_REQ, sendstrlen[sendcount % MAXSENDSIZE], NULL);
if ( req.pValue != NULL )
{
req.handle = charHdl;
req.len = sendstrlen[sendcount % MAXSENDSIZE];
memcpy(req.pValue, sendstr[sendcount % MAXSENDSIZE], sendstrlen[sendcount % MAXSENDSIZE]);
req.sig = 0;
req.cmd = 0;
uint8_t status = GATT_WriteCharValue(connHandle, &req, selfEntity);
handlecount++;
handlecount %= 2;
if ( status != SUCCESS )
{
GATT_bm_free((gattMsg_t *)&req, ATT_WRITE_REQ); }
else
{
}
}
attWriteReq_t req1;
req1.pValue = GATT_bm_alloc(connHandle, ATT_WRITE_REQ, sendstrlen[sendcount % MAXSENDSIZE], NULL);
if ( req1.pValue != NULL )
{
req1.handle = charHdl + 4;
req1.len = sendstrlen[sendcount % MAXSENDSIZE];
memcpy(req1.pValue, sendstr[sendcount % MAXSENDSIZE], sendstrlen[sendcount % MAXSENDSIZE]);
req1.sig = 0;
req1.cmd = 0;
uint8_t status = GATT_WriteCharValue(connHandle, &req1, selfEntity);
handlecount++;
handlecount %= 2;
if ( status != SUCCESS )
{
GATT_bm_free((gattMsg_t *)&req1, ATT_WRITE_REQ); }
else
{
}
}
2. CC2640R2F蓝牙通信是全双工还是半双工的?
Alvin Chen:
时分全双工,上面不是同时的操作是一个先一个后句柄设置对了就可以。
WK C:
回复 Alvin Chen:
可以理解为 不同句柄之间发送数据不用考虑连接间隔 , 只要两个句柄发送有一定间隔就可以