public class SecsIConnectionManager extends ConnectionManager implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static byte |
ACK |
static byte |
ENQ |
static byte |
EOT |
static byte |
NAK |
int |
retryLimit
How many times to attempt a resend when a NAK is received.
|
Modifier and Type | Method and Description |
---|---|
int |
calcChecksum(byte[] msg,
int offset,
int length)
Calculate the checksum of length bytes from the given offset.
|
void |
closeConnection()
Close the connection and stop the input thread.
|
boolean |
getAllowDuplicateMessages()
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
java.lang.String |
getId()
Returns an ID for this connection.
|
boolean |
getIsEquipment()
Returns whether this instance is the equipment or the host.
|
SessionManager |
getNewSessionManager()
Return a new SessionManager object by calling the getNewSessionManager
method of SecsISessionManager.
|
int |
getRetryLimit() |
double |
getT1_IntercharacterTimeout()
Returns the Intercharacter Timeout as defined by the Semi SECSI specification.
|
double |
getT1() |
double |
getT2_ProtocolTimeout()
Returns the Protocol Timeout as defined by the Semi SECSI specification.
|
double |
getT2() |
double |
getT4_InterblockTimeout()
Returns the Interblock Timeout as defined by the Semi SECSI specification.
|
double |
getT4() |
boolean |
requiresPoll()
Returns true if we need to poll for messages.
|
void |
run()
Runs the port manager waiting for input on the socket that we were created for.
|
void |
sendMessage(byte[] msg)
send the message
|
void |
sendMessage(byte[][] msg)
Send a multi-block message.
|
void |
setAllowDuplicateMessages(boolean allowDuplicateMessages)
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
void |
setIsEquipment(boolean flag)
Sets whether this instance is the equipment or the host.
|
void |
setRetryLimit(int newValue) |
void |
setT1_IntercharacterTimeout(double to)
Sets the Intercharacter Timeout as defined by the Semi SECSI specification.
|
void |
setT1(double newValue) |
void |
setT2_ProtocolTimeout(double to)
Sets the Protocol Timeout as defined by the Semi SECSI specification.
|
void |
setT2(double newValue) |
void |
setT4_InterblockTimeout(double to)
Sets the Interblock Timeout as defined by the Semi SECSI specification.
|
void |
setT4(double newValue) |
addSessionManager, addSessionManager, getActiveEntityFlag, getPortManager, getSessionManager, getSessionManagers, setActiveEntityFlag, setPortManager
public static final byte ACK
public static final byte ENQ
public static final byte EOT
public static final byte NAK
public int retryLimit
public int calcChecksum(byte[] msg, int offset, int length)
public void closeConnection() throws SecsException
closeConnection
in class ConnectionManager
SecsException
public boolean getAllowDuplicateMessages()
public java.lang.String getId()
getId
in class ConnectionManager
public boolean getIsEquipment()
public SessionManager getNewSessionManager()
getNewSessionManager
in class ConnectionManager
SessionManager.getNewSessionManager()
public int getRetryLimit()
public double getT1_IntercharacterTimeout()
public double getT1()
public double getT2_ProtocolTimeout()
public double getT2()
public double getT4_InterblockTimeout()
public double getT4()
public boolean requiresPoll()
requiresPoll
in class ConnectionManager
public void run()
run
in interface java.lang.Runnable
public void sendMessage(byte[] msg) throws java.io.IOException, SecsException
sendMessage
in class ConnectionManager
java.io.IOException
SecsException
public void sendMessage(byte[][] msg) throws java.io.IOException, SecsException
sendMessage
in class ConnectionManager
java.io.IOException
SecsException
public void setAllowDuplicateMessages(boolean allowDuplicateMessages)
public void setIsEquipment(boolean flag)
flag
- true if this instance is the equipmentpublic void setRetryLimit(int newValue)
public void setT1_IntercharacterTimeout(double to)
to
- t1_IntercharacterTimeoutpublic void setT1(double newValue)
public void setT2_ProtocolTimeout(double to)
to
- t2_ProtocolTimeoutpublic void setT2(double newValue)
public void setT4_InterblockTimeout(double to)
to
- t4_InterblockTimeoutpublic void setT4(double newValue)
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.