Lora-net/LoRaMac-node

DutyCycle calculation understanding

Closed this issue · 0 comments

Hi,

I'm trying to figure out how you implement the algorithm to calculate TimeCredits consumption for DutyCycle restriction.
Before the commit b6f383c (Refactored and improved the way the duty-cycle is managed), there was a mention of sliding window, but i can't find it after.

For now i can only find where TimeCredits for a band are consumed (after a TxDone) but how are they resupplied over time ? For what i understand, TimeCredits for a band is only set to its MaxTimeCredits only DUTY_CYCLE_TIME_PERIOD ms or more after last time the band has been updated.

For me, the actual duty cycle management allow the example below but doesn't respect duty cycle limitation.

example

Can you explain how we can guarantee the duty cycle limitation at any time and why do you not use the sliding window for the duty cycle anymore ?