Class CheckParameters
-
- All Implemented Interfaces:
public class CheckParameters
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
MIN_FREQUENCY_HZ
public final static int
MAX_FREQUENCY_HZ
public final static int
DATARATE_AUTO_DRM_MODE
public final static int
MAX_DATARATE
public final static int
MAX_DATARATE_FOR_JAMMING
public final static int
MIN_TX_REPEAT
public final static int
MAX_TX_REPEAT
public final static int
MIN_FRAME_LENGTH
public final static int
MAX_FRAME_LENGTH
public final static int
MIN_CHANNEL_BANDWIDTH
public final static int
MAX_CHANNEL_BANDWIDTH
public final static int
MIN_DEVIATION
public final static int
MAX_DEVIATION
-
Constructor Summary
Constructors Constructor Description CheckParameters()
-
Method Summary
Modifier and Type Method Description 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. static boolean
isNullOrEmpty(String str, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given String is valid (not null and not empty). static boolean
isNullOrEmpty(Array<byte> array, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given array is valid (not null and not empty). static boolean
isNullOrEmpty(Array<boolean> array, String errorMessageTemplate, Array<Object> errorMessageArgs)
Ensures the given array is valid (not null and not empty). static boolean
checkMaskSize(String mask, int sizeIndicatedInBytes)
Verify if size of mask is coherent with the sizeIndicated static boolean
checkFrequency(int frequency)
static boolean
checkDataRateForTx(int dataRate)
static boolean
checkDataRate(int dataRate)
static boolean
checkDataRateForJamming(int dataRate)
static boolean
checkFrameLength(int frameLength)
static boolean
checkModulation(int modulation)
static boolean
checkChannelBandwidth(int chanbw)
static boolean
checkDeviation(int deviation)
static boolean
checkDeviation(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
expression
is 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
str
is 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
str
is 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
str
is 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
-
-
-
-