Other Parts Discussed in Thread: Z-STACK
一个节点设备在未加入网络前,先禁止加入网络,需加入网络时,通过操作按键允许加入网络,如何操作?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Other Parts Discussed in Thread: Z-STACK
一个节点设备在未加入网络前,先禁止加入网络,需加入网络时,通过操作按键允许加入网络,如何操作?
The joining permission can be configured using the NLME_PermitJoiningRequest() function. The function has one parameter, PermitDuration, which defines the length of time which the coordinator/router will be allowing associations. The values 0x00 and 0xff indicate that permission disabled or enabled, respectively without a time limit. Values 0x01 – 0xFE are the number of seconds to allow joining.
To enable/disable joining on all routers in the network, the ZC (Zigbee Coordinator) can issue Mgmt_Permit_Joining_req message with broadcast address by calling the ZDP_MgmtPermitJoinReq() function. The following codes snippet shows how to use the function:
zAddrType_t dstAddr; ........... // enable permit joining on all routers dstAddr.addrMode = AddrBroadcast; dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVZCZR; ZDP_MgmtPermitJoinReq(&dstAddr, 0xFF, 1, FALSE); ........... // disable permit joining on all routers dstAddr.addrMode = AddrBroadcast; dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVZCZR; ZDP_MgmtPermitJoinReq(&dstAddr, 0x00, 1, FALSE);
More information regarding the function can be found in the SWRA195 Z-Stack Application Programming Interface (API) document.