DJI Mobile SDK Documentation

      class DJIRTKNetworkServiceProvider

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

      This class is used to control the RTK network service. The DJIRTKNetworkServiceProvider can initiate the communication to a third-party RTK network server. The information from the server can be streamed to the RTK airsystem. SDK will not cache the settings to the disk. The provider should be configured in each life cycle of SDK. The life cycle of the network service provider is independent from the aircraft. Therefore, it can be configured before connecting to DJI aircrafts. It is only supported by Phantom 4 RTK, P4 Multispectral, Mavic 2 Enterprse Advanced, Matrice 210 RTK V2 and Matrice 300 RTK.

      Class Members:
      Set Network Service Settings
      method
      method setNetworkServiceSettings
      - (void)setNetworkServiceSettings:(DJIRTKNetworkServiceSettings *)settings
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Sets the configuration for the network service that provides network reference stations. The network service should use NTRIP (Networked Transport of RTCM via Internet Protocol).

      Input Parameters:
      DJIRTKNetworkServiceSettings * settingsThe configuration to set.
      method networkServiceSettings
      - (DJIRTKNetworkServiceSettings *_Nullable)networkServiceSettings
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Gets the configuration for the network service that provides network reference stations. The network service should use NTRIP(Networked Transport of RTCM via Internet Protocol).

      Return:
      DJIRTKNetworkServiceSettings *_NullableAn instance of DJIRTKNetworkServiceSettings.
      Start Network Service
      method
      method startNetworkServiceWithCompletion
      - (void)startNetworkServiceWithCompletion:(DJICompletionBlock)completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Starts the network service as the reference station. This should be called after setting the network service (setNetworkServiceSettings).

      Input Parameters:
      DJICompletionBlock completionThe completion block that receives the result.
      Start Network Service With Param
      method
      method startNetworkServiceWithCoordinateSystem:WithCompletion
      - (void)startNetworkServiceWithCoordinateSystem:(DJIRTKNetworkServiceCoordinateSystem)coordinateSystem WithCompletion:(DJICompletionBlock)completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Starts the network service as the reference station. This should be called after setting the network service (setNetworkServiceSettings).

      Input Parameters:
      DJIRTKNetworkServiceCoordinateSystem coordinateSystemThe coordinateSystem to set when init rtk service
      DJICompletionBlock completionThe completion block that receives the result.
      Stop Network Service
      method
      method stopNetworkServiceWithCompletion
      - (void)stopNetworkServiceWithCompletion:(DJICompletionBlock)completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Stops the network service.

      Input Parameters:
      DJICompletionBlock completionThe completion block that receives the result.
      Current State
      property
      property currentState
      @property (nonatomic, readonly) DJIRTKNetworkServiceState *currentState
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      The current network service state.

      See Also:

      DJIRTKNetworkServiceState

      Add Network Service State Listener
      method
      method addNetworkServiceStateListener:queue:block
      - (void)addNetworkServiceStateListener:(id)listener
      queue:(nullable dispatch_queue_t)queue
      block:(DJIRTKNetworkServiceStateBlock)block
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Adds a listener to receive the latest network service state.

      Input Parameters:
      id listenerListener to receive network service state. It is used to distinguish different listener and the listener will be retained.
      nullable dispatch_queue_t queueThe dispatch queue to process state. The main queue is used if it is nil.
      DJIRTKNetworkServiceStateBlock blockThe block that process the latest state.
      Remove Network Service State Listener
      method
      method removeNetworkServiceStateListener
      - (void)removeNetworkServiceStateListener:(id)listener
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Removes a listener that is added by passing to addNetworkServiceStateListener:queue:block.

      Input Parameters:
      id listenerThe listener to remove.
      Current Coordinate System
      method
      method currentNetworkServiceCoordinateSystem
      - (DJIRTKNetworkServiceCoordinateSystem)currentNetworkServiceCoordinateSystem
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Gets current network RTK coordinate system.

      Return:
      DJIRTKNetworkServiceCoordinateSystemCurrent DJIRTKNetworkServiceCoordinateSystem.
      method setNetworkServiceCoordinateSystem:completion
      - (void)setNetworkServiceCoordinateSystem:(DJIRTKNetworkServiceCoordinateSystem)coordinateSystem completion:(DJICompletionBlock)completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Sets coordinate system for rtk network service. Only can be used when current DJIRTKReferenceStationSource is DJIRTKReferenceStationSourceNetworkRTK, and please make sure the channelState is DJIRTKNetworkServiceChannelStateTransmitting.

      Input Parameters:
      DJIRTKNetworkServiceCoordinateSystem coordinateSystemThe DJIRTK_DJIRTKNetworkServiceCoordinateSystem to set.
      DJICompletionBlock completionThe completion block that receives the result.
      Activate Network Service
      method
      method activateNetworkServiceWithPlanType:completion
      - (void)activateNetworkServiceWithPlanType:(DJIRTKNetworkServicePlanType)type completion:(DJICompletionBlock)completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Activates network RTK activateNetworkServiceWithPlanType:completion.

      Input Parameters:
      DJIRTKNetworkServicePlanType typeEnum of DJIRTKNetworkServicePlanType.
      DJICompletionBlock completionThe completion block that receives the result.
      method getNetworkServiceOrderPlansWithCompletion
      - (void)getNetworkServiceOrderPlansWithCompletion:(void(^)(DJIRTKNetworkServicePlansState *_Nullable plans, NSError *_Nullable error))completion
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Gets network service plans.

      Input Parameters:
      DJIRTKNetworkServicePlansState *_Nullable plansThe value of the DJIRTKNetworkServicePlansState.
      NSError *_Nullable errorError retrieving the value.
      void(^)(DJIRTKNetworkServicePlansState *_Nullable plans, NSError *_Nullable error) completionCompletion block to receive the result.
      enum DJIRTKNetworkServiceChannelState
      typedef NS_ENUM(uint8_t, DJIRTKNetworkServiceChannelState)
      Header:DJIRTKServcieBaseTypes.h
      Description:

      All the possible state of DJIRTKNetworkServiceChannelState.

      Enum Members:
      DJIRTKNetworkServiceChannelStateDisabledThe network service is not started.
      DJIRTKNetworkServiceChannelStateNetworkNotReachableThe network is not reachable from the mobile device.
      DJIRTKNetworkServiceChannelStateAircraftDisconnectedThe aircraft is not connected.
      DJIRTKNetworkServiceChannelStateLoginFailureSDK cannot login with the provided username and password. Check error.
      DJIRTKNetworkServiceChannelStateReadyThe channel from the server to the aircraft is built up. It is ready for transmission.
      DJIRTKNetworkServiceChannelStateTransmittingData is transmitting through the channel.
      DJIRTKNetworkServiceChannelStateDisconnectedThe channel is disconnected and the server is not reachable now. Check error.
      DJIRTKNetworkServiceChannelStateAccountErrorUser account error. Check error.
      DJIRTKNetworkServiceChannelStateServerNotReachableUnable to connect to server.
      DJIRTKNetworkServiceChannelStateConnectingConnecting to server.
      DJIRTKNetworkServiceChannelStateServiceSuspensionThe account for network RTK plan A has been expired, please activate plan B.
      DJIRTKNetworkServiceChannelStateInvalidRequestThe invalid request is rejected by the server.
      DJIRTKNetworkServiceChannelStateUnknownUnknown.
      typedef block DJIRTKNetworkServiceStateBlock
      typedef void (^_Nullable DJIRTKNetworkServiceStateBlock) (DJIRTKNetworkServiceState *state)
      Header:DJIRTKNetworkServiceProvider.h
      Description:

      Block that receive the network service state.

      Input Parameters:
      DJIRTKNetworkServiceState * stateThe network service state.