public class SecsIWrapper extends java.lang.Object implements WrapperInterface, SecsEventListener
Modifier and Type | Field and Description |
---|---|
static java.lang.Class<?> |
portManagerFactoryClass
The port manager factory class.
|
cvsRev
Constructor and Description |
---|
SecsIWrapper(int port,
int deviceId)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessageHandler(java.lang.Object messageHandler)
Add a message handler object.
|
void |
addMessageHandler(java.io.Serializable messageHandler)
Add a message handler object.
|
boolean |
connect()
Connected the session.
|
void |
destroy() |
void |
disconnect()
Disconnect the connection.
|
boolean |
getAllowDuplicateMessages()
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
int |
getBaudRate()
Returns the current baud rate.
|
static boolean |
getDefaultAllowDuplicateMessages()
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
int |
getDeviceId()
Returns the default device Id.
|
boolean |
getIsHost()
Returns whether this connection is host or equipment.
|
LoggerInterface |
getLogger()
Returns the current logger.
|
java.util.List<java.lang.Object> |
getMessageHandlers()
Return the List of all the message handlers.
|
int |
getPort()
Returns the current TCP/IP port.
|
PortManager |
getPortManager()
Returns the port manager for the wrapper.
|
PortManager |
getPortManager(boolean search)
Returns the port manager for the wrapper.
|
SessionManager |
getRawSessionManager(int deviceId)
Get a session manager for the provided deviceID.
|
int |
getRetryLimit()
Returns the retry limit.
|
SessionManager |
getSessionManager()
This will return the current SessionManager if one exists.
|
SessionManager |
getSessionManager(int deviceId)
Get a session manager for the provided deviceID.
|
double |
getT1()
Returns the T1 timeout value.
|
double |
getT2()
Returns the T2 timeout value.
|
double |
getT3()
Returns the T3 timeout value.
|
double |
getT4()
Returns the T4 timeout value.
|
void |
init() |
boolean |
initializeConnection()
Connect the connection.
|
void |
removeMessageHandler(java.lang.Object messageHandler)
Remove a message handler object.
|
void |
secsEvent(SecsEvent theEvent)
Catches incoming PORT_ERROR events and removes the portManager.
|
void |
setAllowDuplicateMessages(boolean allowDuplicateMessages)
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
void |
setBaudRate(int newValue)
Sets the baudrate for the current connection.
|
void |
setDefault(boolean flag)
Determines whether newly created sessions should be set to the default session.
|
static void |
setDefaultAllowDuplicateMessages(boolean defaultAllowDuplicateMessages)
If this flag is set then duplicate messages will be passed through as
if they were not duplicate.
|
void |
setDeviceId(int deviceId)
Sets the default device ID.
|
void |
setIsHost(boolean newValue)
Controls whether this connection is host or equipment.
|
void |
setLogger(LoggerInterface theLogger)
Sets the logger for the current connection.
|
void |
setPort(int port)
Set the serial port to listen on.
|
void |
setPortManager(PortManager pm)
Sets the port manager for the wrapper.
|
void |
setRetryLimit(int newValue)
Sets the retry limit.
|
void |
setT1(double newValue)
Sets the T1 timeout value.
|
void |
setT2(double newValue)
Sets the T2 timeout value.
|
void |
setT3(double newValue)
Sets the T3 timeout value.
|
void |
setT4(double newValue)
Sets the T4 timeout value.
|
void |
start() |
void |
stop() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setActive
public static java.lang.Class<?> portManagerFactoryClass
public SecsIWrapper(int port, int deviceId)
port
- the SECS1 serial port to use. This is an enumerated constant as
described in the SerialPortManager object.SerialPortManager
public void addMessageHandler(java.lang.Object messageHandler)
addMessageHandler
in interface WrapperInterface
messageHandler
- the message handler to addSecsMsg.processSelf(java.lang.Object)
public void addMessageHandler(java.io.Serializable messageHandler)
addMessageHandler
in interface WrapperInterface
messageHandler
- the message handler to addSecsMsg.processSelf(java.lang.Object)
public boolean connect()
connect
in interface WrapperInterface
public void destroy() throws BadParameterException
BadParameterException
public void disconnect()
disconnect
in interface WrapperInterface
public boolean getAllowDuplicateMessages()
public int getBaudRate()
public static boolean getDefaultAllowDuplicateMessages()
public int getDeviceId()
getDeviceId
in interface WrapperInterface
public boolean getIsHost()
public LoggerInterface getLogger()
getLogger
in interface WrapperInterface
public java.util.List<java.lang.Object> getMessageHandlers()
getMessageHandlers
in interface WrapperInterface
public int getPort()
WrapperInterface
getPort
in interface WrapperInterface
public PortManager getPortManager()
getPortManager
in interface WrapperInterface
public PortManager getPortManager(boolean search)
search
- if true this wrapper will try to find a port manager associated
with this connection. If false, will just return the stored value (quite likely to be null)public SessionManager getRawSessionManager(int deviceId) throws SecsException
deviceId
- the deviceIdSecsException
- if there are any problems.public int getRetryLimit()
public SessionManager getSessionManager()
getSessionManager
in interface WrapperInterface
public SessionManager getSessionManager(int deviceId)
getSessionManager
in interface WrapperInterface
deviceId
- the deviceIdpublic double getT1()
public double getT2()
public double getT3()
getT3
in interface WrapperInterface
public double getT4()
public void init() throws BadParameterException
BadParameterException
public boolean initializeConnection() throws SecsException
initializeConnection
in interface WrapperInterface
SecsException
public void removeMessageHandler(java.lang.Object messageHandler)
removeMessageHandler
in interface WrapperInterface
messageHandler
- the message handler to addSecsMsg.processSelf(java.lang.Object)
public void secsEvent(SecsEvent theEvent)
secsEvent
in interface SecsEventListener
public void setAllowDuplicateMessages(boolean allowDuplicateMessages)
public void setBaudRate(int newValue)
newValue
- the new baud rate.public void setDefault(boolean flag)
setDefault
in interface WrapperInterface
flag
- true if created session should be made the default session.SessionManager.setDefault()
public static void setDefaultAllowDuplicateMessages(boolean defaultAllowDuplicateMessages)
public void setDeviceId(int deviceId)
setDeviceId
in interface WrapperInterface
deviceId
- the default device Id.getDeviceId.
public void setIsHost(boolean newValue)
newValue
- set to true to make this connection the host or slave.public void setLogger(LoggerInterface theLogger)
setLogger
in interface WrapperInterface
theLogger
- the logger to add.public void setPort(int port)
port
- the port number to use for the SECSI connectionSerialPortManager
public void setPortManager(PortManager pm)
setPortManager
in interface WrapperInterface
the
- port manager.public void setRetryLimit(int newValue)
newValue
- the number of times messages should be
retried before being considered a failed message.public void setT1(double newValue)
newValue
- the new T1 valuepublic void setT2(double newValue)
newValue
- the new T2 valuepublic void setT3(double newValue)
setT3
in interface WrapperInterface
newValue
- the new T3 valuepublic void setT4(double newValue)
newValue
- the new T4 valuepublic void start() throws BadParameterException, VIBUpdateFailedException
public void stop() throws BadParameterException
BadParameterException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.