Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions src/STM32CubeWL/LoRaWAN/Mac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,19 @@ typedef struct sLoRaMacCtx
* Buffer containing the MAC layer commands
*/
uint8_t MacCommandsBuffer[LORA_MAC_COMMAND_MAX_LENGTH];
/*
* Stores the reference time at at 1st JoinReq or ReJoinReq.
*
* \remark Used for the BACKOFF_DC computation.
*/
SysTime_t TxBackoffRefTime;
/*
* Indicates if \ref TxBackoffRefTime must be initialized or not.
* \ref TxBackoffRefTime must be initialized for 1st JoinReq or RejoinReq event.
*
* \remark Used for the BACKOFF_DC computation.
*/
bool IsFirstJoinReqTx;
}LoRaMacCtx_t;

/*!
Expand Down Expand Up @@ -1076,7 +1089,7 @@ static void ProcessRadioTxDone( void )
// Update last tx done time for the current channel
txDone.Channel = MacCtx.Channel;
txDone.LastTxDoneTime = TxDoneParams.CurTime;
txDone.ElapsedTimeSinceStartUp = SysTimeSub( SysTimeGetMcuTime( ), Nvm.MacGroup2.InitializationTime );
txDone.ElapsedTimeSinceTxBackoffRefTime = SysTimeSub( SysTimeGetMcuTime( ), MacCtx.TxBackoffRefTime );
txDone.LastTxAirTime = MacCtx.TxTimeOnAir;
txDone.Joined = true;
if( Nvm.MacGroup2.NetworkActivation == ACTIVATION_TYPE_NONE )
Expand Down Expand Up @@ -1398,6 +1411,9 @@ static void ProcessRadioRxDone( void )
ResetMacParameters( true );
}
#endif /* LORAMAC_VERSION */
// Restarts the retransmission backoff algorithm by indicating that the next JoinReq or ReJoinReq
// is the first one.
MacCtx.IsFirstJoinReqTx = true;
}
else
{
Expand Down Expand Up @@ -3471,6 +3487,13 @@ static LoRaMacStatus_t SendReJoinReq( JoinReqIdentifier_t joinReqType )
break;
}

if( MacCtx.IsFirstJoinReqTx == true )
{
MacCtx.IsFirstJoinReqTx = false;
// Store the current time as reference time for the retransmission backoff algorithm
MacCtx.TxBackoffRefTime = SysTimeGetMcuTime( );
}

// Schedule frame
status = ScheduleTx( allowDelayedTx );
return status;
Expand Down Expand Up @@ -3618,7 +3641,7 @@ static LoRaMacStatus_t ScheduleTx( bool allowDelayedTx )
nextChan.AggrTimeOff = Nvm.MacGroup1.AggregatedTimeOff;
nextChan.Datarate = Nvm.MacGroup1.ChannelsDatarate;
nextChan.DutyCycleEnabled = Nvm.MacGroup2.DutyCycleOn;
nextChan.ElapsedTimeSinceStartUp = SysTimeSub( SysTimeGetMcuTime( ), Nvm.MacGroup2.InitializationTime );
nextChan.ElapsedTimeSinceTxBackoffRefTime = SysTimeSub( SysTimeGetMcuTime( ), MacCtx.TxBackoffRefTime );
nextChan.LastAggrTx = Nvm.MacGroup1.LastTxDoneTime;
nextChan.LastTxIsJoinRequest = false;
nextChan.Joined = true;
Expand Down Expand Up @@ -4698,8 +4721,8 @@ LoRaMacStatus_t LoRaMacInitialization( LoRaMacPrimitives_t* primitives, LoRaMacC
TimerInit( &MacCtx.ForceRejoinReqCycleTimer, OnForceRejoinReqCycleTimerEvent );
#endif /* LORAMAC_VERSION */

// Store the current initialization time
Nvm.MacGroup2.InitializationTime = SysTimeGetMcuTime( );
// At stack initialization no JoinReq has been transmitted yet
MacCtx.IsFirstJoinReqTx = true;

#if (defined( LORAMAC_VERSION ) && (( LORAMAC_VERSION == 0x01000400 ) || ( LORAMAC_VERSION == 0x01010100 )))
// Initialize MAC radio events
Expand Down
5 changes: 3 additions & 2 deletions src/STM32CubeWL/LoRaWAN/Mac/LoRaMacInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,11 @@ typedef struct sLoRaMacNvmDataGroup2
* Aggregated duty cycle management
*/
uint16_t AggregatedDCycle;
/*!
/*!
* Stores the time at LoRaMac initialization.
* This value is no more used as defined by the LoRaWAN Specification v1.0.4.
*
* \remark Used for the BACKOFF_DC computation.
* \remark Taken in the structure only for Backward compatibility.
*/
SysTime_t InitializationTime;
/*!
Expand Down
4 changes: 2 additions & 2 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ typedef struct sSetBandTxDoneParams
/*!
* Elapsed time since initialization.
*/
SysTime_t ElapsedTimeSinceStartUp;
SysTime_t ElapsedTimeSinceTxBackoffRefTime;
}SetBandTxDoneParams_t;

