public class UDPpublisherCommLayer extends UDPcommunicationLayer
Constructor and Description |
---|
UDPpublisherCommLayer() |
Modifier and Type | Method and Description |
---|---|
boolean |
getConnectionState() |
boolean |
openConnection(CommLayerParams params)
Opens the connection and sets up the communication stack.
|
byte |
readByte()
Reads a byte from the communication layer below or the connected device if this layer is the bottom layer.
|
double |
readDouble()
Reads 8 bytes from the communication layer below or the connected device if this layer is the bottom layer.
|
float |
readFloat()
Reads 4 bytes from the communication layer below or the connected device if this layer is the bottom layer.
|
long |
readLong()
Reads 4 bytes from the communication layer below or the connected device if this layer is the bottom layer.
|
void |
recvData()
Performs the necessary actions for receiving data.
|
void |
sendData(byte[] data,
int off,
int len)
Performs the necessary actions for sending data.
|
closeConnection
getAbove, getBelow, getRawBytes, sendData, setAbove, setBelow
public boolean openConnection(CommLayerParams params) throws java.io.IOException
ICommunicationLayer
openConnection
in interface ICommunicationLayer
openConnection
in class AbstractCommunicationLayer
params
- CommLayerParams object holding the connection infojava.io.IOException
public void sendData(byte[] data, int off, int len) throws java.io.IOException
ICommunicationLayer
sendData
in interface ICommunicationLayer
sendData
in class AbstractCommunicationLayer
data
- Byte array containing the datalen
- Length of the data to be sentjava.io.IOException
public void recvData() throws java.io.IOException
ICommunicationLayer
recvData
in interface ICommunicationLayer
recvData
in class AbstractCommunicationLayer
java.io.IOException
public boolean getConnectionState()
getConnectionState
in interface ICommunicationLayer
getConnectionState
in class UDPcommunicationLayer
public byte readByte() throws java.io.IOException
ICommunicationLayer
readByte
in interface ICommunicationLayer
readByte
in class AbstractCommunicationLayer
java.io.IOException
public long readLong() throws java.io.IOException
ICommunicationLayer
readLong
in interface ICommunicationLayer
readLong
in class AbstractCommunicationLayer
java.io.IOException
public double readDouble() throws java.io.IOException
ICommunicationLayer
readDouble
in interface ICommunicationLayer
readDouble
in class AbstractCommunicationLayer
java.io.IOException
public float readFloat() throws java.io.IOException
ICommunicationLayer
readFloat
in interface ICommunicationLayer
readFloat
in class AbstractCommunicationLayer
java.io.IOException