Interface Peripheral.Provider

    • Method Detail

      • getPeripheral

        @Nullable
        <P extends Peripheral> P getPeripheral​(@NonNull
                                               Class<P> peripheralClass)
        Gets a peripheral.
        Type Parameters:
        P - type of the peripheral class
        Parameters:
        peripheralClass - class of the peripheral
        Returns:
        requested peripheral, or null if it's not present
      • getPeripheral

        @NonNull
        <P extends PeripheralRef<P> getPeripheral​(@NonNull
                                                    Class<P> peripheralClass,
                                                    @NonNull
                                                    Ref.Observer<P> observer)
        Gets a peripheral and registers an observer notified each time it changes.
        Type Parameters:
        P - type of the peripheral class
        Parameters:
        peripheralClass - class of the peripheral
        observer - observer to notify when the peripheral changes
        Returns:
        reference to the requested peripheral