|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.bluetooth.BluetoothPeer
public class BluetoothPeer
Class that implements a Bluetooth peer-to-peer communication based on
the client-server model. When started, an existing server is searched
using a specified Bluetooth service. If found, the connection is establish
in a client mode. Otherwise a server mode with the given service name is started.
The Bluetooth names of each remote device have to be added manually
to the known Bluetooth device list using the Lejos command processor.
Data is exchanged as blocks of 1..100 integers.
Constructor Summary | |
---|---|
BluetoothPeer(java.lang.String nodeName,
BtPeerListener listener)
Creates a BluetoothPeer instance that will connect to the given node. |
Method Summary | |
---|---|
boolean |
isConnected()
Returns the connection status. |
void |
releaseConnection()
Releases a connection and inform the connected node's listener by calling notifyConnection(false). |
boolean |
sendDataBlock(int[] data)
Send a block of data to the connected node. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BluetoothPeer(java.lang.String nodeName, BtPeerListener listener)
nodeName
- the partner's Bluetooth name, if null, starts in server modelistener
- the BtPeerListener that gets connnection and data notificationsMethod Detail |
---|
public boolean sendDataBlock(int[] data)
data
- the data block to send (size 1..100)
public boolean isConnected()
public void releaseConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |