|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thingmagic.BluetoothTransportAndroid
public class BluetoothTransportAndroid
Constructor Summary | |
---|---|
BluetoothTransportAndroid(java.lang.String deviceName)
Creates a new instance of SerialPort through bluetooth |
Method Summary | |
---|---|
SerialReader |
createSerialReader(java.lang.String uri)
|
void |
flush()
Take any actions necessary (possibly none) to remove unsent data from the output path. |
int |
getBaudRate()
Get the current baud rate of the communication channel. |
void |
open()
Causes the communication interface to be opened but does not transmit any serial-layer data. |
byte[] |
receiveBytes(int length,
byte[] messageSpace,
int offset,
int timeoutMs)
Receive a number of bytes on the serial transport. |
void |
sendBytes(int length,
byte[] message,
int offset,
int timeoutMs)
Send bytes down the serial transport layer. |
void |
setBaudRate(int rate)
Set the current baud rate of the communication channel. |
void |
shutdown()
Disconnects from the connected Bluetooth device. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BluetoothTransportAndroid(java.lang.String deviceName)
Method Detail |
---|
public void open() throws ReaderException
SerialTransport
open
in interface SerialTransport
ReaderException
public void shutdown()
shutdown
in interface SerialTransport
public void flush()
SerialTransport
flush
in interface SerialTransport
public void setBaudRate(int rate)
SerialTransport
setBaudRate
in interface SerialTransport
rate
- the baud rate to setpublic int getBaudRate()
SerialTransport
getBaudRate
in interface SerialTransport
public void sendBytes(int length, byte[] message, int offset, int timeoutMs) throws ReaderException
SerialTransport
sendBytes
in interface SerialTransport
length
- number of bytes to sendmessage
- array containing the bytes to be sentoffset
- position in array to send fromtimeoutMs
- The duration to wait for the operation to complete.
ReaderException
public byte[] receiveBytes(int length, byte[] messageSpace, int offset, int timeoutMs) throws ReaderException
SerialTransport
receiveBytes
in interface SerialTransport
length
- number of bytes to receivemessageSpace
- byte array to store the message in, or null to have one allocatedoffset
- location in messageSpace to store bytestimeoutMs
- maximum duration to wait for a message
ReaderException
public SerialReader createSerialReader(java.lang.String uri) throws ReaderException
ReaderException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |