为什么协调器建立网络错误
我在mesh1.0.0的的Samples-》GenericApp例程中修改 只是修改应用层的代码,添加预编译NV_RESTORE 我发现在应用层的处理函数ZDO_STATE_CHANGE事件里,(devStates_t)(MSGpkt->hdr.status)的值是DEV_COORD_STARTING而不是理论的DEV_ZB_COORD,且协调器的网络地址不是0x0000.请问我该如何处理 协调器启动后自建立网络
Coordinator从上电到变成 DEV_ZB_COORD是需要经历好几个状态的。
在ZDO_STATE_CHANGE可能会获得多个状态,但是对于应用层来说,最终想要的是DEV_ZB_COORD,所以用if来过滤
typedef enum
{
DEV_HOLD, // Initialized - not started automatically
DEV_INIT, // Initialized - not connected to anything
DEV_NWK_DISC, // Discovering PAN's to join
DEV_NWK_JOINING, // Joining a PAN
DEV_NWK_REJOIN, // ReJoining a PAN, 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_ROUTER, // Device joined, authenticated and is a router
DEV_COORD_STARTING, // Started as Zigbee Coordinator
DEV_ZB_COORD, // Started as Zigbee Coordinator
DEV_NWK_ORPHAN // Device has lost information about its parent..
} devStates_t;
兄弟,你的问题解决了没?我也碰到同样问题了,现在做智能家居开发,加我QQ以后多交流好吗?我QQ:410846867