Skip to content

Commit 02942b0

Browse files
author
Juha Heiskanen
authored
Merge pull request #2046 from ARMmbed/iotthd-3260
Wi-sun dicovery trickle update
2 parents 572861b + 5020291 commit 02942b0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
672672
return -3;
673673
}
674674

675-
675+
//Enable Power bootup timer setup
676+
cur->ws_info->power_up_setup = true;
676677
// Save FHSS api
677678
cur->ws_info->fhss_api = ns_sw_mac_get_fhss_api(cur->mac_api);
678679

@@ -1955,7 +1956,12 @@ static void ws_bootstrap_start_discovery(protocol_interface_info_entry_t *cur)
19551956
// Reset advertisement solicit trickle to start discovering network
19561957
cur->ws_info->trickle_pas_running = true;
19571958
trickle_start(&cur->ws_info->trickle_pan_advertisement_solicit, &cur->ws_info->trickle_params_pan_discovery);
1958-
trickle_inconsistent_heard(&cur->ws_info->trickle_pan_advertisement_solicit, &cur->ws_info->trickle_params_pan_discovery);
1959+
if (cur->ws_info->power_up_setup) {
1960+
cur->ws_info->power_up_setup = false;
1961+
tr_debug("PAS init I %u and t %u", cur->ws_info->trickle_pan_advertisement_solicit.I, cur->ws_info->trickle_pan_advertisement_solicit.t);
1962+
} else {
1963+
trickle_inconsistent_heard(&cur->ws_info->trickle_pan_advertisement_solicit, &cur->ws_info->trickle_params_pan_discovery);
1964+
}
19591965

19601966
// Discovery statemachine is checkked after two trickle interval
19611967
cur->bootsrap_state_machine_cnt = 2 * cur->ws_info->trickle_params_pan_discovery.Imin + randLIB_get_8bit() % 50;

source/6LoWPAN/ws/ws_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef struct ws_info_s {
7979
bool trickle_pa_running: 1;
8080
bool trickle_pcs_running: 1;
8181
bool trickle_pc_running: 1;
82+
bool power_up_setup: 1;
8283
// default fhss parameters for this device
8384
uint8_t fhss_uc_dwell_interval;
8485
uint8_t fhss_bc_dwell_interval;

0 commit comments

Comments
 (0)