public class BluetoothPeer
extends java.lang.Object
Constructor and Description |
---|
BluetoothPeer(java.lang.String nodeName,
java.lang.String serviceName,
BtPeerListener listener,
boolean isVerbose)
Creates a BluetoothPeer instance that tries to connect to the given node using
the given service name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isClient()
Returns true, if connected as client.
|
boolean |
isConnected()
Returns the connection status.
|
boolean |
isServer()
Returns true, if connected as server.
|
void |
releaseConnection()
Releases a connection and informs the connected node's listener by calling
notifyConnection(false).
|
void |
sendDataBlock(int[] data)
Send a block of data to the connected node.
|
public BluetoothPeer(java.lang.String nodeName, java.lang.String serviceName, BtPeerListener listener, boolean isVerbose)
nodeName
- the Bluetooth name of the partner node. If null or empty
start immediately as Bluetooth serverserviceName
- the Bluetooth service name used for the communication channellistener
- the BtPeerListener that receives notificationsisVerbose
- if true, debug information is sent using a VerboseWriterpublic void sendDataBlock(int[] data)
data
- the data block to sendpublic boolean isConnected()
public void releaseConnection()
public boolean isClient()
public boolean isServer()