|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openmuc.jsml.tl.SML_TConnection
public class SML_TConnection
Constructor Summary | |
---|---|
SML_TConnection(java.net.Socket socket,
int messageTimeout,
int messageFragmentTimeout)
|
Method Summary | |
---|---|
void |
close()
|
static int |
crc16(byte[] bytes)
calculates crc16 as specified by DIN EN 62056-46 |
static int |
crc16(byte[] bytes,
int length)
calculates crc16 from element 0 to length-1 as specified by DIN EN 62056-46 |
void |
disconnect()
|
SML_File |
receive()
|
void |
send(byte[] smlPackage)
|
void |
sendAttentionResponse(OctetString attentionType,
java.lang.String message,
OctetString serverID,
SML_Message faultyMessage,
java.net.Socket socket)
sends an SML_AttentionRes with sock |
void |
setMessageFragmentTimeout(int messageFragmentTimeout)
Set the TConnection timeout for receiving data once the beginning of a message has been received. |
void |
setMessageTimeout(int messageTimeout)
Set the TConnection timeout for waiting for the first byte of a new message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SML_TConnection(java.net.Socket socket, int messageTimeout, int messageFragmentTimeout) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public static int crc16(byte[] bytes)
bytes
-
public static int crc16(byte[] bytes, int length)
bytes
- length
- bytes in array to take for calculation
public void send(byte[] smlPackage) throws java.io.IOException
java.io.IOException
public void sendAttentionResponse(OctetString attentionType, java.lang.String message, OctetString serverID, SML_Message faultyMessage, java.net.Socket socket)
attentionType
- see SML_AttentionResmessage
- OPTIONAL human readable messageserverID
- id of this machinefaultyMessage
- the SML_Message which caused this attentionResponsesocket
- socket from which the faulty message was received, to answer
on the samepublic SML_File receive() throws java.io.IOException
java.io.IOException
public void disconnect()
public void setMessageTimeout(int messageTimeout) throws java.net.SocketException
messageTimeout
- in milliseconds
java.net.SocketException
public void setMessageFragmentTimeout(int messageFragmentTimeout) throws java.net.SocketException
messageFragmentTimeout
- in milliseconds
java.net.SocketException
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |