Class CheckParameters
-
- All Implemented Interfaces:
public class CheckParameters
-
-
Field Summary
Fields Modifier and Type Field Description public final static intMIN_FREQUENCY_HZpublic final static intMAX_FREQUENCY_HZpublic final static intDATARATE_AUTO_DRM_MODEpublic final static intMAX_DATARATEpublic final static intMAX_DATARATE_FOR_JAMMINGpublic final static intMIN_TX_REPEATpublic final static intMAX_TX_REPEATpublic final static intMIN_FRAME_LENGTHpublic final static intMAX_FRAME_LENGTHpublic final static intMIN_CHANNEL_BANDWIDTHpublic final static intMAX_CHANNEL_BANDWIDTHpublic final static intMIN_DEVIATIONpublic final static intMAX_DEVIATION
-
Constructor Summary
Constructors Constructor Description CheckParameters()
-
Method Summary
Modifier and Type Method Description static booleancheckArgument(boolean expression, String errorMessageTemplate, Array<Object> errorMessageArgs)Ensures the truth of an expression involving one or more parameters to the calling method. static booleanisNullOrEmpty(String str, String errorMessageTemplate, Array<Object> errorMessageArgs)Ensures the given String is valid (not null and not empty). static booleanisNullOrEmpty(Array<byte> array, String errorMessageTemplate, Array<Object> errorMessageArgs)Ensures the given array is valid (not null and not empty). static booleanisNullOrEmpty(Array<boolean> array, String errorMessageTemplate, Array<Object> errorMessageArgs)Ensures the given array is valid (not null and not empty). static booleancheckMaskSize(String mask, int sizeIndicatedInBytes)Verify if size of mask is coherent with the sizeIndicated static booleancheckFrequency(int frequency)static booleancheckDataRateForTx(int dataRate)static booleancheckDataRate(int dataRate)static booleancheckDataRateForJamming(int dataRate)static booleancheckFrameLength(int frameLength)static booleancheckModulation(int modulation)static booleancheckChannelBandwidth(int chanbw)static booleancheckDeviation(int deviation)static booleancheckDeviation(int deviation, int modulation)Check deviation only if modulation is 2FSK/4FSK/GFSK -
-
Method Detail
-
checkArgument
static boolean checkArgument(boolean expression, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the truth of an expression involving one or more parameters to the calling method.
- Parameters:
expression- a boolean expressionerrorMessageTemplate- a template for the exception message should the check fail.errorMessageArgs- the arguments to be substituted into the message template.- Returns:
false if
expressionis false, true if correct. Only in RELEASE build.
-
isNullOrEmpty
static boolean isNullOrEmpty(String str, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given String is valid (not null and not empty).
- Parameters:
str- a String to checkerrorMessageTemplate- a template for the exception message should the check fail.errorMessageArgs- the arguments to be substituted into the message template.- Returns:
true if
stris null or empty, false if valid. Only in RELEASE build.
-
isNullOrEmpty
static boolean isNullOrEmpty(Array<byte> array, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given array is valid (not null and not empty).
- Parameters:
array- an array to checkerrorMessageTemplate- a template for the exception message should the check fail.errorMessageArgs- the arguments to be substituted into the message template.- Returns:
true if
stris null or empty, false if valid. Only in RELEASE build.
-
isNullOrEmpty
static boolean isNullOrEmpty(Array<boolean> array, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given array is valid (not null and not empty).
- Parameters:
array- an array to checkerrorMessageTemplate- a template for the exception message should the check fail.errorMessageArgs- the arguments to be substituted into the message template.- Returns:
true if
stris null or empty, false if valid. Only in RELEASE build.
-
checkMaskSize
static boolean checkMaskSize(String mask, int sizeIndicatedInBytes)
Verify if size of mask is coherent with the sizeIndicated
- Returns:
true if OK, false if inconsistent
-
checkFrequency
static boolean checkFrequency(int frequency)
-
checkDataRateForTx
static boolean checkDataRateForTx(int dataRate)
-
checkDataRate
static boolean checkDataRate(int dataRate)
-
checkDataRateForJamming
static boolean checkDataRateForJamming(int dataRate)
-
checkFrameLength
static boolean checkFrameLength(int frameLength)
-
checkModulation
static boolean checkModulation(int modulation)
-
checkChannelBandwidth
static boolean checkChannelBandwidth(int chanbw)
-
checkDeviation
static boolean checkDeviation(int deviation)
-
checkDeviation
static boolean checkDeviation(int deviation, int modulation)
Check deviation only if modulation is 2FSK/4FSK/GFSK
-
-
-
-