sapi.c中的SAPI_Init()函数。
ZDO_RegisterForZDOMsg( sapi_TaskID, NWK_addr_rsp );
表示接收某任务 要订阅某一种簇的消息 。
但是afRegister( &sapi_epDesc ),却又注册了AppNumInClusters和pAppInClusterList,那这个注册是做什么呢?
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;