|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectjBotBrain.comm.UARTCommPort
public class UARTCommPort
UART communication abstraction class.
NOTE: This class is not static, it must be allocated.
CommPort| Field Summary |
|---|
| Fields inherited from interface jBotBrain.comm.CommPort |
|---|
BR_115200, BR_1200, BR_19200, BR_2400, BR_38400, BR_4800, BR_57600, BR_9600, DATABITS_EIGHT, DATABITS_SEVEN, DEVICE_CONNECTED, DEVICE_OFF, DEVICE_ON, DEVICE_WAIT_CONN, PARITY_EVEN, PARITY_MARK, PARITY_NONE, PARITY_ODD, PARITY_SPACE, STOPBIT_1_5, STOPBIT_ONE, STOPBIT_TWO |
| Constructor Summary | |
|---|---|
UARTCommPort(int port)
Constructs UARTCommPort object. |
|
| Method Summary | |
|---|---|
void |
close()
Close communication port |
int |
getStatus()
Returns UART interface status. |
boolean |
open(int baudrate,
int parity,
int databits,
int stopbits)
Open communication port with comm speed baudrate, parity, databits and stopbits. |
int |
read(byte[] buffer,
int offset,
int len)
Reads len bytes to buffer at offset from UART communication interface. |
int |
write(byte[] buffer,
int offset,
int len)
Writes len bytes from buffer starting from offset to UART communication interface. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
| Constructor Detail |
|---|
public UARTCommPort(int port)
port - number of port (currently only 0)| Method Detail |
|---|
public boolean open(int baudrate,
int parity,
int databits,
int stopbits)
open in interface CommPortCommPort.BR_115200,
CommPort.BR_57600,
CommPort.BR_38400,
CommPort.BR_19200,
CommPort.BR_9600,
CommPort.BR_4800,
CommPort.BR_2400,
CommPort.BR_1200,
CommPort.PARITY_NONE,
CommPort.PARITY_ODD,
CommPort.PARITY_EVEN,
CommPort.PARITY_MARK,
CommPort.PARITY_SPACE,
CommPort.DATABITS_EIGHT,
CommPort.DATABITS_SEVEN,
CommPort.STOPBIT_ONE,
CommPort.STOPBIT_1_5,
CommPort.STOPBIT_TWOpublic void close()
close in interface CommPortpublic int getStatus()
getStatus in interface CommPortCommPort.DEVICE_OFF,
CommPort.DEVICE_CONNECTED
public int read(byte[] buffer,
int offset,
int len)
read in interface CommPort
public int write(byte[] buffer,
int offset,
int len)
write in interface CommPort
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||