Skip to content

Commit

Permalink
Added a default value for Request->ReqReturn.DutyCycleWaitTime to ens…
Browse files Browse the repository at this point in the history
…ure that a valid value is always returned.
  • Loading branch information
Daniel Jaeckle authored and mluis1 committed Apr 1, 2021
1 parent 0c71d15 commit 0d80d26
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4542,6 +4542,10 @@ LoRaMacStatus_t LoRaMacMlmeRequest( MlmeReq_t* mlmeRequest )
{
return LORAMAC_STATUS_PARAMETER_INVALID;
}
// Initialize mlmeRequest->ReqReturn.DutyCycleWaitTime to 0 in order to
// return a valid value in case the MAC is busy.
mlmeRequest->ReqReturn.DutyCycleWaitTime = 0;

if( LoRaMacIsBusy( ) == true )
{
return LORAMAC_STATUS_BUSY;
Expand Down Expand Up @@ -4717,6 +4721,10 @@ LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest )
{
return LORAMAC_STATUS_PARAMETER_INVALID;
}
// Initialize mcpsRequest->ReqReturn.DutyCycleWaitTime to 0 in order to
// return a valid value in case the MAC is busy.
mcpsRequest->ReqReturn.DutyCycleWaitTime = 0;

if( LoRaMacIsBusy( ) == true )
{
return LORAMAC_STATUS_BUSY;
Expand Down

0 comments on commit 0d80d26

Please sign in to comment.