DJI Mobile SDK Documentation

      class DJIAccessLocker

      @interface DJIAccessLocker : NSObject
      Header:DJIAccessLocker.h
      Inherits From:NSObject
      Description:

      The Access Locker provides methods to control the permission to access the aircraft. For an aircraft with advanced security features, the aircraft is locked after a user account is set up: the storage is not accessible; the live view is not available; the aircraft cannot take off. The user can unlock the aircraft with the security code to access all features of the aircraft. The security code is encrypted in the aircraft. DJI will not be able to fetch the security code. If the security code is forgotten, the user has to format the storage to reset the protection system. All the files in the internal storage and the user account information will be deleted. The Access Locker is only supported by Mavic 2 Enterprise.

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

      Delegate that receives the information sent by the Access Locker.

      See Also:

      DJIAccessLockerDelegate

      State
      property
      property state
      @property (nonatomic, readonly) DJIAccessLockerState state
      Header:DJIAccessLocker.h
      Description:

      The latest state of the Access Locker.

      See Also:

      DJIAccessLockerState

      Formatting State
      property
      property formattingState
      @property (nonatomic, readonly) DJIAccessLockerFormattingState *formattingState
      Header:DJIAccessLocker.h
      Description:

      The latest formatting state of the Access Locker.

      See Also:

      DJIAccessLockerFormattingState

      Get Version
      method
      method getVersionWithCompletion
      - (void)getVersionWithCompletion:(void (^_Nullable)(NSUInteger version, NSError *_Nullable error))completion
      Header:DJIAccessLocker.h
      Description:

      The version of the security feature.

      Input Parameters:
      NSUInteger versionVersion of the security feature.
      NSError *_Nullable errorError retrieving the value.
      void (^_Nullable)(NSUInteger version, NSError *_Nullable error) completionCompletion block to receive the result.
      Get User Name
      method
      method getUsernameWithCompletion
      - (void)getUsernameWithCompletion:(void (^_Nullable)(NSString *userName, NSError *_Nullable error))completion
      Header:DJIAccessLocker.h
      Description:

      Returns the username of the current Access Locker account.

      Input Parameters:
      NSString * userNameUser name of the current Access Locker account.
      NSError *_Nullable errorError retrieving the value.
      void (^_Nullable)(NSString *userName, NSError *_Nullable error) completionCompletion block to receive the result.
      Set Up User Account
      method
      method setUpUserAccount:withCompletion
      - (void)setUpUserAccount:(DJIAccessLockerUserAccountInfo *)account withCompletion:(DJICompletionBlock)completion
      Header:DJIAccessLocker.h
      Description:

      Sets up a user account to enable the access protection of the aircraft. After setting up a user account, the security code of the user is required in each power-cycle of the aircraft or the aircraft is just paired with the remote controller. The security code is also required to access data in the aircraft through DJI Assistant 2. This method is only valid when the state is DJIAccessLockerStateNotInitialized. If the method executes successfully, the state will change to DJIAccessLockerStateUnlocked.

      Input Parameters:
      DJIAccessLockerUserAccountInfo * accountUser account info to be set to the Access Locker system.
      DJICompletionBlock completionCompletion block to receive the result.
      method login:withCompletion
      - (void)login:(DJIAccessLockerUserAccountInfo *)account withCompletion:(DJICompletionBlock)completion
      Header:DJIAccessLocker.h
      Description:

      Logs in to unlock the access protection of the aircraft. This method is valid when the state is DJIAccessLockerStateLocked. If the user is logged in successfully, the state will change to DJIAccessLockerStateUnlocked.

      Input Parameters:
      DJIAccessLockerUserAccountInfo * accountUser account info to be set to the Access Locker system.
      DJICompletionBlock completionCompletion block to receive the result.
      method modifyUserAccount:newUserAccountInfo:withCompletion
      - (void)modifyUserAccount:(DJIAccessLockerUserAccountInfo *)currentAccountInfo newUserAccountInfo:(DJIAccessLockerUserAccountInfo *)newUserAccountInfo withCompletion:(DJICompletionBlock)completion
      Header:DJIAccessLocker.h
      Description:

      Modifies the user account. The old user account information will be overridden by the new one. This method is valid when the state is either DJIAccessLockerStateUnlocked or DJIAccessLockerStateLocked. If the user account is modified, the aircraft will be unlocked and the state will change to DJIAccessLockerStateUnlocked.

      Input Parameters:
      DJIAccessLockerUserAccountInfo * currentAccountInfoCurrent user account info to be set to the Access Locker system.
      DJIAccessLockerUserAccountInfo * newUserAccountInfoNew user account info to be set to the Access Locker system.
      DJICompletionBlock completionCompletion block to receive the result.
      Reset User Account
      method
      method resetUserAccount:withCompletion
      - (void)resetUserAccount:(DJIAccessLockerUserAccountInfo *)userAccountInfo withCompletion:(DJICompletionBlock)completion
      Header:DJIAccessLocker.h
      Description:

      Resets the user account to disable the protection. The user account information (e.g. user name, security code) will be deleted and the aircraft is accessible without validating the user. This method is valid when the state is either DJIAccessLockerStateUnlocked or DJIAccessLockerStateLocked. If the user account is reset, the state will change to DJIAccessLockerStateNotInitialized.

      Input Parameters:
      DJIAccessLockerUserAccountInfo * userAccountInfoUser account info to be set to the Access Locker system.
      DJICompletionBlock completionCompletion block to receive the result.
      method formatWithCompletion
      - (void)formatWithCompletion:(DJICompletionBlock)completion
      Header:DJIAccessLocker.h
      Description:

      Formats the protected data in the aircraft, including data in the internal storage and the user account information. This method is only valid when the user account is set up. Use DJIAccessLockerFormattingState to check the progress of formatting. When formatting is done, the state will change to DJIAccessLockerStateNotInitialized.

      Input Parameters:
      DJICompletionBlock completionCompletion block to receive the result.
      State Updates
      protocol
      protocol DJIAccessLockerDelegate
      @protocol DJIAccessLockerDelegate <NSObject>
      Header:DJIAccessLocker.h
      Inherits From:NSObject
      Description:

      Define the state of Access Locker.

      Protocol Methods:

      Protocol Method

      method accessLocker:didUpdateState
      @optional
      - (void)accessLocker:(DJIAccessLocker *)accessLocker didUpdateState:(DJIAccessLockerState)state
      Header:DJIAccessLocker.h
      Description:

      Delegate method to receive the latest state of the Access Locker.

      Input Parameters:
      DJIAccessLocker * accessLockerThe Access Locker that updates the state.
      DJIAccessLockerState stateThe DJIAccessLocker state.
      method accessLocker:didUpdateFormattingState
      @optional
      - (void)accessLocker:(DJIAccessLocker *)accessLocker didUpdateFormattingState:(DJIAccessLockerFormattingState *)state
      Header:DJIAccessLocker.h
      Description:

      Delegate method to receive the latest formatting state.

      Input Parameters:
      DJIAccessLocker * accessLockerThe Access Locker that updates the state.
      DJIAccessLockerFormattingState * stateThe DJIAccessLocker formatting state.
      enum DJIAccessLockerState
      typedef NS_ENUM(uint8_t, DJIAccessLockerState)
      Header:DJIAccessLockerBaseTypes.h
      Description:

      The aircraft's access locker state.

      Enum Members:
      DJIAccessLockerStateNotInitializedThe access locker is not initialized. Set up user account to initialize the system.
      DJIAccessLockerStateLockedThe aircraft is locked and protected. In this state, the internal storage cannot be accessed, the aircraft will stop streaming the live view and the aircraft cannot take off. Use the Security Code to unlock the aircraft.
      DJIAccessLockerStateUnlockedThe aircraft is unlocked.
      DJIAccessLockerStateUnknownEither the aircraft is disconnected or the connected product does not support the access locker.
      enum DJIAccessLockerFormattingProgressState
      typedef NS_ENUM(uint8_t, DJIAccessLockerFormattingProgressState)
      Header:DJIAccessLockerBaseTypes.h
      Description:

      The aircraft's access locker formatting progress state.

      Enum Members:
      DJIAccessLockerFormattingProgressStateInitialNo formatting operation is executing or executed in this aircraft's power cycle.
      DJIAccessLockerFormattingProgressStateFormattingThe aircraft's data is being formatted.
      DJIAccessLockerFormattingProgressStateSuccessfulThe aircraft has formatted data in the internal storage and the user account set up for the security feature.
      DJIAccessLockerFormattingProgressStateFailureThe formatting operation is failed. Check DJIAccessLockerFormattingState for detail.