ist.palcom.base
Class BluetoothSocket

java.lang.Object
  extended by ist.palcom.base.BluetoothSocket
All Implemented Interfaces:
Channel

public class BluetoothSocket
extends Object
implements 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  LocalDevice localDevice
           
 
Constructor Summary
BluetoothSocket()
           
BluetoothSocket(String BTURL)
           
 
Method Summary
 void close()
           
 boolean dataAvailable()
          After a call to System's select or selectNow with this BluetoothSocket, returns true if data is available, false otherwise.
 String getDeviceAddress()
           
static String getLocalAddress()
           
 String getURL()
           
 boolean isConnected()
           
 boolean receive(BluetoothPacket packet)
           
 void send(BluetoothPacket p)
           
 void startReceiving()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, println, toString
 

Field Detail

localDevice

protected LocalDevice localDevice
Constructor Detail

BluetoothSocket

public BluetoothSocket(String BTURL)

BluetoothSocket

public BluetoothSocket()
Method Detail

send

public void send(BluetoothPacket p)

receive

public boolean receive(BluetoothPacket packet)

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 interface Channel

startReceiving

public void startReceiving()

isConnected

public boolean isConnected()

getURL

public String getURL()

getDeviceAddress

public String getDeviceAddress()

getLocalAddress

public static String getLocalAddress()
Returns:
The local host address (without port).
Throws:
Exception