Fix calculation of the aggregated time-off.

Perform only an assignment.

https://github.com/Lora-net/LoRaMac-node/issues/282
pull/6411/head
Kimmo Vaisanen 2018-02-16 15:36:22 +02:00 committed by Antti Kauppila
parent c1ea418ac4
commit 256a3a5842
1 changed files with 4 additions and 4 deletions

View File

@ -1273,10 +1273,10 @@ void LoRaMac::calculate_backOff(uint8_t channel)
// Update regional back-off
lora_phy->calculate_backoff(&backoff_params);
// Update aggregated time-off
_params.timers.aggregated_timeoff = _params.timers.aggregated_timeoff
+ (_params.timers.tx_toa * _params.sys_params.aggregated_duty_cycle
- _params.timers.tx_toa);
// Update aggregated time-off. This must be an assignment and no incremental
// update as we do only calculate the time-off based on the last transmission
_params.timers.aggregated_timeoff = (_params.timers.tx_toa * _params.sys_params.aggregated_duty_cycle
- _params.timers.tx_toa);
}
void LoRaMac::reset_mac_parameters(void)