zstack home 1.2.2a AF接收函数疑问(CC2530DB)
zcl.c文件中有一个zcl_event_loop()函数:
uint16 zcl_event_loop( uint8 task_id, uint16 events )
{ ...
if ( *msgPtr == AF_INCOMING_MSG_CMD )
{
zcl_ProcessMessageMSG( (afIncomingMSGPacket_t *)msgPtr ); //AF数据接收处理函数
...
}
zcl_samplelight.c文件中有个 zclSampleLight_event_loop( )函数:
两个event_loop( )函数分别用来处理什么任务啊?有什么不同呀
// The order in this table must be identical to the task initialization calls below in osalInitTask.
const pTaskEventHandlerFn tasksArr[] = {
macEventLoop,
nwk_event_loop,
Hal_ProcessEvent,
#if defined( MT_TASK )
MT_ProcessEvent,
#endif
APS_event_loop,
#if defined ( ZIGBEE_FRAGMENTATION )
APSF_ProcessEvent,
#endif
ZDApp_event_loop,
#if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )
ZDNwkMgr_event_loop,
#endif
zcl_event_loop,
zclSampleLight_event_loop
};
你可以理解为是不同层次的消息,类似于TCP/IP的7层协议