public class LLRPConnector extends LLRPConnection
LLRPConnector c = new LLRPConnector(endpoint,ip);
c.connect();
// send message asynchronously - response needs to handled via
// the message received method of the endpoint
c.send(llrpmessage);
// send message synchronously
LLRPMessage m = c.transact(llrpmessage);
The connect method checks the status of the ConnectionAttemptStatus field in in the READER_EVENT_NOTIFICATION message. If the status field is not 'Success", an LLRPConnectionAttemptFailedException is thrown.
CONNECT_TIMEOUT, endpoint, handler, session, SYNC_MESSAGE_ANSWER
Constructor and Description |
---|
LLRPConnector() |
LLRPConnector(LLRPEndpoint endpoint,
java.lang.String host)
LLRPConnector using parameters provided and LLRPIoAdapterHandlerImpl as default IoHandler
and default port 5084
|
LLRPConnector(LLRPEndpoint endpoint,
java.lang.String host,
int port)
LLRPConnector using parameters provided and LLRPIoAdapterHandlerImpl as default IoHandler
|
LLRPConnector(LLRPEndpoint endpoint,
java.lang.String host,
int port,
LLRPIoHandlerAdapter handler)
LLRPConnector using parameters provided
|
LLRPConnector(LLRPEndpoint endpoint,
java.lang.String host,
LLRPIoHandlerAdapter handler)
LLRPConnector using parameters provided and default port 5084
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
connects to a LLRP device at the host address and port specified.
|
void |
connect(long timeout)
connects to a LLRP device at the host address and port specified.
|
void |
connect(long timeout,
boolean useTLS)
Connects to a LLRP device at the host address and port specified.
|
void |
disconnect()
disconnect existing connection to LLRP device.
|
java.lang.String |
getHost()
get host address of reader device.
|
int |
getPort()
get port on which to connect to reader device.
|
boolean |
reconnect()
Deprecated.
This functionality is equivalent to calling connect().
|
void |
setHost(java.lang.String host)
set host address of reader device.
|
void |
setPort(int port)
set port on which to connect to reader device.
|
checkLLRPConnectionAttemptStatus, getEndpoint, getHandler, send, setEndpoint, setHandler, transact, transact
public LLRPConnector()
public LLRPConnector(LLRPEndpoint endpoint, java.lang.String host, int port)
public LLRPConnector(LLRPEndpoint endpoint, java.lang.String host)
public LLRPConnector(LLRPEndpoint endpoint, java.lang.String host, LLRPIoHandlerAdapter handler)
public LLRPConnector(LLRPEndpoint endpoint, java.lang.String host, int port, LLRPIoHandlerAdapter handler)
public void connect() throws LLRPConnectionAttemptFailedException
public void connect(long timeout) throws LLRPConnectionAttemptFailedException
timeout
- time in msLLRPConnectionAttemptFailedException
public void connect(long timeout, boolean useTLS) throws LLRPConnectionAttemptFailedException
timeout
- time in msuseTLS
- use TLS encryption if "true"LLRPConnectionAttemptFailedException
public void disconnect()
@Deprecated public boolean reconnect()
reconnect
in class LLRPConnection
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- the host to setpublic int getPort()
public void setPort(int port)
port
- the port to setCopyright © 2007 ETH Zurich.