Class ValueTranslator
java.lang.Object
com.cumulocity.microservice.customdecoders.api.util.ValueTranslator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
translate
(byte[] raw, REGISTER_DATA_TYPE valueType, boolean signed, boolean reverseBitEndianness, BIT_BYTE_WORD_ORDER order, int multiplier, int divisor, int rightShift) Translates the given input byte array based on the provided options
-
Constructor Details
-
ValueTranslator
public ValueTranslator()
-
-
Method Details
-
translate
public static double translate(byte[] raw, REGISTER_DATA_TYPE valueType, boolean signed, boolean reverseBitEndianness, BIT_BYTE_WORD_ORDER order, int multiplier, int divisor, int rightShift) Translates the given input byte array based on the provided options- Parameters:
raw
- the input byte arrayvalueType
- Enum REGISTER_DATA_TYPE with Integer or Floatsigned
- signed or unsigned modereverseBitEndianness
- flag for endian mode (Big/Little Endian)order
- Bits, Bytes, Byte Word or Wordsmultiplier
- multiplierdivisor
- divisorrightShift
- - rightShift- Returns:
- double the translated output
-