Package 

Interface BleManagerCallbacks


  • @Deprecated() 
    public interface BleManagerCallbacks
    
                        

    The BleManagerCallbacks should be overridden in your app and all the 'high level' callbacks should be added there.

    • Method Detail

      • onDeviceConnected

        @Deprecated() abstract void onDeviceConnected(@NonNull() BluetoothDevice device)

        Called when the device has been connected. This does not mean that the application may startcommunication.A service discovery will be handled automatically after this call. Service discoverymay ends up with calling onServicesDiscovered or onDeviceNotSupported if required services have not been found.

        Parameters:
        device - the device that got connected.
      • onLinkLossOccurred

        @Deprecated() abstract void onLinkLossOccurred(@NonNull() BluetoothDevice device)

        This callback is invoked when the Ble Manager lost connection to a device that has beenconnected with autoConnect option (see shouldAutoConnect.Otherwise a onDeviceDisconnected method will be called on suchevent.

        Parameters:
        device - the device that got disconnected due to a link loss.
      • onServicesDiscovered

        @Deprecated() abstract void onServicesDiscovered(@NonNull() BluetoothDevice device, boolean optionalServicesFound)

        Called when service discovery has finished and primary services has been found.This method is not called if the primary, mandatory services were not found during servicediscovery. For example in the Blood Pressure Monitor, a Blood Pressure service is aprimary service and Intermediate Cuff Pressure service is a optional secondary service.Existence of battery service is not notified by this call.

        After successful service discovery the service will initialize all services.The onDeviceReady method will be called when the initializationis complete.

        Parameters:
        device - the device which services got disconnected.
        optionalServicesFound - if true the secondary services were also foundon the device.
      • shouldEnableBatteryLevelNotifications

        @Deprecated() boolean shouldEnableBatteryLevelNotifications(@NonNull() BluetoothDevice device)

        This method should return true if Battery Level notifications should be enabled on thetarget device. If there is no Battery Service, or the Battery Level characteristic doesnot have NOTIFY property, this method will not be called for this device.

        This method may return true only if an activity is bound to the service (to display theinformation to the user), always (e.g. if critical battery level is reported usingnotifications) or never, if such information is not important or the manager wants tocontrol Battery Level notifications on its own.

        Parameters:
        device - the target device.
      • onBatteryValueReceived

        @Deprecated() void onBatteryValueReceived(@NonNull() BluetoothDevice device, @IntRange(from = 0, to = 100) int value)

        Called when battery value has been received from the device.

        Parameters:
        device - the device from which the battery value has changed.
        value - the battery value in percent.
      • onError

        @Deprecated() abstract void onError(@NonNull() BluetoothDevice device, @NonNull() String message, int errorCode)

        Called when a BLE error has occurred

        Parameters:
        device - the device that caused an error.
        message - the error message.
        errorCode - the error code.
      • onDeviceNotSupported

        @Deprecated() abstract void onDeviceNotSupported(@NonNull() BluetoothDevice device)

        Called when service discovery has finished but the main services were not found on the device.

        Parameters:
        device - the device that failed to connect due to lack of required services.