DJI Mobile SDK Documentation

      class FocusState

      @EXClassNullAway
      class FocusState
      Package:dji.common.camera
      Description:

      This class contains information about the lens' current state, including lens type, focus status, focus mode, focus assistant state, and Auto Focus (AF) switch state.

      Class Members:
      Callback
      interface
      interface Callback
      interface Callback
      Package:dji.common.camera
      Description:

      This interface provides updated information about the lens and focus.

      Interface Methods:
      State
      method
      method onUpdate
      void onUpdate(@NonNull FocusState state)
      Package:dji.common.camera
      Description:

      Called when the camera's lens and focus state has been updated.

      Input Parameters:
      @NonNull FocusState stateThe camera lens and focus state information.
      Lens
      method
      method isLensMounted
      boolean isLensMounted()
      Package:dji.common.camera
      SDK Key:CameraKey.LENS_IS_INSTALLED
      Description:

      true if lens is installed on the camera.

      Return:
      booleanA boolean value.
      Focus Status
      method
      method getFocusStatus
      FocusStatus getFocusStatus()
      Package:dji.common.camera
      SDK Key:CameraKey.FOCUS_STATUS
      Description:

      The current focus status of the lens. If the lens is not installed, the value is undefined.

      Return:
      FocusStatusA FocusStatus enum value.
      MF/AF Focus Mode
      method
      method isAFSwitchOn
      boolean isAFSwitchOn()
      Package:dji.common.camera
      SDK Key:CameraKey.LENS_IS_AF_SWITCH_ON
      Description:

      true if the lens Auto Focus (AF) switch is on. If the lens is not installed, the value is undefined. If true, setFocusMode can be used to control the focal point.

      Return:
      booleanA boolean value.
      method getFocusMode
      FocusMode getFocusMode()
      Package:dji.common.camera
      SDK Key:CameraKey.FOCUS_MODE
      Description:

      The current focus mode. If the lens is not installed, the value is undefined.

      Return:
      FocusModeA FocusMode enum value.
      Focus Assistant
      method
      method isFocusAssistantEnabledForMF
      boolean isFocusAssistantEnabledForMF()
      Package:dji.common.camera
      SDK Key:CameraKey.FOCUS_ASSISTANT_SETTINGS
      Description:

      true if the focus assistant is enabled for Manual focus mode. If the lens is not installed, the value is undefined.

      Return:
      booleanA boolean value.
      method isFocusAssistantEnabledForAF
      boolean isFocusAssistantEnabledForAF()
      Package:dji.common.camera
      SDK Key:CameraKey.FOCUS_ASSISTANT_SETTINGS
      Description:

      true if the focus assistant is enabled for Auto focus mode. If the lens is not installed, the value is undefined.

      Return:
      booleanA boolean value.
      method isFocusAssistantWorking
      boolean isFocusAssistantWorking()
      Package:dji.common.camera
      SDK Key:CameraKey.LENS_IS_FOCUS_ASSISTANT_WORKING
      Description:

      true if the focus target is zooming out. If the lens is not installed, the value is undefined.

      Return:
      booleanA boolean value.
      Sensor Cleaning State
      method
      method getSensorCleaningState
      SensorCleaningState getSensorCleaningState()
      Package:dji.common.camera
      Description:

      Get the sensor cleaning state.

      Return:
      SensorCleaningStateA SensorCleaningState enum value.