|
||||||||||
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(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,
String message,
OctetString serverID,
SML_Message faultyMessage,
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(Socket socket, int messageTimeout, int messageFragmentTimeout) throws IOException
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 IOException
IOException
public void sendAttentionResponse(OctetString attentionType, String message, OctetString serverID, SML_Message faultyMessage, 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 IOException
IOException
public void disconnect()
public void setMessageTimeout(int messageTimeout) throws SocketException
messageTimeout
- in milliseconds
SocketException
public void setMessageFragmentTimeout(int messageFragmentTimeout) throws SocketException
messageFragmentTimeout
- in milliseconds
SocketException
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |