getPeripheral

abstract fun <T : Peripheral> getPeripheral(peripheralClass: Class<T>): T?

Gets a peripheral.

Return

requested peripheral, or null if it is not present

Parameters

peripheralClass

class of the peripheral

type of the peripheral class


abstract fun <T : Peripheral> getPeripheral(peripheralClass: Class<T>, observer: Ref.Observer<T>): Ref<T>

Gets a peripheral and registers an observer notified each time it changes.

Return

reference to the requested peripheral

Parameters

peripheralClass

class of the peripheral

observer

observer to notify when the peripheral changes

type of the peripheral class