请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:LP-EM-CC2340R5 工具与软件:
您好、TI
报告 BLEAPPUTIL_PAIRING_STATE_ENCRYPTED 事件后、我需要通过 l2cap 发送数据。
如何在 app_pairing.c 中获取当前信道 ID?
此致、
普雷斯顿
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
您好、TI
报告 BLEAPPUTIL_PAIRING_STATE_ENCRYPTED 事件后、我需要通过 l2cap 发送数据。
如何在 app_pairing.c 中获取当前信道 ID?
此致、
普雷斯顿
您好、TI
我曾尝试在此处参考 CID
void L2CAPCOC_signalHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
{
if (!pMsgData)
{
// Caller needs to figure out by himself that pMsg is NULL
return;
}
/*Handle the l2cap event */
switch (event)
{
case BLEAPPUTIL_L2CAP_CHANNEL_ESTABLISHED_EVT:
{
l2capChannelEstEvt_t *pConnEvt = &((l2capSignalEvent_t *)pMsgData)->cmd.channelEstEvt;
gL2CAPCOC_AppData.CID = pConnEvt->CID;
gL2CAPCOC_AppData.peerCID = pConnEvt->info.peerCID;
但是、似乎只有在报告 BLEAPPUTIL_L2CAP_channel_established_evt 事件后才会获得 CID。
日志显示这在 BLEAPPUTIL_PAIRING_STATE_ENCRYPTED 之后发生

当 BLEAPPUTIL_PAIRING_STATE_ENCRYPTED 报告时、如何获得通过 l2cap 发送数据所需的 CID?
此致、
普雷斯顿