|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.sensors.BluetoothRFCOMMChannel
public class BluetoothRFCOMMChannel
This is a very simple class that uses the JSR82 API to open an RFCOMM channel to a Bluetooth device.
| Constructor Summary | |
|---|---|
BluetoothRFCOMMChannel(java.lang.String remoteDeviceAddress,
int remoteChannelNumber)
Construct a Bluetooth RFCOMM channel object with a specific remote endpoint. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the channel to the endpoint given to the constructor. |
java.io.InputStream |
getInputStream()
Returns the InputStream object for reading from the remote Bluetooth device. |
java.io.OutputStream |
getOutputStream()
Returns the OutputStream object for writing to the remote Bluetooth device. |
static void |
main(java.lang.String[] args)
Switches the state of the local device between Master and Slave |
void |
open()
Opens a channel to the endpoint given to the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BluetoothRFCOMMChannel(java.lang.String remoteDeviceAddress,
int remoteChannelNumber)
throws java.io.IOException
remoteDeviceAddress - The Bluetooth MAC address to connect to, in format
"AABBCCDDEEFF".remoteChannelNumber - The SDP RFCOMM channel number to connect to, usually between
1 and 10.
java.io.IOException - When the local Bluetooth stack was not initialized properly.| Method Detail |
|---|
public void open()
throws java.io.IOException
java.io.IOException - On Bluetooth errors.
java.io.IOException - When the channel has already been opened.
public void close()
throws java.io.IOException
java.io.IOException - On Bluetooth errors.
java.io.IOException - When the channel has not yet been opened.
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException - When the channel has not yet been opened.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException - When the channel has not yet been opened.
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.lang.NumberFormatException
java.io.IOException
java.lang.NumberFormatException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||