Skip to content

Commit b96e660

Browse files
committed
Issue #1372 - Added a check to verify that SystemMaxRxError provided value is in the range 0..500 ms
1 parent 7f25f7a commit b96e660

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mac/LoRaMac.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,7 +4844,14 @@ LoRaMacStatus_t LoRaMacMibSetRequestConfirm( MibRequestConfirm_t* mibSet )
48444844
}
48454845
case MIB_SYSTEM_MAX_RX_ERROR:
48464846
{
4847-
Nvm.MacGroup2.MacParams.SystemMaxRxError = Nvm.MacGroup2.MacParamsDefaults.SystemMaxRxError = mibSet->Param.SystemMaxRxError;
4847+
if( mibSet->Param.SystemMaxRxError <= 500 )
4848+
{ // Only apply the new value if in range 0..500 ms else keep current value.
4849+
Nvm.MacGroup2.MacParams.SystemMaxRxError = Nvm.MacGroup2.MacParamsDefaults.SystemMaxRxError = mibSet->Param.SystemMaxRxError;
4850+
}
4851+
else
4852+
{
4853+
status = LORAMAC_STATUS_PARAMETER_INVALID;
4854+
}
48484855
break;
48494856
}
48504857
case MIB_MIN_RX_SYMBOLS:

0 commit comments

Comments
 (0)