Skip to content

Commit 50a1b26

Browse files
rdyjshiCheng-SG
authored andcommitted
[dev:lora]when freqband num is 0 and method is DEF_JOIN_METHOD,
enter the SCAN_JOIN_METHOD mode to scan the whole freqband.
1 parent b98d819 commit 50a1b26

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

kernel/protocols/lorawan/linkwan/linkwan.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,15 @@ static void MlmeConfirm( MlmeConfirm_t *mlmeConfirm )
304304
}
305305

306306
if (g_freqband_num == 0) {
307-
g_join_method = DEF_JOIN_METHOD;
308-
rejoin_delay = 60 * 60 * 1000; // 1 hour
309-
DBG_LINKWAN("Wait 1 hour for new round of scan\r\n");
307+
if (g_join_method == DEF_JOIN_METHOD) {
308+
g_join_method = (g_join_method + 1) % JOIN_METHOD_NUM;
309+
rejoin_delay = generate_rejoin_delay();
310+
get_freqband_num();
311+
} else {
312+
g_join_method = DEF_JOIN_METHOD;
313+
rejoin_delay = 60 * 60 * 1000; // 1 hour
314+
DBG_LINKWAN("Wait 1 hour for new round of scan\r\n");
315+
}
310316
} else {
311317
g_freqband_num--;
312318
rejoin_delay = generate_rejoin_delay();

0 commit comments

Comments
 (0)