Class DeviceState
- java.lang.Object
-
- com.parrot.drone.groundsdk.device.DeviceState
-
public abstract class DeviceState extends Object
Device state information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DeviceState.ConnectionState
Connection state.static class
DeviceState.ConnectionStateCause
Reason why the device is in the current state.
-
Constructor Summary
Constructors Constructor Description DeviceState()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
canBeConnected()
Tells whether the device can be connected.abstract boolean
canBeDisconnected()
Tells whether the device can be disconnected.abstract boolean
canBeForgotten()
Tells whether the device can be forgotten.abstract DeviceConnector
getActiveConnector()
Gets the currently active connector.abstract DeviceState.ConnectionState
getConnectionState()
Gets the device connection state.abstract DeviceState.ConnectionStateCause
getConnectionStateCause()
Gets the reason why device is in the current state.abstract DeviceConnector[]
getConnectors()
Gets the list of available connectors for this device.
-
-
-
Method Detail
-
getConnectionState
@NonNull public abstract DeviceState.ConnectionState getConnectionState()
Gets the device connection state.- Returns:
- drone connection state
-
getConnectionStateCause
@NonNull public abstract DeviceState.ConnectionStateCause getConnectionStateCause()
Gets the reason why device is in the current state.- Returns:
- current connection state cause
-
getConnectors
@NonNull public abstract DeviceConnector[] getConnectors()
Gets the list of available connectors for this device.- Returns:
- the device connectors
-
getActiveConnector
@Nullable public abstract DeviceConnector getActiveConnector()
Gets the currently active connector.This is the connector using which the current device connection has been established.
- Returns:
- the currently active connector, or
null
if the device is not currently connected
-
canBeForgotten
public abstract boolean canBeForgotten()
Tells whether the device can be forgotten.A device may be forgotten if it has been connected once using the
local connector
or if any of is available connectors is aremote control
.
In that last case, the device will also be forgotten by the remote control device in question.- Returns:
true
if the device can be forgotten, otherwisefalse
-
canBeDisconnected
public abstract boolean canBeDisconnected()
Tells whether the device can be disconnected.A device may be disconnected if it is currently connected through the
local connector
.
Devices currently connected throughremote controls
CANNOT be disconnected (instead, the remote control itself has to be disconnected, or another device must be connected using that remote control).- Returns:
true
if the device can be disconnected, otherwisefalse
-
canBeConnected
public abstract boolean canBeConnected()
Tells whether the device can be connected.A device may be connected as long as it is currently disconnected and has available
device connectors
through which to connect.- Returns:
true
if the device can be connected, otherwisefalse
-
-