ist.palcom.base.networking
Class BluetoothSocket
java.lang.Object
ist.palcom.base.Channel
ist.palcom.base.networking.BluetoothSocket
public class BluetoothSocket
- extends Channel
This class implements a JVM and Avetana version of core.BluetoothSocket.
Notes: Since the implementation is based on rfcomm, the api only allows one
connection to each host.
|
Field Summary |
protected javax.bluetooth.LocalDevice |
localDevice
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localDevice
protected javax.bluetooth.LocalDevice localDevice
BluetoothSocket
public BluetoothSocket(java.lang.String BTURL)
throws java.io.IOException
- Throws:
java.io.IOException
BluetoothSocket
public BluetoothSocket()
throws javax.bluetooth.BluetoothStateException,
java.io.IOException
- Throws:
javax.bluetooth.BluetoothStateException
java.io.IOException
send
public void send(BluetoothPacket p)
throws java.io.IOException
- Throws:
java.io.IOException
receive
public boolean receive(BluetoothPacket packet)
throws java.io.IOException
- Throws:
java.io.IOException - if no data is available, but only an error
close
public void close()
dataAvailable
public boolean dataAvailable()
- After a call to System's select or selectNow with this BluetoothSocket,
returns true if data is available, false otherwise. If no call to select
or selctNow has been made, result is undefined.
- Specified by:
dataAvailable in class Channel
startReceiving
public void startReceiving()
isConnected
public boolean isConnected()
getURL
public java.lang.String getURL()
getDeviceAddress
public java.lang.String getDeviceAddress()
getLocalAddress
public static java.lang.String getLocalAddress()
- Returns:
- The local host address (without port).
- Throws:
java.lang.Exception