diff --git a/CHANGELOG.md b/CHANGELOG.md index 489eaf7301a4..90c4645e0bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Changes * Statistics for MAC data request latencies. Separated to adaptation layer and MAC queueing delays. * Changed initial EAPOL-key retries from trickle to exponential backup. +* Adjusted stagger random from [min,max] to [min,min+max] and for small networks set the stagger value to 10 seconds. ### Bug fixes * Added ignoring of retry messages from RADIUS server when waiting EAP-TLS diff --git a/source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c b/source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c index 83bca13189bb..3069e00a56c2 100644 --- a/source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c +++ b/source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c @@ -870,7 +870,12 @@ bool protocol_6lowpan_stagger_estimate_get(int8_t interface_id, uint32_t data_am datarate = STAGGER_DATARATE_FOR_APPL(datarate); } - stagger_value = 1 + ((data_amount * 1024 * 8 * network_size) / datarate); + // For small networks sets 10 seconds stagger + if (network_size <= 100 && ws_info(cur_interface)) { + stagger_value = 10; + } else { + stagger_value = 1 + ((data_amount * 1024 * 8 * network_size) / datarate); + } /** * Example: * Maximum stagger value to send 1kB to 100 device network using data rate of 50kbs: @@ -882,7 +887,7 @@ bool protocol_6lowpan_stagger_estimate_get(int8_t interface_id, uint32_t data_am if (stagger_value > 0xFFFF) { *stagger_max = 0xFFFF; } else { - *stagger_max = (uint16_t)stagger_value; + *stagger_max = (uint16_t)stagger_value + *stagger_min; } // Randomize stagger value