public abstract class

RemoteControl

extends Object

implements Instrument.Provider, Peripheral.Provider

 java.lang.Object

↳com.parrot.drone.groundsdk.device.RemoteControl

Overview

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

Summary

Constructors
publicRemoteControl()

Methods
public abstract booleanconnect()

Connects the remote control.

public abstract booleanconnect(DeviceConnector connector)

Connects the remote control using the specified device connector.

public abstract booleanconnect(DeviceConnector connector, String password)

Connects the remote control.

public abstract booleandisconnect()

Disconnects the remote control.

public abstract booleanforget()

Forgets the remote control.

public abstract RemoteControl.ModelgetModel()

Gets the remote control model.

public abstract StringgetName()

Gets remote control current name.

public abstract Ref<String>getName(Ref.Observer<String> observer)

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

public abstract DeviceStategetState()

Gets the remote control current state.

public abstract Ref<DeviceState>getState(Ref.Observer<DeviceState> observer)

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

public abstract StringgetUid()

Gets the remote control uid.

from Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public RemoteControl()

Methods

public abstract String getUid()

Gets the remote control uid.

Remote control uid uniquely identifies a remote control, and is persistent between sessions.

Returns:

remote control uid

public abstract RemoteControl.Model getModel()

Gets the remote control model.

Model is set when the remote control instance is created and never changes.

Returns:

remote control model

public abstract String getName()

Gets remote control current name.

Remote control name can be changed. This method returns the name at the current time. Use RemoteControl.getName(Ref.Observer) to get the current name and be notified when the name changes.

Returns:

remote control current name

public abstract Ref<String> getName(Ref.Observer<String> observer)

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

If the remote control is removed, the observer will be notified and the name returned by Ref.get() will be null.

Parameters:

observer: observer to notify when the remote control name changes

Returns:

reference to remote control name

See also: to get current name without registring an observer

public abstract DeviceState getState()

Gets the remote control current state.

This method returns the current state without indicating when it changes. Use RemoteControl.getState(Ref.Observer) to get the current state and be notified when the state changes.

Returns:

current remote control state

public abstract Ref<DeviceState> getState(Ref.Observer<DeviceState> observer)

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

If the remote control is removed, the observer will be notified and the state returned by Ref.get() will be null.

Parameters:

observer: observer to notify when the remote control state changes

Returns:

reference to remote control state

See also: to get current state without registring an observer

public abstract boolean forget()

Forgets the remote control.

Persisted remote control data are deleted and the remote control is removed if it's not currently visible.

Returns:

true if the remote control has been forgotten, otherwise false

public abstract boolean connect()

Connects the remote control.

Chooses the best available connector, as follows:

  • If there is only one available connector, then it is used to connect the remote control. Otherwise,
  • if there is only one available USB connector (note that there can be two of those in case both the device USB and the USB Debug Bridge are used), then it is used to connect the remote control.
If none of the aforementioned condition holds, then the connection fails and false is returned.
RemoteControl.connect(DeviceConnector) method shall be used to select an appropriate connector instead.

Returns:

true if the connection process has started, otherwise false, for example if the remote control is not visible anymore

public abstract boolean connect(DeviceConnector connector)

Connects the remote control using the specified device connector.

Parameters:

connector: connector that should be used

Returns:

true if the connection process has started, otherwise false, for example if the remote control is not visible anymore

public abstract boolean connect(DeviceConnector connector, String password)

Connects the remote control.

Parameters:

connector: connector that should be used
password: password to use for authentication

Returns:

true if the connection process has started, otherwise false, for example if the remote control is not visible anymore

public abstract boolean disconnect()

Disconnects the remote control.

This method can be used to disconnect the remote control when connected or to cancel the connection process if the remote control is currently connecting.

Returns:

true if the disconnection process has started, otherwise false