Skip to content

Commit 0d80d26

Browse files
Daniel Jaecklemluis1
authored andcommitted
Added a default value for Request->ReqReturn.DutyCycleWaitTime to ensure that a valid value is always returned.
1 parent 0c71d15 commit 0d80d26

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mac/LoRaMac.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4542,6 +4542,10 @@ LoRaMacStatus_t LoRaMacMlmeRequest( MlmeReq_t* mlmeRequest )
45424542
{
45434543
return LORAMAC_STATUS_PARAMETER_INVALID;
45444544
}
4545+
// Initialize mlmeRequest->ReqReturn.DutyCycleWaitTime to 0 in order to
4546+
// return a valid value in case the MAC is busy.
4547+
mlmeRequest->ReqReturn.DutyCycleWaitTime = 0;
4548+
45454549
if( LoRaMacIsBusy( ) == true )
45464550
{
45474551
return LORAMAC_STATUS_BUSY;
@@ -4717,6 +4721,10 @@ LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest )
47174721
{
47184722
return LORAMAC_STATUS_PARAMETER_INVALID;
47194723
}
4724+
// Initialize mcpsRequest->ReqReturn.DutyCycleWaitTime to 0 in order to
4725+
// return a valid value in case the MAC is busy.
4726+
mcpsRequest->ReqReturn.DutyCycleWaitTime = 0;
4727+
47204728
if( LoRaMacIsBusy( ) == true )
47214729
{
47224730
return LORAMAC_STATUS_BUSY;

0 commit comments

Comments
 (0)