get Peripheral
abstract fun <P : Peripheral?> getPeripheral(@NonNull peripheralClass: Class<P>): P
Content copied to clipboard
Gets a peripheral.
Return
requested peripheral, or null
if it's not present
Parameters
peripheral Class
class of the peripheral
<P>
type of the peripheral class
abstract fun <P : Peripheral?> getPeripheral(@NonNull peripheralClass: Class<P>, @NonNull observer: Ref.Observer<P>): Ref<P>
Content copied to clipboard
Gets a peripheral and registers an observer notified each time it changes.
Return
reference to the requested peripheral
Parameters
peripheral Class
class of the peripheral
observer
observer to notify when the peripheral changes
<P>
type of the peripheral class