CC2530作为设备节点,需要知道当前有没有加入协调器
1.他第入网的时候是不是会进这个函数?ZDO_JoinConfirmCB
2.正常工作的时候,把协调器断电,2530节点会进入哪个函数?我想掉线的时候弄个LED闪烁指示
YiKai Chen:
一般都是在ZDO_STATE_CHANGE去做判斷
user5367314:
回复 YiKai Chen:
测试发现入网后进一次ZDO_STATE_CHANGE就不会再进了,
但是把协调器断电后,设备一直进ZDO_STATE_CHANGE,正常吗?
而且进的时间间隔越来越长,应该掉线后是多久进一次ZDO_STATE_CHANGE?
YiKai Chen:
回复 user5367314:
你參考一下 e2echina.ti.com/…/104629 這個帖子吧
Alvin Chen:
回复 user5367314:
DEV_INIT, // Initialized – not connected to anything
DEV_NWK_DISC, // Discovering PAN's to join
DEV_NWK_JOINING, // Joining a PAN
DEV_NWK_SEC_REJOIN_CURR_CHANNEL, // ReJoining a PAN in secure mode scanning in current channel, only for end devices
DEV_END_DEVICE_UNAUTH, // Joined but not yet authenticated by trust center
DEV_END_DEVICE, // Started as device after authentication
DEV_NWK_ORPHAN, // Device has lost information about its parent..
DEV_NWK_BACKOFF, // Device is waiting before trying to rejoin
DEV_NWK_SEC_REJOIN_ALL_CHANNEL, // ReJoining a PAN in secure mode scanning in all channels, only for end devices
DEV_NWK_TC_REJOIN_CURR_CHANNEL, // ReJoining a PAN in Trust center mode scanning in current channel, only for end devices
DEV_NWK_TC_REJOIN_ALL_CHANNEL
你掉线状态为 DEV_NWK_ORPHAN 后面会进入DEV_END_DEVICE或者DEV_INIT,你去读置顶贴,ZDO_STATE_CHANGE代表状态变化,有不同的状态。