DJI Mobile SDK Documentation

      class AccessLocker

      class AccessLocker
      Package:dji.sdk.flightcontroller
      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

      method setAccessLockerStateCallback
      void setAccessLockerStateCallback(@Nullable AccessLockerState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Set Access Locker state update callback.

      Input Parameters:
      @Nullable AccessLockerState.Callback callbackThe execution callback with the execution result returned.
      method setFormattingStateCallback
      void setFormattingStateCallback(@Nullable FormattingState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Set Formatting state update callback.

      Input Parameters:
      @Nullable FormattingState.Callback callbackThe execution callback with the execution result returned.
      State
      method
      method getState
      AccessLockerState getState()
      Package:dji.sdk.flightcontroller
      Description:

      Gets the latest state of the Access Locker.

      Return:
      AccessLockerStateAn enum value of AccessLockerState.
      Get Version
      method
      method getVersion
      void getVersion(@NonNull CommonCallbacks.CompletionCallbackWith<Integer> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the version of the security feature.

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWith<Integer> callbackThe execution callback with the value returned.
      Get User Name
      method
      method getUserAccount
      void getUserAccount(@NonNull CommonCallbacks.CompletionCallbackWith<String> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Returns the username of the current Access Locker account.

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWith<String> callbackThe execution callback with the value returned.
      Set Up User Account
      method
      method setUpUserAccount
      void setUpUserAccount(@NonNull UserAccountInfo userAccountInfo,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      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 NOT_INITIALIZED. If the method executes successfully, the state will change to UNLOCKED.

      Input Parameters:
      @NonNull UserAccountInfo userAccountInfoThe user account information used for setting up the access protection of the aircraft.
      @Nullable CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.
      Login
      method
      method login
      void login(@NonNull UserAccountInfo userAccountInfo,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

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

      Input Parameters:
      @NonNull UserAccountInfo userAccountInfoThe user account information used to unlock the protection.
      @Nullable CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.
      Modify User Account
      method
      method modifyUserAccount
      void modifyUserAccount(@NonNull UserAccountInfo currentUserAccountInfo,
      @NonNull UserAccountInfo newUserAccountInfo,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      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 UNLOCKED or LOCKED. If the user account is modified, the aircraft will be unlocked and the state will change to UNLOCKED.

      Input Parameters:
      @NonNull UserAccountInfo currentUserAccountInfoCurrent user account info to be set to the Access Locker system.
      @NonNull UserAccountInfo newUserAccountInfoNew user account info to be set to the Access Locker system.
      @Nullable CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.
      Reset User Account
      method
      method resetUserAccount
      void resetUserAccount(@NonNull UserAccountInfo userAccountInfo,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      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 UNLOCKED or LOCKED. If the user account is reset, the state will change to NOT_INITIALIZED.

      Input Parameters:
      @NonNull UserAccountInfo userAccountInfoUser account info to be set to the Access Locker system.
      @Nullable CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.
      Format
      method
      method format
      void format(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      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 FormattingState to check the progress of formatting. When formatting is done, the state will change to NOT_INITIALIZED.

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackThe execution callback with the returned execution result.


      enum AccessLockerState
      enum AccessLockerState
      Package:dji.common.flightcontroller.accesslocker
      Description:

      The aircraft's access locker state.

      Enum Members:
      NOT_INITIALIZEDThe access locker is not initialized. Set up user account to initialize the system.
      LOCKEDThe 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.
      UNLOCKEDThe aircraft is unlocked.
      UNKNOWNEither the aircraft is disconnected or the connected product does not support the access locker.
      Class Members:
      State Updates
      class
      enum FormattingProgressState
      enum FormattingProgressState
      Package:dji.common.flightcontroller.accesslocker
      Description:

      The aircraft's access locker formatting progress state.

      Enum Members:
      NONENo formatting operation is executing or executed in this aircraft's power cycle.
      FORMATTINGThe aircraft's data is being formatted.
      SUCCESSFULThe aircraft has formatted data in the internal storage and the user account set up for the security feature.
      FAILUREThe formatting operation is failed. Check FormattingState for detail.
      Class Members: