我用的官方的hid工程文件。里面没有蓝牙状态的读取。需要从simple_peripheral中移植这部分事件已经函数处理部分。现在移植了
1、#define SBP_ICALL_EVT ICALL_MSG_EVENT_ID // Event_Id_31
#define SBP_QUEUE_EVT UTIL_QUEUE_EVENT_ID // Event_Id_30
#define SBP_PERIODIC_EVT Event_Id_00
2、 if (events & SBP_QUEUE_EVT)
{
while (!Queue_empty(appMsgQueue))
{
sbpEvt_t *pMsg = (sbpEvt_t *)Util_dequeueMsg(appMsgQueue);
if (pMsg)
{
// Process message.
SimpleBLEPeripheral_processAppMsg(pMsg);
// Free the space from the message.
ICall_free(pMsg);
}
}
}
3、 SimpleBLEPeripheral_processAppMsg(pMsg);
4、 SimpleBLEPeripheral_processStateChangeEvt((gaprole_States_t)pMsg->
hdr.state);
在SimpleBLEPeripheral_processStateChangeEvt 处理函数里面。读取几种状态,对应点亮
