@@ -336,7 +336,9 @@ static void ws_bootstrap_pan_advertisement_analyse_active(struct protocol_interf
336
336
if (pan_information -> routing_cost <= cur -> ws_info -> pan_information .routing_cost ) {
337
337
trickle_consistent_heard (& cur -> ws_info -> trickle_pan_advertisement );
338
338
} else {
339
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery );
339
+ if (trickle_running (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery )) {
340
+ trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery );
341
+ }
340
342
}
341
343
342
344
}
@@ -465,7 +467,9 @@ static void ws_bootstrap_pan_advertisement_solicit_analyse(struct protocol_inter
465
467
* An inconsistent transmission is defined as:
466
468
* A PAN Advertisement Solicit with NETNAME-IE matching that of the receiving node.
467
469
*/
468
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery );
470
+ if (trickle_running (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery )) {
471
+ trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_advertisement ,& trickle_params_pan_discovery );
472
+ }
469
473
/*
470
474
* A consistent transmission is defined as
471
475
* a PAN Advertisement Solicit with NETNAME-IE / Network Name matching that configured on the receiving node.
@@ -540,7 +544,9 @@ static void ws_bootstrap_pan_config_analyse(struct protocol_interface_info_entry
540
544
common_serial_number_greater_16 (cur -> ws_info -> pan_information .pan_version , pan_version )) {
541
545
// received version is lower se we need to reset the trickle
542
546
tr_info ("older pan version heard" );
543
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery );
547
+ if (trickle_running (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery )) {
548
+ trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery );
549
+ }
544
550
return ;
545
551
}
546
552
trickle_consistent_heard (& cur -> ws_info -> trickle_pan_config );
@@ -626,7 +632,9 @@ static void ws_bootstrap_pan_config_solicit_analyse(struct protocol_interface_in
626
632
* A PAN Configuration Solicit with a PAN-ID matching that of the receiving node and
627
633
* a NETNAME-IE / Network Name matching the network name configured on the receiving
628
634
*/
629
- trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery );
635
+ if (trickle_running (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery )) {
636
+ trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config ,& trickle_params_pan_discovery );
637
+ }
630
638
}
631
639
static bool ws_bootstrap_network_found (protocol_interface_info_entry_t * cur )
632
640
{
@@ -907,7 +915,7 @@ static void ws_bootstrap_fhss_activate(protocol_interface_info_entry_t *cur)
907
915
tr_debug ("MAC init" );
908
916
mac_helper_pib_boolean_set (cur , macRxOnWhenIdle , true);
909
917
cur -> lowpan_info &= ~INTERFACE_NWK_CONF_MAC_RX_OFF_IDLE ;
910
- ws_bootstrap_mac_activate (cur , 11 , cur -> ws_info -> network_pan_id , true);
918
+ ws_bootstrap_mac_activate (cur , cur -> ws_info -> hopping_schdule . fixed_channel , cur -> ws_info -> network_pan_id , true);
911
919
return ;
912
920
}
913
921
@@ -1032,6 +1040,7 @@ static void ws_bootstrap_network_discovery_configure(protocol_interface_info_ent
1032
1040
cur -> ws_info -> hopping_schdule .fhss_bc_dwell_interval = 200 ;
1033
1041
// By default, uses fixed channel
1034
1042
cur -> ws_info -> hopping_schdule .channel_function = WS_FIXED_CHANNEL ;
1043
+ cur -> ws_info -> hopping_schdule .fixed_channel = randLIB_get_random_in_range (11 ,25 );
1035
1044
1036
1045
//Set Network names, Pan information configure, hopping schedule & GTKHash
1037
1046
ws_llc_set_network_name (cur , (uint8_t * )cur -> ws_info -> network_name , strlen (cur -> ws_info -> network_name ));
0 commit comments