getInstrument

abstract fun <I : Instrument?> getInstrument(@NonNull instrumentClass: Class<I>): I

Gets an instrument.

Return

requested instrument, or null if it's not present

Parameters

instrumentClass

class of the instrument

<I>

type of the instrument class

abstract fun <I : Instrument?> getInstrument(@NonNull instrumentClass: Class<I>, @NonNull observer: Ref.Observer<I>): Ref<I>

Gets an instrument and registers an observer notified each time it changes.

Return

reference to the requested instrument

Parameters

instrumentClass

class of the instrument

observer

observer to notify when the peripheral changes

<I>

type of the instrument class