|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.lddi.knx.utils.KnxEncoder
public class KnxEncoder
Provides bottom-up (knx to uAAL) and top-down (uAAL to knx) translation of commands.
Nested Class Summary | |
---|---|
static class |
KnxEncoder.KnxMessageType
|
Constructor Summary | |
---|---|
KnxEncoder()
|
Method Summary | |
---|---|
static String |
clearHexValue(String hexValue)
This method remove, if present, the "0x" prefix of the hexValue variable. |
static String |
convertDeviceAddressToHex(String address)
Translates readable device addresses to knx hex code. x is 0-15 on 4bits; y is 0-15 on 4bits; z is 0-255 on 8bits; |
static String |
convertGroupAddressToHex(String address)
Converts a readable knx group address to hex encoded string. x is 0-15 on 5 bits; y is 0-7 on 3 bits; z is 0-255 on 8 bits; |
static String |
convertGroupAddressToReadable(byte[] buffer)
Convert knx group address from knx encoded bytes to readable x/y/z format. |
static byte[] |
convertToByteArray(String hexString)
Converts a hex-encoded knx message to byte array. |
static String |
convertToHex(byte[] b)
Convert byte array to hex encoded string without delimiters. |
static String |
convertToReadableHex(byte[] b)
Convert byte array to readable hex-encoded string. |
static KnxTelegram |
decode(byte[] knxMessage)
Decode knx byte array and create KnxTelegram object. |
static byte[] |
encode(boolean repeatBit,
byte[] sourceByte,
String targetAddress,
byte[] dataByte,
KnxCommand commandType,
boolean multicast)
Encode a knx telegram for sending to a knx bus. |
static byte[] |
removeTrailingZeros(byte[] original)
Remove trailing Zero bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KnxEncoder()
Method Detail |
---|
public static byte[] encode(boolean repeatBit, byte[] sourceByte, String targetAddress, byte[] dataByte, KnxCommand commandType, boolean multicast)
repeatBit
- has this telegram been sent already?sourceByte
- sending KNX addresstargetAddress
- knx address - could be device or group addressdataByte
- knx commandmessageType
- (read, write, scenario)
public static KnxTelegram decode(byte[] knxMessage)
knx
- telegram
public static byte[] removeTrailingZeros(byte[] original)
original
-
public static String convertDeviceAddressToHex(String address)
address
- of the device as x.y.z
public static String convertGroupAddressToHex(String address)
readable
- string "x/y/z" group address
public static byte[] convertToByteArray(String hexString)
a
- hex-encoded message string
public static String convertToReadableHex(byte[] b)
-
public static String convertToHex(byte[] b)
public static String convertGroupAddressToReadable(byte[] buffer)
buffer
- group device address in bytes
public static String clearHexValue(String hexValue)
hexValue
- string containing an hex value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |