@Deprecated
public interface BleManagerCallbacks
| Modifier and Type | Method and Description |
|---|---|
default void |
onBatteryValueReceived(android.bluetooth.BluetoothDevice device,
int value)
Deprecated.
Use
in the initialize(BluetoothDevice)
instead. |
void |
onBonded(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
BleManager.setBondingObserver(BondingObserver) instead. |
void |
onBondingFailed(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
BleManager.setBondingObserver(BondingObserver) instead. |
void |
onBondingRequired(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
BleManager.setBondingObserver(BondingObserver) instead. |
void |
onDeviceConnected(android.bluetooth.BluetoothDevice device)
Deprecated.
|
void |
onDeviceConnecting(android.bluetooth.BluetoothDevice device)
Deprecated.
|
void |
onDeviceDisconnected(android.bluetooth.BluetoothDevice device)
|
void |
onDeviceDisconnecting(android.bluetooth.BluetoothDevice device)
Deprecated.
|
void |
onDeviceNotSupported(android.bluetooth.BluetoothDevice device)
Deprecated.
ConnectRequest.fail(FailCallback) with reason
FailCallback.REASON_DEVICE_NOT_SUPPORTED will be called instead.
ConnectionObserver.onDeviceDisconnected(BluetoothDevice, int) with
ConnectionObserver.REASON_NOT_SUPPORTED can also be used. |
void |
onDeviceReady(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
ConnectionObserver.onDeviceReady(BluetoothDevice) instead. |
void |
onError(android.bluetooth.BluetoothDevice device,
java.lang.String message,
int errorCode)
Deprecated.
Use per-request
Request.fail(FailCallback) callback instead. |
void |
onLinkLossOccurred(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
ConnectionObserver.onDeviceDisconnected(BluetoothDevice, int) and
await ConnectionObserver.REASON_LINK_LOSS instead. |
void |
onServicesDiscovered(android.bluetooth.BluetoothDevice device,
boolean optionalServicesFound)
Deprecated.
This is information internal to the manager. Should it be exposed, it has to be
implemented in the app layer.
|
default boolean |
shouldEnableBatteryLevelNotifications(android.bluetooth.BluetoothDevice device)
Deprecated.
Use
in the initialize(BluetoothDevice)
instead. |
@Deprecated
void onDeviceConnecting(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceConnecting(BluetoothDevice) instead.onDeviceConnected(BluetoothDevice) will be called when the device is connected,
or onError(BluetoothDevice, String, int) in case of error.device - the device that got connected.@Deprecated
void onDeviceConnected(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceConnected(BluetoothDevice) instead.onServicesDiscovered(BluetoothDevice, boolean) or
onDeviceNotSupported(BluetoothDevice) if required services have not been found.device - the device that got connected.@Deprecated
void onDeviceDisconnecting(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceDisconnecting(BluetoothDevice) instead.device - the device that gets disconnecting.@Deprecated
void onDeviceDisconnected(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceDisconnected(BluetoothDevice, int) or
ConnectionObserver.onDeviceFailedToConnect(BluetoothDevice, int) instead.BluetoothGattCallback.onConnectionStateChange(BluetoothGatt, int, int) with state
DISCONNECTED), but ONLY if the ConnectRequest.shouldAutoConnect() method returned
false for this device when it was connecting.
Otherwise the onLinkLossOccurred(BluetoothDevice) method will be called instead.device - the device that got disconnected.@Deprecated
void onLinkLossOccurred(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceDisconnected(BluetoothDevice, int) and
await ConnectionObserver.REASON_LINK_LOSS instead.ConnectRequest.shouldAutoConnect().
Otherwise a onDeviceDisconnected(BluetoothDevice) method will be called on such
event.device - the device that got disconnected due to a link loss.@Deprecated
void onServicesDiscovered(@NonNull
android.bluetooth.BluetoothDevice device,
boolean optionalServicesFound)
After successful service discovery the service will initialize all services.
The onDeviceReady(BluetoothDevice) method will be called when the initialization
is complete.
device - the device which services got disconnected.optionalServicesFound - if true the secondary services were also found
on the device.@Deprecated
void onDeviceReady(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectionObserver.onDeviceReady(BluetoothDevice) instead.device - the device that get ready.@Deprecated
default boolean shouldEnableBatteryLevelNotifications(@NonNull
android.bluetooth.BluetoothDevice device)
setNotificationCallback(batteryLevelCharacteristic)
.with(new BatteryLevelDataCallback() {
onBatteryLevelChanged(int batteryLevel) {
...
}
});
in the initialize(BluetoothDevice)
instead.This method may return true only if an activity is bound to the service (to display the information to the user), always (e.g. if critical battery level is reported using notifications) or never, if such information is not important or the manager wants to control Battery Level notifications on its own.
device - the target device.@Deprecated
default void onBatteryValueReceived(@NonNull
android.bluetooth.BluetoothDevice device,
int value)
setNotificationCallback(batteryLevelCharacteristic)
.with(new BatteryLevelDataCallback() {
onBatteryLevelChanged(int batteryLevel) {
...
}
});
in the initialize(BluetoothDevice)
instead.device - the device from which the battery value has changed.value - the battery value in percent.@Deprecated
void onBondingRequired(@NonNull
android.bluetooth.BluetoothDevice device)
BleManager.setBondingObserver(BondingObserver) instead.BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION error occurred and the
device bond state is BluetoothDevice.BOND_NONE.device - the device that requires bonding.@Deprecated
void onBonded(@NonNull
android.bluetooth.BluetoothDevice device)
BleManager.setBondingObserver(BondingObserver) instead.device - the device that got bonded.@Deprecated
void onBondingFailed(@NonNull
android.bluetooth.BluetoothDevice device)
BleManager.setBondingObserver(BondingObserver) instead.BluetoothDevice.BOND_BONDING to
BluetoothDevice.BOND_NONE.device - the device that failed to bond.@Deprecated
void onError(@NonNull
android.bluetooth.BluetoothDevice device,
@NonNull
java.lang.String message,
int errorCode)
Request.fail(FailCallback) callback instead.message - the error message.errorCode - the error code.device - the device that caused an error.@Deprecated
void onDeviceNotSupported(@NonNull
android.bluetooth.BluetoothDevice device)
ConnectRequest.fail(FailCallback) with reason
FailCallback.REASON_DEVICE_NOT_SUPPORTED will be called instead.
ConnectionObserver.onDeviceDisconnected(BluetoothDevice, int) with
ConnectionObserver.REASON_NOT_SUPPORTED can also be used.device - the device that failed to connect due to lack of required services.