Skip to content

CalculateBackOff is called twice for delayed transmissions? #282

@jamesl-dm

Description

@jamesl-dm

In the development branch, ScheduleTx calls CalculateBackOff each time a transmission is scheduled:

static LoRaMacStatus_t ScheduleTx( void )
{
    ...
    // Update Backoff
    CalculateBackOff( LastTxChannel );
    ...
    // Schedule transmission of frame
    if( dutyCycleTimeOff == 0 )
    {
        // Try to send now
        return SendFrameOnChannel( Channel );
    }
    else
    {
        // Send later - prepare timer
        LoRaMacState |= LORAMAC_TX_DELAYED;
        TimerSetValue( &TxDelayedTimer, dutyCycleTimeOff );
        TimerStart( &TxDelayedTimer );

        return LORAMAC_STATUS_OK;
    }
}

It looks like if there is no available channel and the transmission is delayed, ScheduleTx will be called a second time. CalculateBackoff would then be called a second time, resulting in AggregatedTimeOff being incremented twice instead of once?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions