public interface RMIUARTPort
extends java.rmi.Remote
Modifier and Type | Method and Description |
---|---|
void |
close() |
byte |
getByte()
read a single byte from the device
|
void |
getBytes(byte[] vals,
int offset,
int len)
read a number of bytes from the device
|
java.lang.String |
getModeName(int mode)
Get the string name of the specified mode.
|
int |
getShort()
read a single short from the device.
|
void |
getShorts(short[] vals,
int offset,
int len)
read a number of shorts from the device
|
boolean |
initialiseSensor(int mode)
Initialise the attached sensor and set it to the required operating mode.
Note: This method is not normally needed as the sensor will be initialised when it is opened. |
int |
rawRead(byte[] buffer,
int offset,
int len)
Read bytes from the uart port.
|
int |
rawWrite(byte[] buffer,
int offset,
int len)
Attempt to write a series of bytes to the uart port.
|
void |
resetSensor()
Reset the attached sensor.
|
void |
setBitRate(int bitRate)
Set the bit rate of the port when operating in RAW mode.
|
boolean |
setMode(int mode) |
java.lang.String |
toStringValue()
Return the current sensor reading to a string.
|
int |
write(byte[] buffer,
int offset,
int len)
Write bytes to the sensor
|
byte getByte() throws java.rmi.RemoteException
java.rmi.RemoteException
void getBytes(byte[] vals, int offset, int len) throws java.rmi.RemoteException
vals
- byte array to accept the dataoffset
- offset at which to store the datalen
- number of bytes to readjava.rmi.RemoteException
int getShort() throws java.rmi.RemoteException
java.rmi.RemoteException
void getShorts(short[] vals, int offset, int len) throws java.rmi.RemoteException
vals
- short array to accept the dataoffset
- offset at which to store the datalen
- number of shorts to readjava.rmi.RemoteException
java.lang.String getModeName(int mode) throws java.rmi.RemoteException
TODO: Make other mode data available.
mode
- mode to lookupjava.rmi.RemoteException
java.lang.String toStringValue() throws java.rmi.RemoteException
java.rmi.RemoteException
boolean initialiseSensor(int mode) throws java.rmi.RemoteException
mode
- target modejava.rmi.RemoteException
void resetSensor() throws java.rmi.RemoteException
java.rmi.RemoteException
int write(byte[] buffer, int offset, int len) throws java.rmi.RemoteException
buffer
- bytes to be writtenoffset
- offset to the start of the writelen
- length of the writejava.rmi.RemoteException
int rawRead(byte[] buffer, int offset, int len) throws java.rmi.RemoteException
Note: The port must have been set into RAW mode to use this method.
buffer
- The buffer to store the read bytesoffset
- The offset at which to start storing the byteslen
- The maximum number of bytes to readjava.rmi.RemoteException
int rawWrite(byte[] buffer, int offset, int len) throws java.rmi.RemoteException
Note: The port must have been set into RAW mode before attempting to use the method.
buffer
- The buffer containing the bytes to writeoffset
- The offset of the first bytelen
- The number of bytes to attempt to writejava.rmi.RemoteException
void setBitRate(int bitRate) throws java.rmi.RemoteException
bitRate
- The new bit ratejava.rmi.RemoteException
void close() throws java.rmi.RemoteException
java.rmi.RemoteException
boolean setMode(int mode) throws java.rmi.RemoteException
java.rmi.RemoteException