class KeyManager
Description:
KeyManager
provides access to the keyed interface using DJIKey
and corresponding subclass objects. KeyManager
is accessed from getKeyManager
in DJISDKManager
.
Class Members:
method getValue
@Nullable Object getValue (@NonNull DJIKey key)
Description:
Returns the latest known value if available for the key. Does not pull it from the product if unavailable.
Return:
@Nullable Object The value associated with the key.
method getValue
void getValue (@NonNull DJIKey key, @NonNull final GetCallback callback)
Description:
Performs a get on a gettable key, pulling the information from the product if necessary.
@NonNull DJIKey key A valid gettable key @NonNull final GetCallback callback A valid get callback.
method setValue
void setValue (@NonNull DJIKey key, @NonNull Object value, @Nullable final SetCallback callback)
Description:
Performs a set on a settable key, changing attributes on the connected product.
@NonNull Object value A value object relevant to the given key @NonNull DJIKey key A valid settable key @Nullable final SetCallback callback A set callback.
method addListener
void addListener (@NonNull DJIKey key, @NonNull final KeyListener listener)
Description:
Subscribes the listener object to all changes of value on the given key.
@NonNull DJIKey key A valid value-based key (get, set and/or action) @NonNull final KeyListener listener A valid object to hold the subscription
method removeListener
void removeListener (@NonNull final KeyListener listener)
Description:
Stops the subscription to updates of a specific key value for a specific listener. Does not affect other listeners subscribing to this key or other subscriptions of the listener
.
@NonNull final KeyListener listener The listener object passed at the moment of calling startListening.
method isKeySupported
boolean isKeySupported (@NonNull DJIKey key)
Description:
Determines if a key is supported by the connected product.
@NonNull DJIKey key Key to be check on current product.
Return:
boolean true
if the key is supported.
method removeKey
void removeKey (DJIKey key)
Description:
Remove a key's cache value.
DJIKey key Key to be removed on current product.