RemoteControl

abstract class RemoteControl : Instrument.Provider, Peripheral.Provider

A generic remote control. This is the base class to manage a specific remote control.

Types

Model
Link copied to clipboard
enum Model : Enum<RemoteControl.Model> , DeviceModel

Drone model.

Functions

connect
Link copied to clipboard
abstract fun connect(): Boolean

Connects the remote control.

abstract fun connect(connector: DeviceConnector, vararg parameters: ConnectionParameter): Boolean

Connects the remote control using the specified device connector and custom parameters.

disconnect
Link copied to clipboard
abstract fun disconnect(): Boolean

Disconnects the remote control.

forget
Link copied to clipboard
abstract fun forget(): Boolean

Forgets the remote control.

getInstrument
Link copied to clipboard
abstract fun <I : Instrument> getInstrument(@NonNull instrumentClass: Class<I>): I?
abstract fun <I : Instrument> getInstrument(@NonNull instrumentClass: Class<I>, @NonNull observer: Ref.Observer<I>): Ref<I>
getName
Link copied to clipboard
abstract fun getName(observer: Ref.Observer<String>): Ref<String>

Gets the remote control friendly name and registers an observer notified each time it changes.

getPeripheral
Link copied to clipboard
abstract fun <P : Peripheral> getPeripheral(@NonNull peripheralClass: Class<P>): P?
abstract fun <P : Peripheral> getPeripheral(@NonNull peripheralClass: Class<P>, @NonNull observer: Ref.Observer<P>): Ref<P>
getState
Link copied to clipboard
abstract fun getState(observer: Ref.Observer<DeviceState>): Ref<DeviceState>

Gets current remote control state and registers an observer notified each time it changes.

Properties

model
Link copied to clipboard
abstract val model: RemoteControl.Model

Remote control model.

name
Link copied to clipboard
abstract val name: String

Remote control friendly name.

state
Link copied to clipboard
abstract val state: DeviceState

Remote control current state

uid
Link copied to clipboard
abstract val uid: String

Remote control unique identifier.