请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:LP-EM-CC2340R53 工具/软件:
您好、TI
注册连接事件(GAP_CB_CONN_EVENT_ALL)后、系统会在建立蓝牙连接时冻结。 导致此问题的原因可能是什么?
我注册了连接事件处理程序、以便在蓝牙连接过程中获取 RSSI 值。
以下是我代码的修改部分:
app_connection.c:
BLEAppUtil_registerConnNotifHandler(pGapEstMsg->connectionHandle,GAP_CB_CONN_EVENT_ALL);
app_peripheral.c:
BLEAppUtil_EventHandler_t peripheralConnNotiHandler =
{
.handlerType = BLEAPPUTIL_CONN_NOTI_TYPE,
.pEventHandler = Peripheral_GAPConnReportHandler,
.eventMask = BLEAPPUTIL_CONN_NOTI_CONN_EVENT_ALL,
};
void Peripheral_GAPConnReportHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
{
switch(event)
{
case BLEAPPUTIL_CONN_NOTI_CONN_EVENT_ALL:
{
Gap_ConnEventRpt_t *report = (Gap_ConnEventRpt_t *)pMsgData;
int8_t rssi = report->lastRssi;
break;
}
default:
{
break;
}
}
}此致!
普雷斯顿