public class UartbusTools extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UartbusTools.PacketFormattingMode |
Modifier and Type | Field and Description |
---|---|
protected static eu.javaexperience.log.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static int |
calcPackReqBytes(boolean signed,
BigInteger value) |
static int |
calcPackReqBytes(boolean signed,
byte[] value) |
static byte |
crc8(byte[] data) |
static byte |
crc8(byte[] data,
int length) |
static String |
formatColonData(byte[] e) |
static String |
formatColonDataWithValidation(byte[] e) |
static String |
formatPacketWithMode(UartbusTools.PacketFormattingMode mode,
byte[] data) |
static byte[] |
getValidPacket(byte[] e) |
static void |
initConnection(UartbusConnection conn) |
static boolean |
isPacketCrc8Valid(byte[] data) |
static byte[] |
packInt(boolean signed,
int value) |
static int |
packValue(boolean signed,
BigInteger value,
byte[] dst,
int startIndex) |
static int |
packValue(Boolean negative,
byte[] value,
byte[] dst,
int startIndex)
packed byte scheme:
XN------|X-------|X-------
first byte:
X extended address (0 = no, 1 = yes)
N negated value (0 = no, 1 = yes)
n'th byte:
X value continued in the next byte + 7 bit number value
negative:
null: unsigned value
false: signed positive
true: signed negative
|
static int |
packValue(boolean signed,
int value,
byte[] dst,
int startIndex) |
static int |
packValue(boolean signed,
long value,
byte[] dst,
int startIndex) |
static byte[] |
parseColonData(String data) |
static void |
printPacketStdout(byte[] data) |
static BigInteger |
unpackValue(boolean signed,
byte[] data,
int startIndex) |
static BigInteger |
unpackValue(boolean signed,
byte[] data,
int startIndex,
int[] usedBytes) |
public static byte crc8(byte[] data)
public static byte crc8(byte[] data, int length)
public static byte[] parseColonData(String data)
public static String formatColonData(byte[] e)
public static String formatColonDataWithValidation(byte[] e)
public static String formatPacketWithMode(UartbusTools.PacketFormattingMode mode, byte[] data)
public static int packValue(boolean signed, int value, byte[] dst, int startIndex)
public static int packValue(boolean signed, long value, byte[] dst, int startIndex)
public static int packValue(boolean signed, BigInteger value, byte[] dst, int startIndex)
public static int calcPackReqBytes(boolean signed, BigInteger value)
public static int calcPackReqBytes(boolean signed, byte[] value)
public static int packValue(Boolean negative, byte[] value, byte[] dst, int startIndex)
public static byte[] packInt(boolean signed, int value)
public static BigInteger unpackValue(boolean signed, byte[] data, int startIndex)
public static BigInteger unpackValue(boolean signed, byte[] data, int startIndex, int[] usedBytes)
public static byte[] getValidPacket(byte[] e)
public static boolean isPacketCrc8Valid(byte[] data)
public static void printPacketStdout(byte[] data)
public static void initConnection(UartbusConnection conn)
Copyright © 2020. All rights reserved.