/*!
Expand Down Expand Up @@ -814,7 +814,7 @@ typedef struct sNextChanParams
/*!
* Elapsed time since the start of the node.
*/
SysTime_t ElapsedTimeSinceStartUp;
SysTime_t ElapsedTimeSinceTxBackoffRefTime;
/*!
* Joined Set to true, if the last uplink was a join request
*/
Expand Down
32 changes: 11 additions & 21 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionAS923.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#define AS923_MIN_RF_FREQUENCY 915000000
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#define AS923_MAX_RF_FREQUENCY 921000000
#else
#else
#define AS923_MAX_RF_FREQUENCY 928000000
#endif

Expand Down Expand Up @@ -169,9 +169,6 @@
#undef AS923_RX_MAX_DATARATE
#define AS923_RX_MAX_DATARATE DR_5

#undef AS923_DEFAULT_MAX_EIRP
#define AS923_DEFAULT_MAX_EIRP 13.0f

/*!
* STD-T108 Ver1.4 does not require dwell-time enforcement when using LBT on channels 28 to 38
*/
Expand Down Expand Up @@ -202,9 +199,6 @@
#undef AS923_RX_MAX_DATARATE
#define AS923_RX_MAX_DATARATE DR_5

#undef AS923_DEFAULT_MAX_EIRP
#define AS923_DEFAULT_MAX_EIRP 13.0f

/*!
* STD-T108 Ver1.4 does not require dwell-time enforcement when using DC on channels 28 to 38
*/
Expand All @@ -217,19 +211,19 @@
#undef AS923_DUTY_CYCLE_ENABLED
#define AS923_DUTY_CYCLE_ENABLED 1

#elif ( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH37_CH61_LBT_DC )
#elif ( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC )

/*
* STD-T108 Ver1.4 allows the use of channels 37 to 61 with LBT and DC.
* STD-T108 Ver1.4 allows the use of channels 33 to 61 with LBT and DC.
* However dwell time enforcement must be enabled
*/

// Channel plan CHANNEL_PLAN_GROUP_AS923_1_JP_CH37_CH61_LBT_DC
// Channel plan CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC

#define REGION_AS923_FREQ_OFFSET 0

/*!
* Restrict AS923 frequencies to channels 37 to 61
* Restrict AS923 frequencies to channels 33 to 61
* Center frequencies 922.4 MHz to 928.0 MHz @ 200 kHz max bandwidth
*/
#define AS923_MIN_RF_FREQUENCY 922400000
Expand All @@ -241,17 +235,14 @@
#undef AS923_RX_MAX_DATARATE
#define AS923_RX_MAX_DATARATE DR_5

#undef AS923_DEFAULT_MAX_EIRP
#define AS923_DEFAULT_MAX_EIRP 13.0f

/*!
* Enable duty cycle enforcement
*/
#undef AS923_DUTY_CYCLE_ENABLED
#define AS923_DUTY_CYCLE_ENABLED 1

