Skip to content

Commit a8ab2d2

Browse files
author
Daniel Jaeckle
committed
Issue(#461): change implementation of MaxDCycle
1 parent a2c5e7b commit a8ab2d2

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/mac/LoRaMac.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ static void ProcessMacCommands( uint8_t *payload, uint8_t macIndex, uint8_t comm
18551855
}
18561856
case SRV_MAC_DUTY_CYCLE_REQ:
18571857
{
1858-
MacCtx.NvmCtx->MaxDCycle = payload[macIndex++];
1858+
MacCtx.NvmCtx->MaxDCycle = payload[macIndex++] & 0x0F;
18591859
MacCtx.NvmCtx->AggregatedDCycle = 1 << MacCtx.NvmCtx->MaxDCycle;
18601860
LoRaMacCommandsAddCmd( MOTE_MAC_DUTY_CYCLE_ANS, macCmdPayload, 0 );
18611861
break;
@@ -2096,11 +2096,6 @@ LoRaMacStatus_t Send( LoRaMacHeader_t* macHdr, uint8_t fPort, void* fBuffer, uin
20962096
{
20972097
return LORAMAC_STATUS_NO_NETWORK_JOINED;
20982098
}
2099-
// Check if the device is off
2100-
if( MacCtx.NvmCtx->MaxDCycle == 255 )
2101-
{
2102-
return LORAMAC_STATUS_DEVICE_OFF;
2103-
}
21042099
if( MacCtx.NvmCtx->MaxDCycle == 0 )
21052100
{
21062101
MacCtx.AggregatedTimeOff = 0;

src/mac/LoRaMac.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,10 +2108,6 @@ typedef enum eLoRaMacStatus
21082108
* Service not started - payload length error
21092109
*/
21102110
LORAMAC_STATUS_LENGTH_ERROR,
2111-
/*!
2112-
* Service not started - the device is switched off
2113-
*/
2114-
LORAMAC_STATUS_DEVICE_OFF,
21152111
/*!
21162112
* Service not started - the specified region is not supported
21172113
* or not activated with preprocessor definitions.
@@ -2560,7 +2556,6 @@ LoRaMacStatus_t LoRaMacMibSetRequestConfirm( MibRequestConfirm_t* mibSet );
25602556
* \ref LORAMAC_STATUS_PARAMETER_INVALID,
25612557
* \ref LORAMAC_STATUS_NO_NETWORK_JOINED,
25622558
* \ref LORAMAC_STATUS_LENGTH_ERROR,
2563-
* \ref LORAMAC_STATUS_DEVICE_OFF.
25642559
*/
25652560
LoRaMacStatus_t LoRaMacMlmeRequest( MlmeReq_t* mlmeRequest );
25662561

@@ -2595,7 +2590,6 @@ LoRaMacStatus_t LoRaMacMlmeRequest( MlmeReq_t* mlmeRequest );
25952590
* \ref LORAMAC_STATUS_PARAMETER_INVALID,
25962591
* \ref LORAMAC_STATUS_NO_NETWORK_JOINED,
25972592
* \ref LORAMAC_STATUS_LENGTH_ERROR,
2598-
* \ref LORAMAC_STATUS_DEVICE_OFF.
25992593
*/
26002594
LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest );
26012595

0 commit comments

Comments
 (0)