|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.meiglobal.ebds.api.WrappedSerialPort
com.meiglobal.ebds.api.EBDS_SerialPort
public class EBDS_SerialPort
Specialized class to handle EBDS communications down a serial port. Uses the custom WrappedSerialPort class to communicate with the device.
Field Summary | |
---|---|
static byte |
ETX
|
static byte |
STX
|
Fields inherited from class com.meiglobal.ebds.api.WrappedSerialPort |
---|
_buffer, _iRead, _iWrite, _strPortName |
Constructor Summary | |
---|---|
EBDS_SerialPort(Acceptor acceptor)
Constructor. |
Method Summary | |
---|---|
protected byte |
calcCRC(byte[] b)
Calculates the CRC of a byte array. |
boolean |
getReplyAcked(byte[] reply)
Informs if a received reply has been acknowledged. |
byte[] |
receive()
Receives information from the device. |
void |
resetPort()
Attempts to reset the port by closing and re-opening. |
void |
sendData(byte[] data)
Sends data to the device. |
Methods inherited from class com.meiglobal.ebds.api.WrappedSerialPort |
---|
close, flushInputStream, isOpen, listPorts, openPort, send, serialEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte STX
public static final byte ETX
Constructor Detail |
---|
public EBDS_SerialPort(Acceptor acceptor)
acceptor
- The Acceptor object that will use this serial port.Method Detail |
---|
public void resetPort()
public void sendData(byte[] data) throws AcceptorException, java.io.IOException
data
- The data to be sent.
AcceptorException
- If message payload is null
java.io.IOException
- If there is a problem with the serial portpublic byte[] receive() throws AcceptorException, SerialReadTimeout
AcceptorException
- If an error occurs.
SerialReadTimeout
- If a reply is not received in a timely manner.public boolean getReplyAcked(byte[] reply)
reply
- The byte array reply to check.
protected byte calcCRC(byte[] b)
b
- The byte array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |