Drone

abstract class Drone : Instrument.Provider, Peripheral.Provider, PilotingItf.Provider

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

Types

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

Drone model.

Functions

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

Connects the drone.

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

Connects the drone using the specified device connector and custom parameters.

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

Disconnects the drone.

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

Forgets the drone.

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 drone 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>
getPilotingItf
Link copied to clipboard
abstract fun <PI : PilotingItf> getPilotingItf(@NonNull pilotingItfClass: Class<PI>): PI?
abstract fun <PI : PilotingItf> getPilotingItf(@NonNull pilotingItfClass: Class<PI>, @NonNull observer: Ref.Observer<PI>): Ref<PI>
getState
Link copied to clipboard
abstract fun getState(observer: Ref.Observer<DeviceState>): Ref<DeviceState>

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

Properties

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

Drone model.

name
Link copied to clipboard
abstract val name: String

Drone friendly name.

state
Link copied to clipboard
abstract val state: DeviceState

Drone current state

uid
Link copied to clipboard
abstract val uid: String

Drone unique identifier.