class DJISpotlight
@interface DJISpotlight : DJIBaseComponent
|
Description:
This class represents the spotlight accessory mounted on the aircraft. It provides methods to control the spotlight and get the related states.
Class Members:
Members
property state
@property (nonatomic, readonly, nullable) DJISpotlightState *state
|
Description:
Gets the state of the spotlight.
See Also:
DJISpotlightState
method getEnabledWithCompletion
- (void)getEnabledWithCompletion:(void (^_Nonnull)(BOOL enabled, NSError *_Nullable error))completion
|
Description:
Gets on/off status of Spotlight.
BOOL enabled | Check if spotlight is turned on. |
NSError *_Nullable error | Error retrieving the value. |
void (^_Nonnull)(BOOL enabled, NSError *_Nullable error) completion | Completion block to receive the result. |
method setEnabled:withCompletion
- (void)setEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion
|
Description:
Enables the spotlight to turn it on.
BOOL enabled | YES to turn on the spotlight. |
DJICompletionBlock completion | Completion block to receive the result. |
method setBrightness:withCompletion
- (void)setBrightness:(NSUInteger)brightness withCompletion:(DJICompletionBlock)completion
|
Description:
Sets the brightness of the spotlight. The valid range is [1, 100]. 100 means the brightest.
NSUInteger brightness | Brightness of the spotlight. |
DJICompletionBlock completion | Completion block to receive the result. |
method addSpotlightStateListener:withQueue:andBlock
- (void)addSpotlightStateListener:(id)listener withQueue:(nullable dispatch_queue_t)queue andBlock:(DJISpotlightStateBlock)block
|
Description:
Adds listener to receive the latest state of the spotlight.
id listener | Listener that is interested on upload event. |
nullable dispatch_queue_t queue | The dispatch queue that block will be called on. |
DJISpotlightStateBlock block | Block will be called when there is event updated related to upload. |
method removeSpotlightStateListener
- (void)removeSpotlightStateListener:(id)listener
|
Description:
Removes the listener of the spotlight state.
id listener | The listener to remove. |
typedef block DJISpotlightStateBlock
typedef void (^DJISpotlightStateBlock) (DJISpotlightState* state)
|
Description:
Block to receive the spotlight's state.