请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
主题中讨论的其他器件:CC2640工具/软件:TI-RTOS
大家好
我希望当 cc2640从 PC 软件狗获取 cmd 时、在 simpleBLEPerphy 中读取 cc2640的 RSSI。
我运行了 HCI_ReadRssiCmd(),但 cc2640没有反馈“HCI_GAP_EVENT_EVENT”事件。
我不知道我的代码有什么问题?
<simpleBLEPerpheral.c>
静态空 SimpleBLEPeripheral_taskFxn (UARg a0、UARg A1) { uint16_t rssiReadRate = 3000; GAPRole_SetParameter (GAPROLE_RSSI_READ_RATE、sizeof (uint16_t)、&rssiReadRate); }
bStatus_t GAPRole_SetParameter (uint16_t param、uint8_t len、void * pValue)
{
…………μ A
案例 GAPROLE_RSSI_READ_RATE:
如果(len =sizeof (uint16_t))
{
gapRole_RSSIReadRate =*((uint16_t*) pValue);
if ((gapRole_RSSIReadRate)&&(gapRole_state = GAPROLE_Connected))
{
Util_restartClock (&rssiReadClock、gapRole_RSSIReadRate);
}
}
其他
{
RET = bleInvalidRange;
}
中断;
…………
}
静态空 gapRole_init (void)
{
GAP_RegisterForMsgs (self 实体);
Util_constructClock (&rsReadClock、gapRole_clockHandler、0、0、 false、RSSI_READ_EVT);
}
静态 void gapRole_taskFxn (Uarg a0、Uarg A1)
{
………
if (events & RSSI_READ_EVT)
{
events &=~RSSI_READ_EVT;
//在连接
中仅获取 RSSI if ((gapRole_state == GAPROLE_CONNECTED)||(gapRole_state == GAPROLE_CONNECTED _ADV)
){
//要求获取 RSSI HandhciStatus_CONNECT_NULT
状态= GAPRole_Status = GAPRON_CLUS_ON_CLUSH;mConnection_CLUSH = NULL_Connection_ON_ON_ONF;
return succe//设置下一个事件 if (gapRole_RSSIReadRate &&!status){ Util_restartClock (&rssiReadClock,gapRole_RSSIReadRate;} static void gapRole_processStackMsg (iCall_HDR *pMsg ){=pcmpcmp_evt = pcmp_event_event_(pcmt_r)=pcmp_event_en_pcmp_p_event=pcmp_event=pnipt_en_event=(pcmt_event=pcmt_en_event_r_p_p_p_pcmt_event=p_event=pcmt_each_p_e=p&r&r&r&r&r&r&r&r&r=pcmt_pcmpcmt_pcmt_r&r&r&r&r&r&r&r&r&
if (((gapRole_state =GAPROLE_Connected)||(gapRole_state =GAPROLE_Connected_ADV)&&(RSSI!=_NOT_Available))
{
//将 RSSI 报告到 APP
IF (pGapRoles_AppCRSSI && pGapRoles_AppCgs)
};{>psiRsprue->rspruags->pssnrgspruags->rfrs/snrgssnrgssrad&pdsp}
}
typedef void (* gapRolesRssiRead_t)(int8_t newRSSI); typedef 结构 { gapRolesStateNotify_t pfnStateChange; gapRolesRssiRad_t pfnRssiRead; }gapRolesCBs_t;