对于协调器接收到Device_annce消息,怎么在第一时间区分这个Device_annce的来源是路由器还是终端?
YiKai Chen:
Device_annce裡面的Capability Information bit1 標示了来源是路由器还是终端
Alvin Chen:
/** Structure defines the Capabilities Information bit field. */typedef struct _zstack_capabilityinfo_t{ /** True if the device is a PAN Coordinator */ bool panCoord; /** True if the device is a full function device (FFD) */ bool ffd; /** True if the device is mains powered */ bool mainsPower; /** True if the device's RX is on when the device is idle */ bool rxOnWhenIdle; /** True if the device is capable of sending and receiving secured frames */ bool security;} zstack_CapabilityInfo_t;
user5281211:
回复 YiKai Chen:
就是bool ffd=true则是路由器,否则是终端,对吗
YiKai Chen:
回复 user5281211:
对的