原创 【原创】ZigBee学习之30——afInit()

2010-2-11 10:27 2966 2 2 分类: MCU/ 嵌入式

#ifndef NONWK<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


//如果禁止了NWK,APS,ZDO函数功能,则需要单独初始化AF


  // Since the AF isn't a task, call it's initialization routine


  afInit();


//AF.c


void afInit( void )


{


  //开始时没有设置ENDPOINT,对于AF的初始化就是初始化ENDPOINT


  epList = NULL;


// epList_t *epList;


typedef enum


{


  eEP_AllowMatch = 1,


  eEP_NotUsed


} eEP_Flags;


 


typedef struct


{


  endPointDesc_t *epDesc;


  eEP_Flags flags;


  pDescCB  pfnDescCB;     // Don't use if this function pointer is NULL.


  void *nextDesc;


} epList_t;


//endpoint设备描述,每一个在表中的endpoint都需要有一个进入点【AF.h


typedef struct


{


  byte endPoint;


  byte *task_id;  // Pointer to location of the Application task ID.


  SimpleDescriptionFormat_t *simpleDesc;


  afNetworkLatencyReq_t latencyReq;


} endPointDesc_t;


//简单描述数据结构


typedef struct


{


  byte          EndPoint;


  uint16        AppProfId;


  uint16        AppDeviceId;


  byte          AppDevVer:4;


  byte          Reserved:4;             // AF_V1_SUPPORT uses for AppFlags:4.


  byte          AppNumInClusters;


  cId_t         *pAppInClusterList;


  byte          AppNumOutClusters;


  cId_t         *pAppOutClusterList;


} SimpleDescriptionFormat_t;


typedef enum


{


  noLatencyReqs,


  fastBeacons,


  slowBeacons


} afNetworkLatencyReq_t;


}


#endif

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
2
关闭 站长推荐上一条 /3 下一条