DJI Mobile SDK Documentation

      class DJIHandheldController

      @interface DJIHandheldController : DJIBaseComponent
      Header:DJIHandheldController.h
      Inherits From:DJIBaseComponent
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerComponent
      Description:

      This class contains interfaces related to the hand controller of a handheld device (such as Osmo). This object is available from the DJIHandheld subclass off DJIBaseProduct.

      Class Members:
      State Updates
      property
      property delegate
      @property(nonatomic, weak) id <DJIHandheldControllerDelegate> delegate
      Header:DJIHandheldController.h
      Description:

      Returns the DJIHandheldController delegate.

      See Also:

      DJIHandheldControllerDelegate

      method setPowerMode:withCompletion
      - (void)setPowerMode:(DJIHandheldPowerMode)mode withCompletion:(DJICompletionBlock)completion
      Header:DJIHandheldController.h
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerParamPowerMode
      Description:

      Set the power mode for the handheld controller.

      Input Parameters:
      DJIHandheldPowerMode modeThe power mode to set. CAUTION! When the mode is DJIHandheldPowerModeOff, the handheld product will be shut down and the connection will be broken. The user must then power on the device manually.
      DJICompletionBlock completionRemote execution result callback block.
      method controlLEDWithCommand:withCompletion
      - (void)controlLEDWithCommand:(DJIHandheldControllerLEDCommand *)command
      withCompletion:(DJICompletionBlock)completion
      Header:DJIHandheldController.h
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerParamControlLED
      Description:

      Controls the LED of the handheld controller.

      Input Parameters:
      DJIHandheldControllerLEDCommand * commandThe command to control the LED.
      DJICompletionBlock completionRemote execution result callback block.
      method setStickGimbalControlEnabled:withCompletion
      - (void)setStickGimbalControlEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion
      Header:DJIHandheldController.h
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerParamStickGimbalControlEnabled
      Description:

      Enables/disables the gimbal control with the joystick. By default, it is enabled. The handheld will be reset to the default value when it reboots or SDK reinitializes. When gimbal control is disabled, the joystick can be used for other purposes in an SDK application by reading its position values with DJIHandheldStickVerticalDirection and DJIHandheldStickHorizontalDirection. Only supported in firmware version 1.2.0.40 or above.

      Input Parameters:
      BOOL enabledYES to enable the gimbal control.
      DJICompletionBlock completionRemote execution result callback block.
      method getStickGimbalControlEnabledWithCompletion
      - (void)getStickGimbalControlEnabledWithCompletion:(void(^)(BOOL enabled, NSError *_Nullable error))completion
      Header:DJIHandheldController.h
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerParamStickGimbalControlEnabled
      Description:

      YES if gimbal control with the joystick is enabled. Only supported in firmware version 1.2.0.40 or above.

      Input Parameters:
      BOOL enabledThe enabled value.
      NSError *_Nullable errorError retrieving the value.
      void(^)(BOOL enabled, NSError *_Nullable error) completionRemote execution result callback block.
      protocol DJIHandheldControllerDelegate
      @protocol DJIHandheldControllerDelegate <NSObject>
      Header:DJIHandheldController.h
      Inherits From:NSObject
      Description:

      This protocol provides a delegate method to receive the updated power mode of the handheld controller.

      Protocol Methods:
      method handheldController:didUpdatePowerMode
      @optional
      - (void)handheldController:(DJIHandheldController *_Nonnull)controller didUpdatePowerMode:(DJIHandheldPowerMode)powerMode
      Header:DJIHandheldController.h
      Description:

      Called when the handheld controller's power mode has been updated.

      Input Parameters:
      DJIHandheldController *_Nonnull controllerThe handheld controller that updates the power mode.
      DJIHandheldPowerMode powerModeThe handheld controller's current power mode.
      method handheldController:didUpdateHardwareState
      @optional
      - (void)handheldController:(DJIHandheldController *_Nonnull)controller didUpdateHardwareState:(DJIHandheldControllerHardwareState *)state
      Header:DJIHandheldController.h
      Description:

      Called when the handheld controller's current hardware state (e.g. the state of the physical buttons and joysticks) has been updated.

      Input Parameters:
      DJIHandheldController *_Nonnull controllerThe handheld controller that updates the hardware state.
      DJIHandheldControllerHardwareState * stateThe handheld controller's current hardware state.
      enum DJIHandheldPowerMode
      typedef NS_ENUM (uint8_t, DJIHandheldPowerMode)
      Header:DJIHandheldControllerBaseTypes.h
      SDK Key:DJIHandheldControllerKey.DJIHandheldControllerParamPowerMode
      Description:

      Handheld Power Mode.

      Enum Members:
      DJIHandheldPowerModeOnThe handheld product is awake. For Osmo, when it is in this mode, all the components in DJIHandheld are accessible.
      DJIHandheldPowerModeSleepingThe handheld product is sleeping. The handheld controller keeps the wireless connection to the mobile device alive but most other components are off. The power consumption is low in this mode. For Osmo in this mode, only the DJIHandheldController, DJIAirLink, and DJIBattery are accessible.
      DJIHandheldPowerModeOffThe handheld product is powered off. Once this mode is set the delegate will receive this mode until the handheld device is shut down completely. It is not supported by Osmo Mobile.
      DJIHandheldPowerModeUnknownThe Handheld Power Mode in unknown.
      enum DJIHandheldControllerStickControlMode
      typedef NS_ENUM (uint8_t, DJIHandheldControllerStickControlMode)
      Header:DJIHandheldControllerBaseTypes.h
      SDK Key:DJIGimbalKey.DJIGimbalParamStickControlMode
      Description:

      The control mode for the gimbal physical controller (joystick for Osmo). The total controller deflection is a combination of horizontal and vertical deflection. This translates to gimbal movement around the yaw and pitch axes. The gimbal can be set to either move in both yaw and pitch simultaneously based on horizontal and vertical deflection of the controller, or move in only yaw or pitch exclusively based on whether horizontal or vertical deflection is larger.

      Enum Members:
      DJIHandheldControllerStickControlModeOneAxisGimbal movement will be exclusively in yaw or pitch depending on whether the controller horizontal or vertical deflection is greater respectively.
      DJIHandheldControllerStickControlModeTwoAxisGimbal movement will be in both yaw and pitch simultaneously relative to the horizontal and vertical deflection of the controller respectively.
      DJIHandheldControllerStickControlModeUnknownThe gimbal controller control mode is unknown.
      enum DJIHandheldZoomSlider
      typedef NS_ENUM (uint8_t, DJIHandheldZoomSlider)
      Header:DJIHandheldControllerBaseTypes.h
      Description:

      The state of the zoom slider on the handheld controller. Used by Osmo Mobile 2 only.

      Enum Members:
      DJIHandheldZoomSliderIdleZoom slider is idle.
      DJIHandheldZoomSliderZoomInThe slider is pushed up and the camera should zoom in.
      DJIHandheldZoomSliderZoomOutThe slider is pushed down and the camera should zoom out.
      DJIHandheldZoomSliderZoomUnknownUnknown.