/*!
* STD-T108 Ver1.4 requires a carrier sense time of at least 128 us on channels 37 to 61
* STD-T108 Ver1.4 requires a carrier sense time of at least 128 us on channels 33 to 61
*/
#undef AS923_CARRIER_SENSE_TIME
#define AS923_CARRIER_SENSE_TIME 1
Expand Down Expand Up @@ -562,10 +553,10 @@ void RegionAS923SetBandTxDone( SetBandTxDoneParams_t* txDone )
#if defined( REGION_AS923 )
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x01010003 ))
RegionCommonSetBandTxDone( &RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#elif (defined( REGION_VERSION ) && (( REGION_VERSION == 0x02010001 ) || ( REGION_VERSION == 0x02010003 )))
RegionCommonSetBandTxDone( &RegionBands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#endif /* REGION_VERSION */
#endif /* REGION_AS923 */
}
Expand Down Expand Up @@ -617,7 +608,7 @@ void RegionAS923InitDefaults( InitDefaultsParams_t* params )

#if ( ( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP ) || \
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH24_CH38_LBT ) || \
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH37_CH61_LBT_DC ) )
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC ) )
RegionNvmGroup2->RssiFreeThreshold = AS923_RSSI_FREE_TH;
RegionNvmGroup2->CarrierSenseTime = AS923_CARRIER_SENSE_TIME;
#endif
Expand Down Expand Up @@ -1023,7 +1014,6 @@ uint8_t RegionAS923RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq )
{
uint8_t status = 0x07;
#if defined( REGION_AS923 )

// Verify radio frequency
if( VerifyRfFreq( rxParamSetupReq->Frequency ) == false )
{
Expand Down Expand Up @@ -1181,7 +1171,7 @@ LoRaMacStatus_t RegionAS923NextChannel( NextChanParams_t* nextChanParams, uint8_
identifyChannelsParam.DutyCycleEnabled = nextChanParams->DutyCycleEnabled;
identifyChannelsParam.MaxBands = AS923_MAX_NB_BANDS;

identifyChannelsParam.ElapsedTimeSinceStartUp = nextChanParams->ElapsedTimeSinceStartUp;
identifyChannelsParam.ElapsedTimeSinceTxBackoffRefTime = nextChanParams->ElapsedTimeSinceTxBackoffRefTime;
identifyChannelsParam.LastTxIsJoinRequest = nextChanParams->LastTxIsJoinRequest;
identifyChannelsParam.ExpectedTimeOnAir = GetTimeOnAir( nextChanParams->Datarate, nextChanParams->PktLen );

Expand All @@ -1194,7 +1184,7 @@ LoRaMacStatus_t RegionAS923NextChannel( NextChanParams_t* nextChanParams, uint8_
{
#if (( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP ) || \
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH24_CH38_LBT ) || \
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH37_CH61_LBT_DC ) )
( REGION_AS923_DEFAULT_CHANNEL_PLAN == CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC ) )
// Executes the LBT algorithm when operating in Japan
uint8_t channelNext = 0;

Expand Down
4 changes: 2 additions & 2 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionAS923.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ extern "C"
#define CHANNEL_PLAN_GROUP_AS923_1_JP_CH24_CH38_DC 6

/*!
* Channel plan group AS923-1 for Japan - channels 37 to 61 Listen Before Talk + Duty Cycle
* Channel plan group AS923-1 for Japan - channels 33 to 61 Listen Before Talk + Duty Cycle
* AS923_FREQ_OFFSET = 0
*/
#define CHANNEL_PLAN_GROUP_AS923_1_JP_CH37_CH61_LBT_DC 7
#define CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC 7
#endif

/*!
Expand Down
6 changes: 3 additions & 3 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionAU915.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ void RegionAU915SetBandTxDone( SetBandTxDoneParams_t* txDone )
#if defined( REGION_AU915 )
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x01010003 ))
RegionCommonSetBandTxDone( &RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#elif (defined( REGION_VERSION ) && (( REGION_VERSION == 0x02010001 ) || ( REGION_VERSION == 0x02010003 )))
RegionCommonSetBandTxDone( &RegionBands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#endif /* REGION_VERSION */
#endif /* REGION_AU915 */
}
Expand Down Expand Up @@ -976,7 +976,7 @@ LoRaMacStatus_t RegionAU915NextChannel( NextChanParams_t* nextChanParams, uint8_
identifyChannelsParam.DutyCycleEnabled = nextChanParams->DutyCycleEnabled;
identifyChannelsParam.MaxBands = AU915_MAX_NB_BANDS;

identifyChannelsParam.ElapsedTimeSinceStartUp = nextChanParams->ElapsedTimeSinceStartUp;
identifyChannelsParam.ElapsedTimeSinceTxBackoffRefTime = nextChanParams->ElapsedTimeSinceTxBackoffRefTime;
identifyChannelsParam.LastTxIsJoinRequest = nextChanParams->LastTxIsJoinRequest;
identifyChannelsParam.ExpectedTimeOnAir = GetTimeOnAir( nextChanParams->Datarate, nextChanParams->PktLen );

Expand Down
6 changes: 3 additions & 3 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionCN470.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@ void RegionCN470SetBandTxDone( SetBandTxDoneParams_t* txDone )
#if defined( REGION_CN470 )
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x01010003 ))
RegionCommonSetBandTxDone( &RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#elif (defined( REGION_VERSION ) && (( REGION_VERSION == 0x02010001 ) || ( REGION_VERSION == 0x02010003 )))
RegionCommonSetBandTxDone( &RegionBands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#endif /* REGION_VERSION */
#endif /* REGION_CN470 */
}
Expand Down Expand Up @@ -1321,7 +1321,7 @@ LoRaMacStatus_t RegionCN470NextChannel( NextChanParams_t* nextChanParams, uint8_
identifyChannelsParam.DutyCycleEnabled = nextChanParams->DutyCycleEnabled;
identifyChannelsParam.MaxBands = CN470_MAX_NB_BANDS;

identifyChannelsParam.ElapsedTimeSinceStartUp = nextChanParams->ElapsedTimeSinceStartUp;
identifyChannelsParam.ElapsedTimeSinceTxBackoffRefTime = nextChanParams->ElapsedTimeSinceTxBackoffRefTime;
identifyChannelsParam.LastTxIsJoinRequest = nextChanParams->LastTxIsJoinRequest;
identifyChannelsParam.ExpectedTimeOnAir = GetTimeOnAir( nextChanParams->Datarate, nextChanParams->PktLen );

Expand Down
6 changes: 3 additions & 3 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionCN779.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ void RegionCN779SetBandTxDone( SetBandTxDoneParams_t* txDone )
#if defined( REGION_CN779 )
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x01010003 ))
RegionCommonSetBandTxDone( &RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#elif (defined( REGION_VERSION ) && (( REGION_VERSION == 0x02010001 ) || ( REGION_VERSION == 0x02010003 )))
RegionCommonSetBandTxDone( &RegionBands[RegionNvmGroup2->Channels[txDone->Channel].Band],
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp );
txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceTxBackoffRefTime );
#endif /* REGION_VERSION */
#endif /* REGION_CN779 */
}
Expand Down Expand Up @@ -905,7 +905,7 @@ LoRaMacStatus_t RegionCN779NextChannel( NextChanParams_t* nextChanParams, uint8_
identifyChannelsParam.DutyCycleEnabled = nextChanParams->DutyCycleEnabled;
identifyChannelsParam.MaxBands = CN779_MAX_NB_BANDS;

identifyChannelsParam.ElapsedTimeSinceStartUp = nextChanParams->ElapsedTimeSinceStartUp;
identifyChannelsParam.ElapsedTimeSinceTxBackoffRefTime = nextChanParams->ElapsedTimeSinceTxBackoffRefTime;
identifyChannelsParam.LastTxIsJoinRequest = nextChanParams->LastTxIsJoinRequest;
identifyChannelsParam.ExpectedTimeOnAir = GetTimeOnAir( nextChanParams->Datarate, nextChanParams->PktLen );

Expand Down
18 changes: 9 additions & 9 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
* defined duty-cycle restrictions. In order to ensure that these restrictions never get violated we changed the
* default duty cycle observation time period to 1/2 hour (1800000 ms).
*/
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#define DUTY_CYCLE_TIME_PERIOD 3600000
#else
#define DUTY_CYCLE_TIME_PERIOD 1800000
Expand Down Expand Up @@ -107,7 +107,7 @@ static uint16_t GetDutyCycle( Band_t* band, bool joined, SysTime_t elapsedTimeSi

if( joined == false )
{
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
uint16_t joinDutyCycle = BACKOFF_DC_1_HOUR;
#else
uint16_t joinDutyCycle = BACKOFF_DC_24_HOURS;
Expand Down Expand Up @@ -151,7 +151,7 @@ static uint16_t SetMaxTimeCredits( Band_t* band, bool joined, SysTime_t elapsedT
if( joined == false )
{
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
if( elapsedTimeSinceStartup.Seconds < BACKOFF_DUTY_CYCLE_1_HOUR_IN_S )
if( elapsedTimeSinceStartup.Seconds < BACKOFF_DUTY_CYCLE_1_HOUR_IN_S )
{
maxCredits = DUTY_CYCLE_TIME_PERIOD;
}
Expand All @@ -164,8 +164,8 @@ static uint16_t SetMaxTimeCredits( Band_t* band, bool joined, SysTime_t elapsedT
maxCredits = DUTY_CYCLE_TIME_PERIOD_JOIN_BACKOFF_24H;
}
#else
TimerTime_t elapsedTime = SysTimeToMs( elapsedTimeSinceStartup );
SysTime_t timeDiff = { 0 };
TimerTime_t elapsedTime = SysTimeToMs( elapsedTimeSinceStartup );
SysTime_t timeDiff = { 0 };
if( dutyCycle == BACKOFF_DC_1_HOUR )
{
maxCredits = DUTY_CYCLE_TIME_PERIOD;
Expand Down Expand Up @@ -218,7 +218,7 @@ static uint16_t SetMaxTimeCredits( Band_t* band, bool joined, SysTime_t elapsedT
{
band->TimeCredits = maxCredits;
}
#endif
#endif

// Setup the maximum allowed credits. We can assign them
// safely all the time.
Expand All @@ -228,7 +228,7 @@ static uint16_t SetMaxTimeCredits( Band_t* band, bool joined, SysTime_t elapsedT
}


#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
static uint16_t UpdateTimeCredits( Band_t* band, bool joined, bool dutyCycleEnabled,
bool lastTxIsJoinRequest, SysTime_t elapsedTimeSinceStartup,
TimerTime_t currentTime, TimerTime_t lastBandUpdateTime )
Expand Down Expand Up @@ -456,7 +456,7 @@ TimerTime_t RegionCommonUpdateBandTimeOff( bool joined, Band_t* bands,
// We calculate the minTimeToWait among the bands which are not
// ready for transmission and which are potentially available
// for a transmission in the future.
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
#if (defined( REGION_VERSION ) && ( REGION_VERSION == 0x02010003 ))
TimerTime_t observationTimeDiff = 0;
if( bands[i].LastMaxCreditAssignTime >= elapsedTime )
{
Expand Down Expand Up @@ -727,7 +727,7 @@ LoRaMacStatus_t RegionCommonIdentifyChannels( RegionCommonIdentifyChannelsParam_
identifyChannelsParam->MaxBands,
identifyChannelsParam->DutyCycleEnabled,
identifyChannelsParam->LastTxIsJoinRequest,
identifyChannelsParam->ElapsedTimeSinceStartUp,
identifyChannelsParam->ElapsedTimeSinceTxBackoffRefTime,
identifyChannelsParam->ExpectedTimeOnAir );

RegionCommonCountNbOfEnabledChannels( identifyChannelsParam->CountNbOfEnabledChannelsParam, enabledChannels,
Expand Down
2 changes: 1 addition & 1 deletion src/STM32CubeWL/LoRaWAN/Mac/Region/RegionCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ typedef struct sRegionCommonIdentifyChannelsParam
/*!
* Elapsed time since the start of the node.
*/
SysTime_t ElapsedTimeSinceStartUp;
SysTime_t ElapsedTimeSinceTxBackoffRefTime;
/*!
* Joined Set to true, if the last uplink was a join request
*/
Expand Down
Loading