Hi Noridc guys
recently I got some issues about how to know device network state. then I found there was a issue in zb_bdb_is_factory_new() API.
first, i formed a network by coordinator, and then i triggered zigbee netwrok steering in SLEEPY END DEVICE by calling bdb_start_top_level_commissioning( ZB_BDB_NETWORK_STEERING ) function. when the stack posted a steering success event by zboss_signal_handler() signal ZB_BDB_SIGNAL_DEVICE_FIRST_START, I tried to call ZB_JOINED() function and it return TRUE, it is correct. but when I called zb_bdb_is_factory_new() function, it also return TRUE! why?
also, I did another test. firstly i formed a network by a coordinator, then I made the SLEEPY END DEVICE join this coordinator and waited it success, and then i cut off the power of parent device( gateway ). after few seconds later, stack posted a event ZB_ZDO_SIGNAL_LEAVE with status RET_OK. when all these preparation were done, i tried to leave this network by calling do_leave() function in DK demo code. upon stack told me leave was complete status RET_OK, i recalled zb_bdb_is_factory_new() function. i expected the result is TRUE, but it returned FALSE! how could it be?
can anyone tells me how to know the device network state excatly? im really confused. thx.