diff --git a/source/6LoWPAN/ws/ws_bootstrap.c b/source/6LoWPAN/ws/ws_bootstrap.c index e02fb1a6698..391a15f979c 100644 --- a/source/6LoWPAN/ws/ws_bootstrap.c +++ b/source/6LoWPAN/ws/ws_bootstrap.c @@ -126,7 +126,10 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_ } if (reason == ADDR_CALLBACK_DAD_COMPLETE) { - ws_bootsrap_event_trig(WS_ADDRESS_ADDED, interface->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, (void *)addr); + //Trig Address Registartion only when Bootstrap is ready + if (interface->nwk_bootstrap_state == ER_BOOTSRAP_DONE) { + ws_bootsrap_event_trig(WS_ADDRESS_ADDED, interface->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, (void *)addr); + } } else if (reason == ADDR_CALLBACK_DELETED) { // What to do? } @@ -1194,6 +1197,9 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle) * */ + } else if (event == RPL_EVENT_DAO_PARENT_SWITCH) { + tr_info("RPL parent update ... register ARO"); + ws_bootsrap_event_trig(WS_ADDRESS_ADDED, cur->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, NULL); } cur->ws_info->rpl_state = event; tr_info("RPL event %d", event);