public class RFIDReaderComm
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RFIDReaderComm.RFIDReaderSubsystem |
Modifier and Type | Field and Description |
---|---|
java.lang.Boolean |
clearedToSend |
int |
ConnectTimeout |
int |
ReceiveTimeout |
Constructor and Description |
---|
RFIDReaderComm(java.lang.String sIpAddress,
int iPort)
Method:
RFIDReadercomm(String sIpAddress, int iPort)
Summary:
Create an instance of the RFIDReaderComm class initialized with the sIpAddress and port
number passed in.
|
Modifier and Type | Method and Description |
---|---|
int |
DoReceive(byte[] responseBuffer,
int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId,
byte altMessageId)
Method
int DoReceive(byte[] responseBuffer, int maxResponseLength, RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte altMessageId)
Summary
Wait for formatted binary protocol data replies to be sent from the sensor.
|
int |
DoSendReceive(byte[] responseBuffer,
int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId,
byte[] messageData,
int dataLength) |
static int |
getInfiniteTimeout() |
int |
SendMessage(byte[] responseBuffer,
int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId)
Method:
int SendMessage(byte[] responseBuffer, int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId)
Summary
This is a 4 parameter overload of the SendMessage method as documented above
where no data needs to be sent to the module (typically a get command)
|
int |
SendMessage(byte[] responseBuffer,
int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId,
byte[] sendBuffer,
int sendBufferLength)
Method:
int SendMessage(byte[] responseBuffer, int maxResponseLength,
RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId)
Summary:
Send a message to the sensor expecting to receive a response.
|
void |
SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId)
Methods
void SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId)
Summary
Send a message to the sensor without expecting a reply.
|
void |
SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType,
byte messageId,
byte[] sendBuffer,
int sendBufferLength)
Methods
void SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte[] messageData, int dataLength)
Summary
Send a message to the sensor without expecting a reply.
|
void |
SetIPv4CommLink(java.lang.String sIPv4Address,
int portNumber)
Method:
void SetIPv4CommLink(String sIPv4Address, int portNumber)
Summary:
This method is used after the class has been created to change the IP address or the port number
that the class will used to set up the TCP socket.
|
void |
Shutdown()
Method:
void Shutdown():
Summary:
Close and dispose of the underlying TCP socket
Exceptions:
A System.TimeoutException will be thrown if the socket disconnect process doesn't
complete within the disconnect timeout period.
|
public java.lang.Boolean clearedToSend
public int ConnectTimeout
public int ReceiveTimeout
public RFIDReaderComm(java.lang.String sIpAddress, int iPort)
sIpAddress
- Input parameter specifying the sIpAddress that will be used to open the
socket for communicating with the sensor.iPort
- Input parameter specifying the TCP port number used when opening the socket
for communicating with the sensor.public int DoReceive(byte[] responseBuffer, int maxResponseLength, RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte altMessageId) throws java.lang.Exception
responseBuffer
- Input parameter containing the data returned from the sensor.maxResponseLength
- integer setting the maximum acceptable response length.moduleType
- Input parameter which specifies the subsystem that will be handing the
command. The ReaderSubsystem usage is described in the Additional Information section of
the class overview.messageId
- Input parameter passing in the id corresponding to the outgoing message that
corresponds to the expected reply.altMessageId
- Optional Input parameter passing in the id corresponding to a second message type
that might occur while receiving data. If this parameter is left out of call, this method will only
return messages corresponding to the primary id set by the MessageId parameter. Other responses will throw
an exception. The primary use of this parameter is described in the Additional Information section.java.lang.Exception
- A System.TimeoutException will be thrown if the connection to the sensor
cannot be established or the module doesn't respond.
public int DoSendReceive(byte[] responseBuffer, int maxResponseLength, RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte[] messageData, int dataLength) throws java.lang.Exception
java.lang.Exception
public static int getInfiniteTimeout()
public int SendMessage(byte[] responseBuffer, int maxResponseLength, RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId) throws java.lang.Exception
responseBuffer
- Output parameter providing a buffer for the response data in
the reply to the message to be returned to the calling code.maxResponseLength
- Input specifying the maximum number of bytes to be returned in
the reply. This should be less than or equal to the number of elements in the
ResponseBuffer arraymoduleType
- Input parameter which specifies the subsystem that will be handing the
command. The ReaderSubsystem usage is described in the Additional Information section of
the class overview.messageId
- Input parameter which specifies the command that is to be sent to the
sensor.java.lang.Exception
- A System.TimeoutException will be thrown if the connection to the sensor
cannot be established or the module doesn't respond.public int SendMessage(byte[] responseBuffer, int maxResponseLength, RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte[] sendBuffer, int sendBufferLength) throws java.lang.Exception
responseBuffer
- Output parameter providing a buffer for the response data in
the reply to the message to be returned to the calling code.maxResponseLength
- Input specifying the maximum number of bytes to be returned in
the reply. This should be less than or equal to the number of elements in the
ResponseBuffer arraymoduleType
- Input parameter which specifies the subsystem that will be handing the
command. The ReaderSubsystem usage is described in the Additional Information section of
the class overview.messageId
- Input parameter which specifies the command that is to be sent to the
sensor.sendBuffer
- Optional Input array comprising the data content of the message to be
sent to the sensor. If there is no data content in the outgoing message, this can be
eliminated from the method call.sendBufferLength
- Optional Input specifying the number of bytes in the outgoing message
data. If there is no data content to the message, this parameter can be eliminated from the call.java.lang.Exception
- A System.TimeoutException will be thrown if the connection to the sensor
cannot be established or the module doesn't respond.
public void SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId) throws java.lang.Exception
moduleType
- Input parameter which specifies the subsystem that will be handing the
command. The ReaderSubsystem usage is described in the Additional Information section of
the class overview.messageId
- Input parameter which specifies the command that is to be sent to the
sensor.java.lang.Exception
- A System.TimeoutException will be thrown if the connection to the sensor
cannot be established or the module doesn't respond.
public void SendMessageNoReply(RFIDReaderComm.RFIDReaderSubsystem moduleType, byte messageId, byte[] sendBuffer, int sendBufferLength) throws java.lang.Exception
moduleType
- Input parameter which specifies the subsystem that will be handing the
command. The ReaderSubsystem usage is described in the Additional Information section of
the class overview.messageId
- Input parameter which specifies the command that is to be sent to the
sensor.sendBuffer
- Optional Input array comprising the data content of the message to be
sent to the sensor. If there is no data content in the outgoing message, this can be
eliminated from the method call.sendBufferLength
- Optional Input specifying the number of bytes in the outgoing message
data. If there is no data content to the message, this parameter can be eliminated from the call.java.lang.Exception
- A System.TimeoutException will be thrown if the connection to the sensor
cannot be established or the module doesn't respond.
public void SetIPv4CommLink(java.lang.String sIPv4Address, int portNumber)
sIPv4Address
- Input parameter specifying the new IP address to assign to this communication channel.
This must be in the standard dotted notation, e.g., 192.168.1.150.portNumber
- Input parameter specifying the new TCP port number to be used when opening up
the socket to communicate with the sensor.
public void Shutdown()