DJI Mobile SDK Documentation

      class FlightHubManager

      class FlightHubManager implements DJIParamAccessListener
      Package:dji.sdk.flighthub
      Description:

      The FlightHubManager class provides methods to interact with DJI FlightHub (https://www.dji.com/flighthub). SDK provides interfaces to upload the states of the connected aircraft to the FlightHub server and download the flight data from the server. To access DJI FlightHub features through SDK, the logged-in user should be already activated with a valid FlightHub license. Use isUserActivated to check if the user is activated. Note: Invoke updateActivationState before using any other method to verify your accessibility.

      Class Members:
      method getFlightDataUploadInterval
      int getFlightDataUploadInterval()
      Package:dji.sdk.flighthub
      Description:

      Current interval for uploading real-time flight data.

      Return:
      intAn int value of the interval.
      method getUploadState
      UploadState getUploadState()
      Package:dji.sdk.flighthub
      Description:

      Gets current upload state.

      Return:
      UploadStateUpload state.
      method isUserActivated
      boolean isUserActivated()
      Package:dji.sdk.flighthub
      Description:

      Determines if the user has been activated. It is a cached data and it will be refreshed when updateActivationState is called.

      Return:
      booleantrue if updateActivationState is invoked at least once. false if updateActivationState is never invoked.
      method setFlightDataUploadInterval
      DJIFlightHubError setFlightDataUploadInterval(@IntRange(from = 1, to = 10) int interval)
      Package:dji.sdk.flighthub
      Description:

      Sets the interval for uploading real-time flight data. By default, the interval is 5 seconds.

      Input Parameters:
      @IntRange(from = 1, to = 10) int intervalInterval in seconds. The value should be in the range [1, 10].
      Return:
      DJIFlightHubErrorError if the input is invalid.
      method setUploadFlightDataEnabled
      void setUploadFlightDataEnabled(boolean enabled) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Set true to enable SDK to upload real-time flight data of the connected aircraft to DJI FlightHub server. When it is enabled, SDK will start uploading flight data automatically when the aircraft is flying. FlightHub user can access the uploaded flight data on the FlightHub online system. Stop uploading data by setting false as parameter. Use getUploadState to check current uploading state.

      Input Parameters:
      boolean enabledInterval in seconds. The value should be in the range [1, 10].
      method updateActivationState
      void updateActivationState(CompletionCallback callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Updates the logged-in user's activation state for DJI FlightHub. This method is only valid when the user is logged in. When the state is updated, the state will be cached to isUserActivated. Please invoke the authorizeAccessToDJIDeviceHardwareInfo to authorize DJI server to access DJI device's hardware information.

      Input Parameters:
      CompletionCallback callbackThe execution callback with the returned execution result.
      method getTeamsInformation
      void getTeamsInformation(final CommonCallbacks.CompletionCallbackWith<List<Team>> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets the teams' information that is visible for the user.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<List<Team>> callbackThe execution callback with the returned a list of Team objects.
      method getHistoricalFlightPath
      void getHistoricalFlightPath(String orderId, final CommonCallbacks.CompletionCallbackWith<List<FlightPathNode>> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets the flight path nodes of a historical flight path with the specific path ID. This information is only visible for the administrator of the group and the captain of the team.

      Input Parameters:
      String orderIdCorresponding order id that the user wants to check with the flight path.
      final CommonCallbacks.CompletionCallbackWith<List<FlightPathNode>> callbackThe execution callback with the returned a list of FlightPathNode objects.
      method getFlightStatistics
      void getFlightStatistics(long startTime, long endTime, @Nullable String account, String teamId, final
      CommonCallbacks.CompletionCallbackWith<HistoricalFlight> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets flight statistics over a period of time. Specify the account to get the statistics related to one user. Otherwise, statistics for the whole team will be fetched. Only ADMINISTRATOR and CAPTAIN can access the flight statistics.

      Input Parameters:
      long startTimeChosen start time of milliseconds.
      long endTimeChosen end time of milliseconds.
      @Nullable String accountThe account that the user wants to check. Set to be null if whole team flight statistics is expected.
      String teamIdTeam id that the user wants to check.
      final CommonCallbacks.CompletionCallbackWith<HistoricalFlight> callbackThe execution callback with the returned HistoricalFlight objects.
      method bindAircraft
      void bindAircraft(String teamId, final CompletionCallback callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Bind the connected aircraft to DJI FlightHub system. Specify the team ID that the aircraft will belongs to.

      Input Parameters:
      String teamIdTeam ID that current aircraft is expected to bind to.
      final CompletionCallback callbackThe execution callback with the returned execution result.
      method unbindAircraft
      void unbindAircraft(final CompletionCallback callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Unbinds current aircraft from the certain team. Only ADMINISTRATOR and CAPTAIN can do this operation.

      Input Parameters:
      final CompletionCallback callbackThe execution callback with the returned execution result.
      method getLiveViewStreamSource
      void getLiveViewStreamSource(final String sn, final CommonCallbacks.CompletionCallbackWith<LiveStream> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets the live view stream sourcing by the other aircraft to DJI FlightHub. The stream is using RTMP (Real-Time Messaging Protocol). External libraries are required to decode and render the live view. Only ADMINISTRATOR and CAPTAIN can do this operation.

      Input Parameters:
      final String snSerial number of the aircraft sourcing the live view stream.
      final CommonCallbacks.CompletionCallbackWith<LiveStream> callbackThe execution callback with the returned LiveStream objects.
      method getLiveViewStreamDestination
      void getLiveViewStreamDestination(final CommonCallbacks.CompletionCallbackWith<UpStream> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets RTMP (Real-Time Messaging Protocol) url that the connected aircraft should stream to.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<UpStream> callbackThe execution callback with the returned UpStream objects.
      method isLiveStreamStable
      void isLiveStreamStable(final CommonCallbacks.CompletionCallbackWith<Boolean> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Determines whether the live stream is stable from the server perspective.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<Boolean> callbackThe execution callback with the returned boolean result representing if the stream is healthy or not.
      method getStreamingDevices
      void getStreamingDevices(final CommonCallbacks.CompletionCallbackWith<List<OnlineDevice>> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets the list of devices streaming live video to DJI FlightHubManager.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<List<OnlineDevice>> callbackThe execution callback with the returned a list of OnlineDevice objects.
      method getOnlineDevices
      void getOnlineDevices(final CommonCallbacks.CompletionCallbackWith<List<OnlineDevice>> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets the list of online devices visiable in DJI FlightHub.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<List<OnlineDevice>> callbackThe execution callback with the returned a list of OnlineDevice objects.
      method getAircraftRealTimeFlightData
      void getAircraftRealTimeFlightData(List<String> sns, final CommonCallbacks.CompletionCallbackWith<List<RealTimeFlightData>> callback) throws Exception
      Package:dji.sdk.flighthub
      Description:

      Gets real time flight data of the given aircraft(s).

      Input Parameters:
      List<String> snsSerial numbers of aircraft expected.
      final CommonCallbacks.CompletionCallbackWith<List<RealTimeFlightData>> callbackThe execution callback with the returned a list of RealTimeFlightData objects.
      method addUpdatedUploadStateCallback
      void addUpdatedUploadStateCallback(UpdatedUploadStateCallback callback)
      Package:dji.sdk.flighthub
      Description:

      Add upload state callback.

      Input Parameters:
      UpdatedUploadStateCallback callbackThe UpdatedUploadStateCallback object to receive upload state.
      method removeUpdatedUploadStateCallback
      void removeUpdatedUploadStateCallback(UpdatedUploadStateCallback callback)
      Package:dji.sdk.flighthub
      Description:

      Remove upload state callback.

      Input Parameters:
      UpdatedUploadStateCallback callbackThe UpdatedUploadStateCallback object to receive upload state.
      enum UploadState
      enum UploadState
      Package:dji.sdk.flighthub
      Description:

      The uploading state of the flight data for DJI FlightHub system.

      Enum Members:
      DISABLEDThe uploading process is disabled.
      NETWORK_NOT_REACHABLEThe uploading process is enabled but it is not started because the network is not reachable.
      NOT_LOGGED_INThe uploading process is enabled but it is not started because no account is logged in.
      AIRCRAFT_DISCONNECTEDThe uploading process is enabled but it is not started because the aircraft is disconnected.
      REJECTED_BY_SERVERThe uploading process is enabled but the uploading request is rejected by the server.
      READY_TO_UPLOADThe uploading process is enabled and it will start when the aircraft takes off.
      UPLOADINGSDK is uploading flight data to DJI FlightHub system.
      UNKNOWNUnknown.
      Class Members:
      enum
      enum Role
      enum Role
      Package:dji.sdk.flighthub
      Description:

      Different roles of members in a FlightHub group. Different roles will have different permissions to access data in the sytem.

      Enum Members:
      ADMINISTRATORThe administrator is the leader of a group (a group consists of several teams). This role will appear in the member list of all the teams and this role can access all the data of the group.
      CAPTAINA captain is the leader of a team. ADMINISTRATOR can define a captain for a team in the group but it is not compulsory for a team to have a captain. The captain can access the data of the team.
      PILOTA pilot is a member in the team without special permissions.
      UNKNOWNUnknown.
      Class Members:
      class
      class
      State Updates
      class