public class BytesInterpreter
extends java.lang.Object
Constructor and Description |
---|
BytesInterpreter() |
Modifier and Type | Method and Description |
---|---|
static float |
bytesToGs(byte[] dataConfig,
byte[] accelOutput)
Convert raw accelerometer data into Gs based on its configuration.
|
static float |
bytesToGs(byte[] dataConfig,
short axisAccel)
Convert raw accelerometer data into Gs based on its configuration.
|
static boolean |
bytesToSwitchState(byte[] switchOutput)
Convert data into the switch state
|
static float |
bytesToTemp(byte[] tempOutput)
This version of the function is for data received from firmware v1.0.0
|
static float |
bytesToTemp(byte[] tempOutput,
boolean thermistorMode)
Convert raw temperature data into Celsius.
|
static Accelerometer.MovementData |
byteToMotionData(byte motionData)
Convert byte representation motion data to MovementData object
|
static Accelerometer.Orientation |
byteToOrientation(byte orientationData)
Convert byte to an Orientation enum entry
|
static Accelerometer.MovementData |
byteToShakeData(byte shakeData)
Convert byte representation of shake data to a MovementData object
|
static Accelerometer.TapData |
byteToTapData(byte tapData)
Convert byte representation of tap data to a TapData object
|
static float |
logBytesToGs(byte[] accelOutput,
byte offset)
Convert raw accelerometer data into Gs.
|
public static float bytesToGs(byte[] dataConfig, short axisAccel)
dataConfig
- Byte array representing the configuration dataaxisAccel
- Acceleration data as passed back in the callback functionpublic static float bytesToGs(byte[] dataConfig, byte[] accelOutput)
dataConfig
- Byte array representing the configuration dataaccelOutput
- Unprocessed acceleration data as received from the Metawear boardpublic static float logBytesToGs(byte[] accelOutput, byte offset)
accelOutput
- Bytes from the log entryoffset
- Index offset to start the conversion from. For 1 axis triggers, this
value should always be 0. For 2 axis triggers (XY or YZ), use 0 for the first axis,
and 2 for the second axis.public static float bytesToTemp(byte[] tempOutput, boolean thermistorMode)
tempOutput
- Byte representation of temperature datathermistorMode
- True if the data was recorded in thermistor modepublic static float bytesToTemp(byte[] tempOutput)
tempOutput
- Byte representation of the temp data from the loggerpublic static boolean bytesToSwitchState(byte[] switchOutput)
switchOutput
- Output data as received from the Metawear boardpublic static Accelerometer.Orientation byteToOrientation(byte orientationData)
orientationData
- Orientation data from the accelerometerpublic static Accelerometer.MovementData byteToMotionData(byte motionData)
motionData
- Free fall or motion data from the accelerometerpublic static Accelerometer.MovementData byteToShakeData(byte shakeData)
shakeData
- Tap data from the accelerometerpublic static Accelerometer.TapData byteToTapData(byte tapData)
tapData
- Tap data from the accelerometer