-
public interface ConnectionObserverAdditional callback for device disconnect with more information about state.
-
-
Method Summary
Modifier and Type Method Description abstract voidonDeviceConnecting(@NonNull() BluetoothDevice device)Called when the Android device started connecting to given device. abstract voidonDeviceConnected(@NonNull() BluetoothDevice device)Called when the device has been connected. abstract voidonDeviceFailedToConnect(@NonNull() BluetoothDevice device, int reason)Called when the device failed to connect. abstract voidonDeviceReady(@NonNull() BluetoothDevice device)Method called when all initialization requests has been completed. abstract voidonDeviceDisconnecting(@NonNull() BluetoothDevice device)Called when user initialized disconnection. abstract voidonDeviceDisconnected(@NonNull() BluetoothDevice device, int reason)Called when the device has disconnected (when the callback returned onConnectionStateChange with stateDISCONNECTED). -
-
Method Detail
-
onDeviceConnecting
abstract void onDeviceConnecting(@NonNull() BluetoothDevice device)
Called when the Android device started connecting to given device.The onDeviceConnected will be called when the device is connected,or onDeviceFailedToConnect if connection will fail.
- Parameters:
device- the device that got connected.
-
onDeviceConnected
abstract void onDeviceConnected(@NonNull() BluetoothDevice device)
Called when the device has been connected. This does not mean that the application may startcommunication. Service discovery will be handled automatically after this call.
- Parameters:
device- the device that got connected.
-
onDeviceFailedToConnect
abstract void onDeviceFailedToConnect(@NonNull() BluetoothDevice device, int reason)
Called when the device failed to connect.
- Parameters:
device- the device that failed to connect.reason- the reason of failure.
-
onDeviceReady
abstract void onDeviceReady(@NonNull() BluetoothDevice device)
Method called when all initialization requests has been completed.
- Parameters:
device- the device that get ready.
-
onDeviceDisconnecting
abstract void onDeviceDisconnecting(@NonNull() BluetoothDevice device)
Called when user initialized disconnection.
- Parameters:
device- the device that gets disconnecting.
-
onDeviceDisconnected
abstract void onDeviceDisconnected(@NonNull() BluetoothDevice device, int reason)
Called when the device has disconnected (when the callback returned onConnectionStateChange with stateDISCONNECTED).
- Parameters:
device- the device that got disconnected.reason- reason of the disconnect (mapped from the status code reported by the GATTcallback to the library specific status codes).
-
-
-
-