|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.llrp.ltk.net.LLRPConnection org.llrp.ltk.net.LLRPConnector
public class LLRPConnector
LLRPConnector implements a self-initiated LLRP connection. Here is a simple code example:
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.
Field Summary |
---|
Fields inherited from class org.llrp.ltk.net.LLRPConnection |
---|
CONNECT_TIMEOUT, endpoint, handler, session, SYNC_MESSAGE_ANSWER |
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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 |
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()
reconnect to LLRP device using host, port and handler specified. |
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. |
Methods inherited from class org.llrp.ltk.net.LLRPConnection |
---|
checkLLRPConnectionAttemptStatus, getEndpoint, getHandler, send, setEndpoint, setHandler, transact, transact |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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)
Method Detail |
---|
public void connect() throws LLRPConnectionAttemptFailedException
LLRPConnectionAttemptFailedException
public void connect(long timeout) throws LLRPConnectionAttemptFailedException
timeout
- time in ms
LLRPConnectionAttemptFailedException
public void disconnect()
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 set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |