DJI Mobile SDK Documentation

      class Spotlight

      class Spotlight extends BaseComponent
      Package:dji.sdk.accessory.spotlight
      Inherits From:BaseComponent
      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:

      State Updates

      General
      method
      method setStateCallback
      void setStateCallback(@Nullable SpotlightState.Callback callback)
      Package:dji.sdk.accessory.spotlight
      Description:

      Set spotlight state update callback.

      Input Parameters:
      @Nullable SpotlightState.Callback callbackThe execution callback with the execution result returned.


      Members

      method
      method getState
      SpotlightState getState()
      Package:dji.sdk.accessory.spotlight
      Description:

      Gets the state of the spotlight.

      Return:
      SpotlightStateAn instance of SpotlightState.
      method getEnabled
      void getEnabled(@NonNull CommonCallbacks.CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.accessory.spotlight
      Description:

      Gets on/off status of Spotlight.

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      method setEnabled
      void setEnabled(boolean enabled, @Nullable final CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.accessory.spotlight
      Description:

      Enables the spotlight to turn it on.

      Input Parameters:
      boolean enabledtrue to turn on the spotlight.
      @Nullable final CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.
      method setBrightness
      void setBrightness(@IntRange(from = 1, to = 100) int value,
      @Nullable final CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.accessory.spotlight
      Description:

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

      Input Parameters:
      @IntRange(from = 1, to = 100) int valueBrightness value to set.
      @Nullable final CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.


      Inherited Methods:
      dji.sdk.base.BaseComponent
      method
      method setComponentListener
      void setComponentListener(ComponentListener listener)
      Package:dji.sdk.base
      Description:

      Sets the listener for the DJI component.

      Input Parameters:
      ComponentListener listenerThe callback of ComponentListener.
      method
      method getIndex
      int getIndex()
      Package:dji.sdk.base
      Description:

      Returns the component index. Index is zero based. A component will have an index greater than zero when there are multiple components of the same type on the DJI product, and one of the components already has the index 0. For instance, M210 can have two gimbal mounted cameras, and will therefore have two gimbal components with indices 0 and 1, and two camera components with indices 0 and 1. For Matrice 600, there are printed numbers on the battery boxes. The Battery component instance with index 0 corresponds to battery compartment number 1. For Inspire 2 and M200 series, Battery with index 0 corresponds to the battery on the port (left hand) side of the aircraft. For M210, M210 RTK, M300 RTK and M350 RTK, Camera and Gimbal with index 0 corresponds to the camera and gimbal on the port (left hand) side of the aircraft. Lidar with index 0 corresponds to the lidar(Zenmuse L1) on the port (left hand) side of the aircraft.

      Return:
      intAn int value of index.
      method isConnected
      boolean isConnected()
      Package:dji.sdk.base
      Description:

      true if the component is connected.

      Return:
      booleantrue if the component is connected.
      method getSerialNumber
      void getSerialNumber(@NonNull CompletionCallbackWith<String> callback)
      Package:dji.sdk.base
      Description:

      Gets the serial number of the component. Depending on the component, this serial number might not match the serial number found on the physical component.

      Input Parameters:
      @NonNull CompletionCallbackWith<String> callbackThe execution callback with the value returned.
      method getFirmwareVersion
      void getFirmwareVersion(@NonNull CompletionCallbackWith<String> callback)
      Package:dji.sdk.base
      Description:

      Returns the firmware version of the component. Each component will have a different firmware version, the combination of which will form the package firmware version getFirmwarePackageVersion found in BaseProduct.

      Input Parameters:
      @NonNull CompletionCallbackWith<String> callbackThe execution callback with the value(s) returned.