Merge pull request #9251 from hasnainvirk/randomizing_join_retrial

LoRaWAN: Randomizing backoff for Join process
pull/9599/head
Martin Kojtal 2019-01-07 10:24:30 +00:00 committed by GitHub
commit 4ec7dd722d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -282,6 +282,8 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
if (bands[i].off_time != 0) {
next_tx_delay = MIN(bands[i].off_time - txDoneTime, next_tx_delay);
// add a random delay from 200ms to a 1000ms
next_tx_delay += (rand() % 800 + 200);
}
} else {
// if network has been joined