@@ -1639,6 +1639,10 @@ bool ws_bootstrap_validate_channel_function(ws_us_ie_t *ws_us, ws_bs_ie_t *ws_bs
1639
1639
1640
1640
static void ws_bootstrap_asynch_ind (struct protocol_interface_info_entry * cur , const struct mcps_data_ind_s * data , const struct mcps_data_ie_list * ie_ext , uint8_t message_type )
1641
1641
{
1642
+ // Store weakest heard packet RSSI
1643
+ if (cur -> ws_info -> weakest_received_rssi > data -> signal_dbm ) {
1644
+ cur -> ws_info -> weakest_received_rssi = data -> signal_dbm ;
1645
+ }
1642
1646
1643
1647
if (data -> SrcAddrMode != MAC_ADDR_MODE_64_BIT ) {
1644
1648
// Not from long address
@@ -2654,6 +2658,7 @@ static void ws_bootstrap_start_discovery(protocol_interface_info_entry_t *cur)
2654
2658
cur -> nwk_nd_re_scan_count = 0 ;
2655
2659
cur -> ws_info -> configuration_learned = false;
2656
2660
cur -> ws_info -> pan_timeout_timer = 0 ;
2661
+ cur -> ws_info -> weakest_received_rssi = 0 ;
2657
2662
2658
2663
// Clear learned neighbours
2659
2664
ws_bootstrap_neighbor_list_clean (cur );
@@ -3415,6 +3420,11 @@ void ws_bootstrap_state_machine(protocol_interface_info_entry_t *cur)
3415
3420
cur -> ws_info -> trickle_pcs_running = false;
3416
3421
cur -> ws_info -> trickle_pc_consistency_block_period = 0 ;
3417
3422
ws_fhss_configure (cur , false);
3423
+ int8_t new_default = cur -> ws_info -> weakest_received_rssi - 1 ;
3424
+ if ((new_default < CCA_DEFAULT_DBM ) && (new_default >= CCA_LOW_LIMIT ) && (new_default <= CCA_HIGH_LIMIT )) {
3425
+ // Restart automatic CCA threshold using weakest received RSSI as new default
3426
+ mac_helper_start_auto_cca_threshold (cur -> id , cur -> ws_info -> hopping_schdule .number_of_channels , cur -> ws_info -> weakest_received_rssi - 1 , CCA_HIGH_LIMIT , CCA_LOW_LIMIT );
3427
+ }
3418
3428
ws_bootstrap_start_authentication (cur );
3419
3429
break ;
3420
3430
case ER_RPL_SCAN :
0 commit comments