DJI Mobile SDK Documentation
      Package:dji.sdk.keyvalue.key
      classSince MSDK 5.0.0

      KeyTools

      Key tool class.

      Package dji.sdk.keyvalue.keyAndroid · Java / Kotlin

      Key tool class. DJI encapsulates a series of more concise and easy-to-use methods to create DJIKey instance.

      Supported since MSDK 5.0.0

      Members

      11 members

      Method

      8

      Enum

      2

      Class

      1
      method
      method

      createKey

      @NonNull
      static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo, int productId, int componentIndex, int subComponentType, int subComponentIndex)

      The default method for creating Key instances.

      Parameters

      NameTypeDescription
      mKeyInfoDJIKeyInfo<T> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.
      productIdint Product ID of the currently connected device, defaults to 0.
      componentIndexint Gimbal load position. Please refer to ComponentIndexType to set the corresponding int value.
      subComponentTypeint Camera lens type. Please refer to CameraLensType to set the corresponding int value.
      subComponentIndexint Reserved parameter.

      Return

      NameDescription
      static <T> DJIKey<T>Return instance of DJIKey.
      method
      method

      createKey

      @NonNull
      static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo)

      Create a Key instance by passing a DJIKeyInfo instance of a Key interface. This method is suitable for instance creation of keys that have nothing to do with the gimbal load and camera.

      Parameters

      NameTypeDescription
      mKeyInfoDJIKeyInfo<T> A key interface in DJIKey. For example, FlightControllerKey.KeyAircraftAttitude, which represents the key to get the aircraft attitude.

      Return

      NameDescription
      static <T> DJIKey<T>Return instance of DJIKey.
      method
      method

      createKey

      @NonNull
      static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo, @NonNull ComponentIndexType componentIndexType)

      Create a Key instance by passing in the DJIKeyInfo instance of a Key interface and the load position of the gimbal. This method is suitable for instance creation of keys related to the gimbal load.

      Parameters

      NameTypeDescription
      mKeyInfoDJIKeyInfo<T> A key interface in DJIKey. For example, GimbalKey.KeyGimbalReset, which represents the key to reset the gimbal.
      componentIndexType@NonNull ComponentIndexType Gimbal load position.

      Return

      NameDescription
      static <T> DJIKey<T>Return instance of DJIKey.
      method

      createCameraKey

      @NonNull
      static <T> DJIKey<T> createCameraKey(DJIKeyInfo<T> mKeyInfo, ComponentIndexType componentIndexType, CameraLensType cameraLensType)

      Create a Key instance by passing in the DJIKeyInfo instance of a Key interface, camera lens type and the load position of the gimbal. This method is suitable for instance creation of keys related to the camera.

      Parameters

      NameTypeDescription
      mKeyInfoDJIKeyInfo<T> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.
      componentIndexTypeComponentIndexType Gimbal load position.
      cameraLensTypeCameraLensType Camera lens type.

      Return

      NameDescription
      static <T> DJIKey<T>Return instance of DJIKey.
      method
      method

      createKey

      @NonNull
      static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo, int productId, int componentIndex, int subComponentType, int subComponentIndex)

      The default method for creating an ActionKey instance.

      Parameters

      NameTypeDescription
      mKeyInfoDJIActionKeyInfo<T, R> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.
      productIdint Product ID of the currently connected device, defaults to 0.
      componentIndexint Gimbal load position. Please refer to ComponentIndexType to set the corresponding int value.
      subComponentTypeint Camera lens type. Please refer to CameraLensType to set the corresponding int value.
      subComponentIndexint Reserved parameter.

      Return

      NameDescription
      static <T, R> DJIKey.ActionKey<T, R>Return instance of DJIKey.
      method
      method

      createKey

      @NonNull
      static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo)

      Create an ActionKey instance by passing in a DJIKeyInfo instance of a Key interface. This method is suitable for instance creation of ActionKey which is not related to gimbal load and camera.

      Parameters

      NameTypeDescription
      mKeyInfoDJIActionKeyInfo<T, R> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.

      Return

      NameDescription
      static <T, R> DJIKey.ActionKey<T, R>Return instance of DJIKey.
      method
      method

      createKey

      static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo, ComponentIndexType componentIndexType) 

      Create a Key instance by passing in the DJIKeyInfo instance of an ActionKey interface and the load position of the gimbal. This method is suitable for instance creation of ActionKey related to gimbal load.

      Parameters

      NameTypeDescription
      mKeyInfoDJIActionKeyInfo<T, R> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.
      componentIndexTypeComponentIndexType Gimbal load position.

      Return

      NameDescription
      static <T, R> DJIKey.ActionKey<T, R>Return instance of DJIKey.
      method

      createCameraKey

      @NonNull
      static <T, R> DJIKey.ActionKey<T, R> createCameraKey(DJIActionKeyInfo<T, R> mKeyInfo, ComponentIndexType componentIndexType, CameraLensType cameraLensType)

      Create a Key instance by passing in the DJIKeyInfo instance of an ActionKey interface, camera lens type and the load position of the gimbal. This method is suitable for instance creation of ActionKey related to camera.

      Parameters

      NameTypeDescription
      mKeyInfoDJIActionKeyInfo<T, R> A key interface in DJIKey. For example, CameraKey.KeyCameraType, which represents the key of the camera type.
      componentIndexTypeComponentIndexType Gimbal load position.
      cameraLensTypeCameraLensType Camera lens type.

      Return

      NameDescription
      static <T, R> DJIKey.ActionKey<T, R>Return instance of DJIKey.
      class

      DJIKeyInfo

      Since MSDK 5.0.0
      class DJIKeyInfo<T>

      The Key information class, which defines the capabilities of the Key.

      enum

      ComponentIndexType

      Gimbal load position.

      Enum Members

      NameDescription
      LEFT_OR_MAINPortside(Main) position.
      RIGHTStarboard position.
      UPUpside location.
      FPVNose(FPV)location.
      PORT_1Port 1 location.
      PORT_2Port 2 location.
      PORT_3Port 3 location.
      PORT_4Port 4 location.
      PORT_5Port 5 location.
      PORT_6Port 6 location.
      PORT_7Port 7 location.
      PORT_8Port 8 location.
      enum

      CameraLensType

      Type of camera lens.

      Enum Members

      NameDescription
      CAMERA_LENS_ZOOMZoom lens.
      CAMERA_LENS_WIDEWide lens.
      CAMERA_LENS_THERMALThermal lens.
      CAMERA_LENS_RGBMultispectral RGB lenses.
      CAMERA_LENS_MS_NDVIMultispectral NDVI lenses.
      CAMERA_LENS_MS_GMultispectral G lenses.
      CAMERA_LENS_MS_RMultispectral R lenses.
      CAMERA_LENS_MS_REMultispectral RE lenses.
      CAMERA_LENS_MS_NIRMultispectral NIR lenses.
      CAMERA_LENS_DEFAULTDefault lens. For cameras with only one lens, there is no need to distinguish between zoom, wide or infrared lenses. Use this default lens type.