public abstract class BluetoothConnection
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BluetoothConnection.Callback |
Modifier and Type | Field and Description |
---|---|
static java.util.UUID |
MY_UUID_INSECURE |
Modifier and Type | Method and Description |
---|---|
android.bluetooth.BluetoothDevice |
getDevice()
Gets the bluetooth device associated with the bluetooth connection.
|
protected abstract boolean |
isConnected() |
boolean |
isRunning()
Check to see if the connection is running.
|
protected abstract void |
onStart(android.bluetooth.BluetoothDevice device,
java.util.UUID uuid) |
protected abstract void |
onStop() |
protected abstract byte[] |
read() |
void |
setCallback(BluetoothConnection.Callback callback)
The implementation of the callback to occur when the connection has data available.
|
void |
setRunning(boolean r)
Change the state of the connection, running or stopped.
|
void |
start() |
void |
stop()
Stops the current bluetooth connection threads.
|
protected abstract byte[] read() throws java.io.IOException
java.io.IOException
protected abstract void onStart(android.bluetooth.BluetoothDevice device, java.util.UUID uuid) throws java.io.IOException
java.io.IOException
protected abstract void onStop() throws java.io.IOException
java.io.IOException
protected abstract boolean isConnected()
public void start()
public void stop()
public void setCallback(BluetoothConnection.Callback callback)
callback
- the callback to handle datapublic boolean isRunning()
public void setRunning(boolean r)
r
- the running state, true if running.public android.bluetooth.BluetoothDevice getDevice()