class RTKNetworkServiceProvider
class RTKNetworkServiceProvider implements RTKNetworkService
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:
method getInstance
synchronized static RTKNetworkServiceProvider getInstance ()
Description:
Accessor for RTKNetworkServiceProvider
object.
Return:
Set Network Service Settings
method
method setCustomNetworkSettings
void setCustomNetworkSettings (@NonNull final NetworkServiceSettings settings)
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).
method getCustomNetworkSettings
NetworkServiceSettings getCustomNetworkSettings ()
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:
Start Network Service
method
method startNetworkService
void startNetworkService (@Nullable final CommonCallbacks.CompletionCallback callback)
Description:
Starts the network service as the reference station. This should be called after setting the network service (setCustomNetworkSettings
).
@Nullable final CommonCallbacks .CompletionCallback callback The completion block that receives the result.
Start Network Service With Param
method
method startNetworkService
void startNetworkService (CoordinateSystem coordinateSystem, @Nullable final CommonCallbacks.CompletionCallback callback)
Description:
Starts the network service as the reference station. This should be called after setting the network service (setCustomNetworkSettings
).
CoordinateSystem coordinateSystem The coordinateSystem to set when init rtk service @Nullable final CommonCallbacks .CompletionCallback callback The completion block that receives the result.
Stop Network Service
method
method stopNetworkService
void stopNetworkService (@NonNull final CommonCallbacks.CompletionCallback callback)
Description:
Stops the network service.
@NonNull final CommonCallbacks .CompletionCallback callback The completion block that receives the result.
Add Network Service State Listener
method
method addNetworkServiceStateCallback
void addNetworkServiceStateCallback (@NonNull final NetworkServiceState.Callback callback)
Description:
Adds a listener to receive the latest network service state.
@NonNull final NetworkServiceState .Callback callback The completion block that receives the result.
Remove Network Service State Listener
method
method removeNetworkServiceStateCallback
void removeNetworkServiceStateCallback (@NonNull final NetworkServiceState.Callback callback)
Description:
Removes a listener that is added by passing to addNetworkServiceStateCallback
.
@NonNull final NetworkServiceState .Callback callback The completion block that receives the result.
Set Coordinate System
method
method setNetworkServiceCoordinateSystem
void setNetworkServiceCoordinateSystem (CoordinateSystem coordinateSystem, @NonNull final CommonCallbacks.CompletionCallback callback)
Description:
Sets coordinate system for rtk network service. Only can be used when current ReferenceStationSource
is NETWORK_RTK
, and please make sure the getChannelState
is TRANSMITTING
.
CoordinateSystem coordinateSystem The DJIRTK_DJIRTKNetworkServiceCoordinateSystem
to set. @NonNull final CommonCallbacks .CompletionCallback callback The completion block that receives the result.
Get Coordinate System
method
method getNetworkServiceCoordinateSystem
void getNetworkServiceCoordinateSystem (@NonNull final CommonCallbacks.CompletionCallbackWith<CoordinateSystem> callback)
Description:
Gets current network RTK coordinate system. Only can be used when current ReferenceStationSource
is NETWORK_RTK
.
Activate Network Service
method
method activateNetworkService
@Override void activateNetworkService (NetworkServicePlanType planType, @NonNull final CommonCallbacks.CompletionCallback callback)
Description:
Activates network RTK activateNetworkService
.
method getNetworkServiceOrderPlans
@Override void getNetworkServiceOrderPlans (@NonNull final CommonCallbacks.CompletionCallbackWith<NetworkServicePlansState> callback)
Description:
Gets network service plans.
enum NetworkServiceChannelState
enum NetworkServiceChannelState
Package: dji.common.flightcontroller.rtk
Description:
All the possible state of NetworkServiceChannelState
.
Enum Members:
DISABLEDThe network service is not started. ACCOUNT_EXPIREDUser account has expired. NETWORK_NOT_REACHABLEThe network is not reachable from the mobile device. AIRCRAFT_DISCONNECTEDThe aircraft is not connected. RTK_DONGLE_DISCONNECTEDTThe RTK Dongle is not connected. LOGIN_FAILURESDK cannot login with the provided username and password. Check getError
. TRANSMITTINGData is transmitting through the channel. DISCONNECTEDThe channel is disconnected and the server is not reachable now. Check getError
. ACCOUNT_ERRORUser account error. Check getError
. SERVER_NOT_REACHABLEUnable to connect to server. CONNECTINGConnecting to server. SERVICE_SUSPENSIONThe account for network RTK plan A has been expired, please activate plan B. INVALID_REQUESTThe invalid request is rejected by the server. UNKNOWNUnknown.
Class Members: