@@ -1132,6 +1132,10 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
11321132 ws_nud_table_reset (cur );
11331133
11341134 ws_bootstrap_candidate_table_reset (cur );
1135+ // Zero uptime counters
1136+ cur -> ws_info -> uptime = 0 ;
1137+ cur -> ws_info -> authentication_time = 0 ;
1138+ cur -> ws_info -> connected_time = 0 ;
11351139
11361140 blacklist_params_set (
11371141 WS_BLACKLIST_ENTRY_LIFETIME ,
@@ -1154,6 +1158,8 @@ void ws_bootstrap_disconnect(protocol_interface_info_entry_t *cur, ws_bootsrap_e
11541158 //Already moved to leaving state.
11551159 return ;
11561160 }
1161+ // We are no longer connected
1162+ cur -> ws_info -> connected_time = 0 ;
11571163
11581164 if (cur -> rpl_domain && cur -> nwk_bootstrap_state == ER_BOOTSRAP_DONE ) {
11591165 //Stop Asych Timer
@@ -3225,10 +3231,12 @@ static void ws_bootstrap_nw_info_updated(protocol_interface_info_entry_t *cur, u
32253231
32263232static void ws_bootstrap_authentication_completed (protocol_interface_info_entry_t * cur , auth_result_e result , uint8_t * target_eui_64 )
32273233{
3228- (void ) target_eui_64 ;
3229-
32303234 if (result == AUTH_RESULT_OK ) {
3231- tr_debug ("authentication success" );
3235+ tr_debug ("authentication success eui64:%s" , trace_array (target_eui_64 , 8 ));
3236+ if (target_eui_64 ) {
3237+ // Authentication was made contacting the authenticator
3238+ cur -> ws_info -> authentication_time = cur -> ws_info -> uptime ;
3239+ }
32323240 ws_bootstrap_event_configuration_start (cur );
32333241 } else if (result == AUTH_RESULT_ERR_TX_ERR ) {
32343242 // eapol parent selected is not working
@@ -3888,6 +3896,7 @@ void ws_bootstrap_rpl_wait_process(protocol_interface_info_entry_t *cur)
38883896
38893897 if (cur -> ws_info -> rpl_state == RPL_EVENT_DAO_DONE ) {
38903898 // RPL routing is ready
3899+ cur -> ws_info -> connected_time = cur -> ws_info -> uptime ;
38913900 ws_bootstrap_event_routing_ready (cur );
38923901 } else if (!rpl_control_have_dodag (cur -> rpl_domain )) {
38933902 // RPL not ready send DIS message if possible
@@ -4113,6 +4122,7 @@ void ws_bootstrap_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t s
41134122 } else if (ws_bootstrap_state_active (cur )) {
41144123 ws_stats_update (cur , STATS_WS_STATE_5 , 1 );
41154124 }
4125+ cur -> ws_info -> uptime ++ ;
41164126
41174127 ws_llc_timer_seconds (cur , seconds );
41184128
0 commit comments