Package org.medcare.igtl.messages
Class OpenIGTMessage
java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
- Direct Known Subclasses:
CapabilityMessage
,DataArrayMessage
,GetCapabilityMessage
,GetImageMessage
,GetPositionMessage
,GetStatusMessage
,GetTransformMessage
,ImageMessage
,NDArrayMessage
,PositionMessage
,StatusMessage
,StringMessage
,TransformMessage
** All messages will have to extend this class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOpenIGTMessage
(String deviceName) ** Constructor to be used to create message to getBytes to send them **OpenIGTMessage
(Header header, byte[] body) ** Constructor to be used to build messages from incoming bytes ** -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
** body.byte[]
getBytes()
** Bytes to be sent.** Unique device name.** header.abstract byte[]
packBody()
** To create body from image_header and image_data SetImageHeader and SetImageData must have called firstvoid
setBody
(byte[] body) void
abstract String
toString()
** To get message String **boolean
Unpack()
** To control the checksum and unpack the bodyabstract boolean
** To create body from body array
-
Field Details
-
deviceName
-
bytesArray
-
VERSION
public static long VERSION
-
-
Constructor Details
-
OpenIGTMessage
** Constructor to be used to create message to getBytes to send them **- Parameters:
deviceName
- Device Name
-
OpenIGTMessage
** Constructor to be used to build messages from incoming bytes **- Parameters:
header
- header of this messagebody
- bytes array containing message body- Throws:
Exception
-
-
Method Details
-
Unpack
** To control the checksum and unpack the body**
- Returns:
- true if unpacking is ok
- Throws:
Exception
-
unpackBody
** To create body from body array**
- Returns:
- true if unpacking is ok
- Throws:
Exception
-
packBody
public abstract byte[] packBody()** To create body from image_header and image_data SetImageHeader and SetImageData must have called first**
- Returns:
- the bytes array containing the message
-
getDeviceName
** Unique device name. **- Returns:
- The name of the device
-
getHeader
** header. **- Returns:
- bytes array containing the header of the message
-
getBody
public byte[] getBody()** body. **- Returns:
- bytes array containing the body of the message
-
getBytes
public byte[] getBytes()** Bytes to be sent. **- Returns:
- bytes array containing the message
-
toString
** To get message String ** -
setBody
public void setBody(byte[] body) -
setHeader
-