public class BluetoothAdapter extends Object implements FeatureStateListener
| Modifier and Type | Method and Description |
|---|---|
BluetoothService |
addService(BluetoothServiceDefinition definition) |
boolean |
connect(BluetoothAddress address) |
void |
disable() |
boolean |
enable() |
static BluetoothAdapter |
getAdapter() |
void |
handleAdvertisementCompleted()
Not in API.
|
void |
handleConnected(short connHandle,
BluetoothAddress deviceAddress)
Not in API.
|
void |
handleConnectFailed(BluetoothAddress deviceAddress)
Not in API.
|
void |
handleDisconnected(short connHandle)
Not in API.
|
void |
handleDiscoveryCompleted(short connHandle)
Not in API.
|
void |
handleDiscoveryResult(short connHandle,
BluetoothService service)
Not in API.
|
void |
handleExecuteWriteRequest(short connHandle,
short attributeHandle,
boolean execute)
Not in API.
|
void |
handleNotificationReceived(short connHandle,
short attributeHandle,
byte[] value)
Not in API.
|
void |
handleNotificationSent(short connHandle,
short attributeHandle,
boolean success)
Not in API.
|
void |
handlePairCompleted(short connHandle,
boolean success)
Not in API.
|
void |
handlePairRequest(short connHandle)
Not in API.
|
void |
handlePasskeyGenerated(short connHandle,
int passkey)
Not in API.
|
void |
handlePasskeyRequest(short connHandle)
Not in API.
|
void |
handleReadCompleted(short connHandle,
short attributeHandle,
byte status,
byte[] value)
Not in API.
|
void |
handleReadRequest(short connHandle,
short attributeHandle,
int offset)
Not in API.
|
void |
handleScanCompleted()
Not in API.
|
void |
handleScanResult(BluetoothAddress deviceAddress,
byte[] advertisementData,
int rssi)
Not in API.
|
void |
handleWriteCompleted(short connHandle,
short attributeHandle,
byte status)
Not in API.
|
void |
handleWriteRequest(short connHandle,
short attributeHandle,
byte[] value,
short offset,
boolean prepare)
Not in API.
|
void |
setConnectionListener(ConnectionListener connectionListener) |
boolean |
startAdvertising(byte[] advertisementData) |
boolean |
startScanning(BluetoothScanFilter scanFilter) |
void |
stateChanged(Feature feature,
Feature.State previousState)
Called when the state of a Feature has changed.
|
boolean |
stopAdvertising() |
boolean |
stopScanning() |
@Nullable public BluetoothService addService(BluetoothServiceDefinition definition)
public boolean connect(BluetoothAddress address)
public void disable()
public boolean enable()
public static BluetoothAdapter getAdapter()
public void handleAdvertisementCompleted()
public void handleConnected(short connHandle,
BluetoothAddress deviceAddress)
public void handleConnectFailed(BluetoothAddress deviceAddress)
public void handleDisconnected(short connHandle)
public void handleDiscoveryCompleted(short connHandle)
public void handleDiscoveryResult(short connHandle,
BluetoothService service)
public void handleExecuteWriteRequest(short connHandle,
short attributeHandle,
boolean execute)
public void handleNotificationReceived(short connHandle,
short attributeHandle,
byte[] value)
public void handleNotificationSent(short connHandle,
short attributeHandle,
boolean success)
public void handlePairCompleted(short connHandle,
boolean success)
public void handlePairRequest(short connHandle)
public void handlePasskeyGenerated(short connHandle,
int passkey)
public void handlePasskeyRequest(short connHandle)
public void handleReadCompleted(short connHandle,
short attributeHandle,
byte status,
byte[] value)
public void handleReadRequest(short connHandle,
short attributeHandle,
int offset)
public void handleScanCompleted()
public void handleScanResult(BluetoothAddress deviceAddress, byte[] advertisementData, int rssi)
public void handleWriteCompleted(short connHandle,
short attributeHandle,
byte status)
public void handleWriteRequest(short connHandle,
short attributeHandle,
byte[] value,
short offset,
boolean prepare)
public void setConnectionListener(ConnectionListener connectionListener)
public boolean startAdvertising(byte[] advertisementData)
public boolean startScanning(BluetoothScanFilter scanFilter)
public void stateChanged(@Nullable Feature feature, @Nullable Feature.State previousState)
FeatureStateListenerstateChanged in interface FeatureStateListenerfeature - the Feature which state has changedpreviousState - the previous state, null if Feature state is Feature.State.INSTALLEDpublic boolean stopAdvertising()
public boolean stopScanning()