void StackEventHandler(uint32 event, void* eventParam);
void IasEventHandler(uint32 event, void* eventParam);
void HandleAlertLEDs(uint8 status);
/*******************************************************************************/
int main()
{
CyGlobalIntEnable;
/* Start the BLE component and register StackEventHandler function */
CyBle_Start(StackEventHandler);
/* Start the PWM component */
PWM_Start();
/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);
while(1)
{
/* Process all the pending BLE tasks. This single API call to
* will service all the BLE stack events. This API MUST be called at least once
* in a BLE connection interval */
CyBle_ProcessEvents();
}
}
这个 函数中 控制灯的 状态 void IasEventHandler(uint32 event, void* eventParam);
但是 循环中 没有调用 void IasEventHandler(uint32 event, void* eventParam); 那么为啥灯的状态可以变?
已解决! 转到解答。
/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);
上面的function把IasEventHandler这个函数传递到CyBle_IasApplCallback。
然后在下面的function里执行的
CyBle_IassWriteCmdEventHandler
都是通过callback的方式调用的。
请问你用的是psoc6 ble的kit吗?是在哪个SDK上跑的demo?
/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);
上面的function把IasEventHandler这个函数传递到CyBle_IasApplCallback。
然后在下面的function里执行的
CyBle_IassWriteCmdEventHandler
都是通过callback的方式调用的。