|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.llrp.ltk.types.LLRPMessage
public abstract class LLRPMessage
LLRPMessage represents an LLRP message in LTKJava.
The binary encoding Is always: Reserved(3 Bits) | Version (3 Bits) | Message Type (10 Bits) | Message Length (32 Bits) | Parameters call empty constructor to create new message. Use constructor taking LLRPBitList or Byte[] to create message from binary encoded message. Use constructor with JDOM document as a parameter to create message from XML encoding
Field Summary | |
---|---|
protected UnsignedInteger |
messageID
|
protected UnsignedInteger |
messageLength
|
int |
messageReservedLength
|
static int |
MINHEADERLENGTH
|
protected BitList |
reserved
|
static int |
RESERVEDLENGTH
|
static int |
TYPENUMBERLENGTH
|
protected BitList |
version
|
static int |
VERSIONLENGTH
|
Constructor Summary | |
---|---|
LLRPMessage()
|
Method Summary | |
---|---|
void |
decodeBinary(byte[] byteArray)
create message from byte[]. |
protected abstract void |
decodeBinarySpecific(LLRPBitList bits)
to be implemented by specific message. |
abstract void |
decodeXML(org.jdom.Document xml)
create objects from xml. |
byte[] |
encodeBinary()
encode this message to binary formate. |
protected abstract LLRPBitList |
encodeBinarySpecific()
encoding function - has to be implemented by each message. |
abstract org.jdom.Document |
encodeXML()
create xml representation of this parameter. |
UnsignedInteger |
getMessageID()
Message ID to distinguish messages of same type. |
UnsignedInteger |
getMessageLength()
number of bytes of encoded message. |
abstract java.lang.String |
getName()
name of message (same as class name) |
abstract java.lang.String |
getResponseType()
response message type awaited |
abstract SignedShort |
getTypeNum()
type number uniquely identifies message. |
BitList |
getVersion()
version of llrp. |
boolean |
isValidXMLMessage(org.jdom.Document jdomDoc,
java.lang.String schemaPath)
Check xml file against xml schema. |
void |
setMessageID(UnsignedInteger messageID)
setMessageID. |
void |
setVersion(BitList version)
create BitList easiest is to use variadic argument. |
java.lang.String |
toBinaryString()
Return LLRP message as binary string in LLRP binary encoding. |
java.lang.String |
toHexString()
Return LLRP message as hex string in LLRP binary encoding. |
java.lang.String |
toXMLString()
Return LLRP message as string in LTK XML format If there is an error during message encoding, the error message is returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RESERVEDLENGTH
public static final int VERSIONLENGTH
public static final int TYPENUMBERLENGTH
public static final int MINHEADERLENGTH
public final int messageReservedLength
protected BitList reserved
protected BitList version
protected UnsignedInteger messageID
protected UnsignedInteger messageLength
Constructor Detail |
---|
public LLRPMessage()
Method Detail |
---|
public final byte[] encodeBinary() throws InvalidLLRPMessageException
InvalidLLRPMessageException
protected abstract LLRPBitList encodeBinarySpecific() throws InvalidLLRPMessageException
InvalidLLRPMessageException
public final void decodeBinary(byte[] byteArray) throws InvalidLLRPMessageException
byteArray
- representing message
InvalidLLRPMessageException
- if bitstring is not well formatted or has any other errorpublic UnsignedInteger getMessageID()
public UnsignedInteger getMessageLength()
public abstract SignedShort getTypeNum()
public abstract java.lang.String getResponseType()
public abstract java.lang.String getName()
public BitList getVersion()
public void setMessageID(UnsignedInteger messageID)
messageID
- of type UnsignedIntegerpublic void setVersion(BitList version)
version
- as bit arrayprotected abstract void decodeBinarySpecific(LLRPBitList bits) throws InvalidLLRPMessageException
bits
- without header
InvalidLLRPMessageException
public abstract org.jdom.Document encodeXML() throws InvalidLLRPMessageException
InvalidLLRPMessageException
public abstract void decodeXML(org.jdom.Document xml) throws InvalidLLRPMessageException
xml
- document as jdom document
InvalidLLRPMessageException
public boolean isValidXMLMessage(org.jdom.Document jdomDoc, java.lang.String schemaPath) throws InvalidLLRPMessageException
jdomDoc
- to be checkedschemaPath
- path to xml schema file
InvalidLLRPMessageException
public java.lang.String toXMLString() throws InvalidLLRPMessageException
InvalidLLRPMessageException
public java.lang.String toBinaryString() throws InvalidLLRPMessageException
InvalidLLRPMessageException
public java.lang.String toHexString() throws InvalidLLRPMessageException
InvalidLLRPMessageException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |