@@ -1066,51 +1066,39 @@ static void ws_bootstrap_pan_config_analyse(struct protocol_interface_info_entry
1066
1066
ws_neighbor_class_neighbor_broadcast_schedule_set (neighbor_info .ws_neighbor , & ws_bs_ie );
1067
1067
1068
1068
if (cur -> ws_info -> configuration_learned ) {
1069
- // received version is lower se we need to reset the trickle
1069
+ tr_info ( "PAN Config analyse own:%d, heard:%d" , cur -> ws_info -> pan_information . pan_version , pan_version );
1070
1070
if (cur -> ws_info -> pan_information .pan_version == pan_version ) {
1071
+ // Same version heard so it is consistent
1071
1072
trickle_consistent_heard (& cur -> ws_info -> trickle_pan_config );
1073
+ if (neighbor_info .neighbor -> link_role == PRIORITY_PARENT_NEIGHBOUR ) {
1074
+ ws_bootstrap_primary_parent_set (cur , & neighbor_info , WS_PARENT_SOFT_SYNCH );
1075
+ }
1076
+ // no need to process more
1077
+ return ;
1072
1078
} else {
1073
- tr_info ( "different pan version heard" );
1079
+ // received version is different so we need to reset the trickle
1074
1080
trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config , & cur -> ws_info -> trickle_params_pan_discovery );
1081
+ if (neighbor_info .neighbor -> link_role == PRIORITY_PARENT_NEIGHBOUR ) {
1082
+ ws_bootstrap_primary_parent_set (cur , & neighbor_info , WS_PARENT_HARD_SYNCH );
1083
+ }
1075
1084
if (common_serial_number_greater_16 (cur -> ws_info -> pan_information .pan_version , pan_version )) {
1076
1085
// older version heard ignoring the message
1077
1086
return ;
1078
1087
}
1079
1088
}
1080
-
1081
-
1082
1089
}
1083
1090
1084
1091
if (cur -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER ) {
1085
1092
//Border router does not learn network information
1086
1093
return ;
1087
1094
}
1088
1095
1089
- if (cur -> ws_info -> configuration_learned ) {
1090
- bool old_version = cur -> ws_info -> pan_information .pan_version == pan_version ;
1091
- if (neighbor_info .neighbor -> link_role == PRIORITY_PARENT_NEIGHBOUR ) {
1092
- // RPL priority parent configuration we must update FHSS data
1093
- //Update synch to primary parent allways to update broadcast shedule and timing
1094
- ws_parent_synch_e synreq ;
1095
- if (old_version ) {
1096
- synreq = WS_PARENT_SOFT_SYNCH ;
1097
- } else {
1098
- synreq = WS_PARENT_HARD_SYNCH ;
1099
- }
1100
- ws_bootstrap_primary_parent_set (cur , & neighbor_info , synreq );
1101
- }
1102
-
1103
- if (old_version ) {
1104
- // No new information
1105
- return ;
1106
- }
1107
- }
1108
-
1109
1096
/*
1110
- * Learn new information from border router
1097
+ * Learn new information from neighbor
1111
1098
*/
1112
- tr_info ("Updated PAN configuration heard" );
1099
+ tr_info ("Updated PAN configuration own:%d, heard:%d" , cur -> ws_info -> pan_information . pan_version , pan_version );
1113
1100
1101
+ // restart PAN version timer
1114
1102
cur -> ws_info -> pan_version_timeout_timer = PAN_VERSION_TIMEOUT ;
1115
1103
cur -> ws_info -> pan_information .pan_version = pan_version ;
1116
1104
@@ -1264,19 +1252,19 @@ static void ws_bootstrap_asynch_ind(struct protocol_interface_info_entry *cur, c
1264
1252
switch (message_type ) {
1265
1253
case WS_FT_PAN_ADVERT :
1266
1254
// Analyse Advertisement
1267
- tr_debug ("received ADVERT" );
1255
+ tr_info ("received ADVERT Src:%s rssi:%d" , trace_array ( data -> SrcAddr , 8 ), data -> signal_dbm );
1268
1256
ws_bootstrap_pan_advertisement_analyse (cur , data , ie_ext , & ws_utt , & ws_us );
1269
1257
break ;
1270
1258
case WS_FT_PAN_ADVERT_SOL :
1271
- tr_debug ("received ADVERT SOL" );
1259
+ tr_info ("received ADVERT SOL Src:%s rssi:%d" , trace_array ( data -> SrcAddr , 8 ), data -> signal_dbm );
1272
1260
ws_bootstrap_pan_advertisement_solicit_analyse (cur , data , & ws_utt , & ws_us );
1273
1261
break ;
1274
1262
case WS_FT_PAN_CONF :
1275
- tr_debug ("received CONFIG" );
1263
+ tr_info ("received CONFIG Src:%s rssi:%d" , trace_array ( data -> SrcAddr , 8 ), data -> signal_dbm );
1276
1264
ws_bootstrap_pan_config_analyse (cur , data , ie_ext , & ws_utt , & ws_us );
1277
1265
break ;
1278
1266
default :
1279
- tr_debug ("received CONFIG SOL" );
1267
+ tr_info ("received CONFIG SOL Src:%s rssi:%d" , trace_array ( data -> SrcAddr , 8 ), data -> signal_dbm );
1280
1268
ws_bootstrap_pan_config_solicit_analyse (cur , data , & ws_utt , & ws_us );
1281
1269
break ;
1282
1270
}
@@ -1946,10 +1934,8 @@ static void ws_bootstrap_advertise_start(protocol_interface_info_entry_t *cur)
1946
1934
{
1947
1935
cur -> ws_info -> trickle_pa_running = true;
1948
1936
trickle_start (& cur -> ws_info -> trickle_pan_advertisement , & cur -> ws_info -> trickle_params_pan_discovery );
1949
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_advertisement , & cur -> ws_info -> trickle_params_pan_discovery );
1950
1937
cur -> ws_info -> trickle_pc_running = true;
1951
1938
trickle_start (& cur -> ws_info -> trickle_pan_config , & cur -> ws_info -> trickle_params_pan_discovery );
1952
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config , & cur -> ws_info -> trickle_params_pan_discovery );
1953
1939
}
1954
1940
1955
1941
static void ws_bootstrap_pan_version_increment (protocol_interface_info_entry_t * cur )
0 commit comments