DJI Mobile SDK Documentation

      class DJISpotlight

      @interface DJISpotlight : DJIBaseComponent
      Header:DJISpotlight.h
      Inherits From: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
      property state
      @property (nonatomic, readonly, nullable) DJISpotlightState *state
      Header:DJISpotlight.h
      Description:

      Gets the state of the spotlight.

      See Also:

      DJISpotlightState

      method getEnabledWithCompletion
      - (void)getEnabledWithCompletion:(void (^_Nonnull)(BOOL enabled, NSError *_Nullable error))completion
      Header:DJISpotlight.h
      Description:

      Gets on/off status of Spotlight.

      Input Parameters:
      BOOL enabledCheck if spotlight is turned on.
      NSError *_Nullable errorError retrieving the value.
      void (^_Nonnull)(BOOL enabled, NSError *_Nullable error) completionCompletion block to receive the result.
      method setEnabled:withCompletion
      - (void)setEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion
      Header:DJISpotlight.h
      Description:

      Enables the spotlight to turn it on.

      Input Parameters:
      BOOL enabledYES to turn on the spotlight.
      DJICompletionBlock completionCompletion block to receive the result.
      method setBrightness:withCompletion
      - (void)setBrightness:(NSUInteger)brightness withCompletion:(DJICompletionBlock)completion
      Header:DJISpotlight.h
      Description:

      Sets the brightness of the spotlight. The valid range is [1, 100]. 100 means the brightest.

      Input Parameters:
      NSUInteger brightnessBrightness of the spotlight.
      DJICompletionBlock completionCompletion block to receive the result.
      method addSpotlightStateListener:withQueue:andBlock
      - (void)addSpotlightStateListener:(id)listener
      withQueue:(nullable dispatch_queue_t)queue
      andBlock:(DJISpotlightStateBlock)block
      Header:DJISpotlight.h
      Description:

      Adds listener to receive the latest state of the spotlight.

      Input Parameters:
      id listenerListener that is interested on upload event.
      nullable dispatch_queue_t queueThe dispatch queue that block will be called on.
      DJISpotlightStateBlock blockBlock will be called when there is event updated related to upload.
      method removeSpotlightStateListener
      - (void)removeSpotlightStateListener:(id)listener
      Header:DJISpotlight.h
      Description:

      Removes the listener of the spotlight state.

      Input Parameters:
      id listenerThe listener to remove.


      typedef block DJISpotlightStateBlock
      typedef void (^DJISpotlightStateBlock) (DJISpotlightState* state)
      Header:DJISpotlight.h
      Description:

      Block to receive the spotlight's state.

      Input Parameters:
      DJISpotlightState* stateAn object of DJISpotlightState.