2023年12月20日发(作者:)
3
4
5
8
10
11
1 aps_Group_t;typedef struct
{uint16 ID;//ID uint8 name[APS_GROUP_NAME_LEN];//} aps_Group_t;213
typedef structapsGroupItem{ struct apsGroupItem *next; //uint8endpoint;//aps_Group_tgroup;//ID} apsGroupItem_t;
3 rtgEntry_t;
typedef struct{uint16dstAddress;//uint16nextHopAddress;//byteexpiryTime;//bytestatus;//} rtgEntry_t;
4 BindingEntry_t; typedef struct{uint8 srcEP;//uint8dstGroupMode;//; 0 –, 1 –uint16dstIdx;// () NVRAM//dstGroupMode = 0 - AddressManager index//dstGroupMode = 1 –uint8dstEP;//uint8numClusterIds;//uint16 clusterIdList[MAX_BINDING_CLUSTER_IDS];// Don't use MAX_BINDING_CLUSTERS_ID when
// using the clusterIdList // gMAX_BINDING_CLUSTER_IDS} BindingEntry_t;5 neighborEntry_t; typedef struct{uint16neighborAddress;//uint16panId;//PANIDlinkInfo_tlinkInfo;///} neighborEntry_t;6 rtDiscEntry_t;typedef struct{byterreqId;//ID uint16 srcAddress; //uint16previousNode;//byteforwardCost;//byteresidualCost;//14
byteexpiryTime;//} rtDiscEntry_t;7 bcastEntry_t; typedef struct{uint16srcAddr; // uint8 bdt;// uint8 pat;// uint8 mbr;// uint8 handle;//. uint8 ackCnt;// uint8 id; //ID} bcastEntry_t;8 MTZDO_ConversionItem_t; typedef struct{uint16clusterID;//uint32subCBID;//uint16mtID;// SPI IDpfnMtZdoRspProcpFn;//} MTZDO_ConversionItem_t;9macRadioDefsTxPowerTable10NV zgItem_t; typedef structzgItem{uint16id;//uint16 len;//void*buf;//} zgItem_t;11 *pTaskEventHandlerFn; ( unsigned chartask_id,unsigned short event );
12mac zmacCBEventTable;13 zmacCBSizeTable;mac 14ZDP zdpMsgProcItem_t; typedef struct{uint16clusterID;//--ID()pfnZDPMsgProcessorpFn;//} zdpMsgProcItem_t;15PAN networkDesc_t; typedef struct15
{uint16panId;//PAN IDbytelogicalChannel; //bytebeaconOrder;//byte superFrameOrder; //byte routerCapacity;//byte deviceCapacity;//byte version;//byte stackProfile;//profilestack//byte securityLevel;uint16 chosenRouter;//uint8chosenRouterLinkQuality; //bytechosenRouterDepth;//uint8 extendedPANID[Z_EXTADDR_LEN];//PAN IDvoid*nextDesc;//PAN} networkDesc_t; endPointDesc_t;typedefstruct{byteendPoint;//byte*task_id;// Pointer to locationof theApplication task ID.
//–,IDSimpleDescriptionFormat_t *simpleDesc;//afNetworkLatencyReq_tlatencyReq;//nolatencyreqs} endPointDesc_t; epList_t typedef struct
{endPointDesc_t*epDesc;//eEP_Flagsflags;pDescCBpfnDescCB;// Don't use if this functionpointer is NULL.
void*nextDesc;} epList_t; associated_devices_t typedef struct
{UINT16 shortAddr; //
uint16addrIdx;//bytenodeRelation;bytedevStatus;//bitmap of various status valuesbyteassocCnt;linkInfo_tlinkInfo;} associated_devices_t;16171816
1AssociatedDevListNWK_MAX_DEVICES2neighborTableMAX_NEIGHBOR_ENTRIES3rtgTableMAX_RTG_ENTRIES4rtDiscTableMAX_RREQ_ENTRIES5bcastTableMAX_BCAST6BindingTableNWK_MAX_BINDING_ENTRIES7 SampleApp_Group1tasksArr2tasksEvents 2*3macRadioDefsTxPowerTable4zgItemTable staticuint8 zgItemInit( uint16 id, uint16 len, void*buf,uint8 setDefault )
//1ZDOzdpMsgProcsoid ZDP_IncomingData( afIncomingMSGPacket_t *pData )
//2MTmtzdoConvTable3MACzmacCBEventTable4MAC zmacCBSizeTablevoidMAC_CbackEvent(macCbackEvent_t*pData)//1PAN NwkDescList2epListvoid afInit( void )//Status_tafRegister( endPointDesc_t*epDesc )//1 halTimerSettings_thalTimerRecord2halTimerChannel_thalTimerChannelHalTimerStartHalTimerStop17
ZigBee5.1ZigBee5.25.2.1AssociatedDevListAssociatedDevList1235.2.2NWK_addr_reqIEEE_addr_reqNWK_addr_reqIEEE_addr_reqZDP_ADDR_REQTYPE_EXTENDEDNode_Desc_reqNLME_GetCoordShortAddrZDP_NwkAddrReq5.3AssociatedDevListIEEEAssociatedDevListAssociatedDevListgeZigBeeNLME_GetCoordExtAddr5.4()18
5.5(PANID)?PanIDFlashRAMPanIDCOORDRouterFlashRFtypedef struct{UINT16 shortAddr;
uint16addrIdx;bytenodeRelation;bytedevStatus;byteassocCnt;linkInfo_tlinkInfo;} associated_devices_t;devStatus#define DEV_LINK_STATUS#define DEV_LINK_REPAIR#define DEV_SEC_INIT_STATUS#define DEV_SEC_AUTH_STATUSnodeRelation// Node Relations#define PARENT0x01 // link is in-active?0x02 // link repair inprogress? 0x04 // security init0x08 // security authenticated////////bitmap of various statusvalues//IEEE10////////////RFRF#defineCHILD_RFD1#defineCHILD_RFD_RX_IDLE 2#defineCHILD_FFD3#defineCHILD_FFD_RX_IDLE 4//#define NEIGHBOR5#define OTHER6#define NOTUSEDtypedef struct{uint8txCost;0xFF //// counter of transmission success/failuresrssiuint8rxCost; // average of received rssi valuesuint8inKeySeqNum;// security key sequence number19
uint32inFrmCntr;} linkInfo_t;
// security frame counter..6.16.1.1AZDO_NETWORK_INITB16BZDApp_event_loopIDNLME_NetworkFormationRequestlibvoid ZDO_NetworkFormationConfirmCB( ZStatus_t Status )statusCode,uint16 statusValue )ZDO_NetworkFormationConfirmCBClibZDO_NetworkFormationConfirmCBZDApp_event_loopIDZDO_NETWORK_STARTDZDApp_NetworkStartEvtZDApp_event_loopIDBZDApp_event_loopZDO_STATE_CHANGE_EVTEE FZDO_UpdateNwkStatusZDO_STATE_CHANGEZDApp_event_loopF16void nwk_Status( uint16nwk_StatusDZDO_NETWORK_INITIDSampleApp_ProcessEventIDIDSAMPLEAPP_SEND_PERIODIC_MSG_EVTG GZDApp_event_loopSAMPLEAPP_SEND_PERIODIC_MSG_EVT1BC—D2ZDO_StartDeviceGif ( ret != ZSuccess )
osal_start_timerEx(ZDAppTaskID, ZDO_NETWORK_INIT, NWK_RETRY_DELAY );
ret== ZSuccess6.1.2AZDApp_event_loopIDZDO_NWK_UPDATE_NVZDApp_SaveNetworkStateEvt6.2ZDApp_event_ osal_start_system( void )_NWK_UPDATE_NVID20
poll _SyncIndicationCB( bytetype,uint16 shortAddr ).h/**Thisfunction allowsthe next higher layer to request that itself* or another deviceleave thenetwork.--* @MT SPI_CMD_NLME_LEAVE_REQ*/externZStatus_t NLME_LeaveReq( NLME_LeaveReq_t* req );
/**Thisfunction allows the next higher layer to be notifiedof the* results of its request for itselfor anotherdevicetoleavethe* network.--* @MT SPI_CB_NLME_LEAVE_CNF*/externvoid NLME_LeaveCnf( NLME_LeaveCnf_t* cnf );
/**Thisfunction allows the next higher layer of a device to be
* notified of a remote leave request.--* @MT SPI_CB_NLME_LEAVE_IND*/externvoid NLME_LeaveInd( NLME_LeaveInd_t* ind );
/**Thisfunction allows the next higher layer to respondtoa leave* indication.--*/externZStatus_t NLME_LeaveRsp( NLME_LeaveRsp_t* rsp );
/************************************************************ @fn ZDO_LeaveInd* @briefThis function allowsthenexthigher layer of a
*devicetobenotifiedofa remote leave requestor*indication.--* @paramind - NLME_LeaveInd_t** @returnnone*/void ZDO_LeaveInd( NLME_LeaveInd_t*ind )/************************************************************ @fn ZDO_LeaveCnf** @briefThisfunction allowsthenexthigher layer to be
21
*notifiedof the results ofits request for thisor*a childdevice to leave the network.* @paramcnf - NLME_LeaveCnf_t* @returnnone*/void ZDO_LeaveCnf( NLME_LeaveCnf_t* cnf )/************************************************************ @fn ZDO_UpdateDeviceIndication* @briefThis function notifies the "TrustCenter" of a*networkwhenadevicejoinsorleavesthenetwork.--* @param* @param**** @returnextAddr - pointer to 64 bit address of new devicestatus- 0 if a newdevice joined securely- 1 ifa new device joined un-securely- 2 ifa deviceleftthenetworktrue if newly joineddevice shouldbe allowedto*remainonnetwork*/ZStatus_t ZDO_UpdateDeviceIndication(byte*extAddr,bytestatus )
/*********************************************************** @fn MAC_MlmeDisassociateReq** @briefThis function is usedby an associateddevice to notify the*coordinator of its intent to leave the is alsoused**by the coordinator to instructanassociateddevice to leavethe the disassociate is complete the MAC sends a
*MAC_MLME_DISASSOCIATE_CNF to the application.** input parameters** @param*pData - Pointer toparameters structure.
* output parameters** None.
* @returnNone.************************************************************/externvoidMAC_MlmeDisassociateReq(macMlmeDisassociateReq_t *pData);case SPI_CMD_NLME_LEAVE_REQ:/************************************************************ @fn nwk_MTCallbackSubLeaveIndication22
** @brief** @param** @returnProcessthe callback subscription for tionDeviceAddress - IEEE (64-bit)addressNULL*/voidnwk_MTCallbackSubLeaveIndication(byte*DeviceAddress )
/************************************************************ @fn
** @brief** @paramnwk_MTCallbackSubLeaveIndicationProcessthe callback subscription for tionDeviceAddress - IEEE (64-bit)address* @returnNULL*/voidnwk_MTCallbackSubLeaveIndication(byte*DeviceAddress )
ZDP_MgmtLeaveReqZDP_App_ProcessEventMSGpkt =
SYS_EVENT_MSG(afIncomingMSGPacket_tafIncomingMSGPacket_tMSGpktAssociatedDevListneighborTableIDIDneighborTable*)osal_msg_receive( SampleApp_TaskID );MSGpkt->F_INCOMING_MSG_CMDMSGpkt->clusterId7.1EPendPointtypedef struct
{byte endPoint;//EPendPoint23
byte *task_id;//.SimpleDescriptionFormat_t*simpleDesc;//afNetworkLatencyReq_t latencyReq;//} endPointDesc_t;//typedef struct
{byteEndPoint;uint16AppProfId;//EPID// Profile IDuint16AppDeviceId;// Device ID
byteAppDevVer:4;// DeviceVersionbyteReserved:4; //AF_V1_SUPPORT uses forAppFlags:4. ReservedbyteAppNumInClusters;cId_t*pAppInClusterList;////byteAppNumOutClusters;//cId_t*pAppOutClusterList;//} SimpleDescriptionFormat_t;e IDProfile IDDevice IDDevicesimplezb_BindDevice(TRUE, TOGGLE_LIGHT_CMD_ID, NULL) ;
ZDO_AnyClusterMatches(…)ZDP_MatchDescReq(…)fillAndSend(…)ZDP_TmpBufZDApp_epDesc(ZDOZDP_TmpBufZDAppTaskID)clusterID=Match_Desc_req,56ZDP_IncomingData(…)AF_INCOMING_MSG_CMDZDO_ProcessMatchDescReq(…)7 ZDO_ProcessMatchDescReq(…)ZDP_MatchDescRsp(…)8ZDP_MatchDescRsp9 ZDP_EPRsp(…)clusterID=Match_Desc_rsp1011ZDP_IncomingData(…)ZDO_MATCH_DESC_RSP_SENTZDP_EPRsp(…))AF_INCOMING_MSG_CMDZDO_SendMsgCBs(…)ZDO_CB_MSGMatch_Desc_reqProfile IDNULL)ZDApp_epDesc(ZDP_TmpBufZDAppTaskID12 ZDO_SendMsgCBsSAPI_ProcessZDOMsgs(…)ZDO_PROFILE_ID(sapi_TaskIDMatch_Desc_rspclusterIDZDApp_epDescSimpleDescriptionFormat_t24
clusterID20067.3afAddrType_t *de = afAddrNotPresent;nt = EP;ddr =endPointDesc_t*srcEP;EP2.4.3.1clusterID?uint16cIDTOGGLE_LIGHT_CMD_ID25


发布评论