Package 

Interface ConnectionObserver


  • 
    public interface ConnectionObserver
    
                        

    Additional callback for device disconnect with more information about state.

    • Method Detail

      • 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.
      • 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).