From cb1a4a6ad7434cc913412691a73c747d6e1ce82c Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 22 Jul 2021 18:04:33 +0200 Subject: [PATCH 1/3] Updated proto, mavsdk_server to v0.41.0 --- Package.resolved | 4 +- Package.swift | 2 +- Sources/Mavsdk/Generated/Camera.swift | 8 +- Sources/Mavsdk/Generated/Core.swift | 92 +- Sources/Mavsdk/Generated/FollowMe.swift | 2 +- Sources/Mavsdk/Generated/Ftp.swift | 6 + Sources/Mavsdk/Generated/Geofence.swift | 6 + Sources/Mavsdk/Generated/Gimbal.swift | 6 + Sources/Mavsdk/Generated/Info.swift | 6 + Sources/Mavsdk/Generated/LogFiles.swift | 6 + Sources/Mavsdk/Generated/Mission.swift | 30 +- Sources/Mavsdk/Generated/MissionRaw.swift | 6 + Sources/Mavsdk/Generated/Param.swift | 8 +- Sources/Mavsdk/Generated/ParamServer.swift | 513 ++ Sources/Mavsdk/Generated/Telemetry.swift | 50 +- .../Mavsdk/Generated/TelemetryServer.swift | 2996 +++++++++++ Sources/Mavsdk/Generated/Tune.swift | 6 + Sources/Mavsdk/Generated/camera.pb.swift | 9 +- Sources/Mavsdk/Generated/core.grpc.swift | 60 +- Sources/Mavsdk/Generated/core.pb.swift | 116 +- Sources/Mavsdk/Generated/follow_me.pb.swift | 2 +- Sources/Mavsdk/Generated/ftp.pb.swift | 7 + Sources/Mavsdk/Generated/geofence.pb.swift | 7 + Sources/Mavsdk/Generated/gimbal.pb.swift | 7 + Sources/Mavsdk/Generated/info.pb.swift | 7 + Sources/Mavsdk/Generated/log_files.pb.swift | 7 + Sources/Mavsdk/Generated/mission.pb.swift | 25 + Sources/Mavsdk/Generated/mission_raw.pb.swift | 7 + Sources/Mavsdk/Generated/param.pb.swift | 9 +- .../Mavsdk/Generated/param_server.grpc.swift | 327 ++ .../Mavsdk/Generated/param_server.pb.swift | 832 +++ Sources/Mavsdk/Generated/telemetry.pb.swift | 40 +- .../Generated/telemetry_server.grpc.swift | 767 +++ .../Generated/telemetry_server.pb.swift | 4578 +++++++++++++++++ Sources/Mavsdk/Generated/tune.pb.swift | 7 + Sources/Mavsdk/proto | 2 +- 36 files changed, 10335 insertions(+), 228 deletions(-) create mode 100644 Sources/Mavsdk/Generated/ParamServer.swift create mode 100644 Sources/Mavsdk/Generated/TelemetryServer.swift create mode 100644 Sources/Mavsdk/Generated/param_server.grpc.swift create mode 100644 Sources/Mavsdk/Generated/param_server.pb.swift create mode 100644 Sources/Mavsdk/Generated/telemetry_server.grpc.swift create mode 100644 Sources/Mavsdk/Generated/telemetry_server.pb.swift diff --git a/Package.resolved b/Package.resolved index f0c47ad..9a368c3 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/mavlink/MAVSDK-XCFramework", "state": { "branch": null, - "revision": "8c5fb3a00cac10cb777c146f70cd827328c593fe", - "version": "0.40.0" + "revision": "aa39ed49fd0832c4a8169cab6a037037ad9b5cf6", + "version": "0.41.0" } }, { diff --git a/Package.swift b/Package.swift index c2e4c3f..72c1dd8 100644 --- a/Package.swift +++ b/Package.swift @@ -23,7 +23,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/grpc/grpc-swift", from: "1.0.0"), .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0"), - .package(url: "https://github.com/mavlink/MAVSDK-XCFramework", .exact("0.40.0")) + .package(url: "https://github.com/mavlink/MAVSDK-XCFramework", .exact("0.41.0")) ], targets: [ .target(name: "Mavsdk", diff --git a/Sources/Mavsdk/Generated/Camera.swift b/Sources/Mavsdk/Generated/Camera.swift index 9b17948..49582d8 100644 --- a/Sources/Mavsdk/Generated/Camera.swift +++ b/Sources/Mavsdk/Generated/Camera.swift @@ -155,12 +155,14 @@ public class Camera { case busy /// Camera denied the command. case denied - /// An error has occured while executing the command. + /// An error has occurred while executing the command. case error /// Command timed out. case timeout /// Command has wrong argument(s). case wrongArgument + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Camera_CameraResult.Result { @@ -181,6 +183,8 @@ public class Camera { return .timeout case .wrongArgument: return .wrongArgument + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -204,6 +208,8 @@ public class Camera { return .timeout case .wrongArgument: return .wrongArgument + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Core.swift b/Sources/Mavsdk/Generated/Core.swift index 0bb8a93..8893907 100644 --- a/Sources/Mavsdk/Generated/Core.swift +++ b/Sources/Mavsdk/Generated/Core.swift @@ -4,7 +4,7 @@ import GRPC import NIO /** - Access to the connection state and running plugins. + Access to the connection state and core configurations */ public class Core { private let service: Mavsdk_Rpc_Core_CoreServiceClient @@ -87,68 +87,6 @@ public class Core { } } - /** - Plugin info type. - */ - public struct PluginInfo: Equatable { - public let name: String - public let address: String - public let port: Int32 - - - - /** - Initializes a new `PluginInfo`. - - - - Parameters: - - - name: Name of the plugin - - - address: Address where the plugin is running - - - port: Port where the plugin is running - - - */ - public init(name: String, address: String, port: Int32) { - self.name = name - self.address = address - self.port = port - } - - internal var rpcPluginInfo: Mavsdk_Rpc_Core_PluginInfo { - var rpcPluginInfo = Mavsdk_Rpc_Core_PluginInfo() - - - rpcPluginInfo.name = name - - - - - rpcPluginInfo.address = address - - - - - rpcPluginInfo.port = port - - - - return rpcPluginInfo - } - - internal static func translateFromRpc(_ rpcPluginInfo: Mavsdk_Rpc_Core_PluginInfo) -> PluginInfo { - return PluginInfo(name: rpcPluginInfo.name, address: rpcPluginInfo.address, port: rpcPluginInfo.port) - } - - public static func == (lhs: PluginInfo, rhs: PluginInfo) -> Bool { - return lhs.name == rhs.name - && lhs.address == rhs.address - && lhs.port == rhs.port - } - } - /** @@ -187,27 +125,33 @@ public class Core { } /** - Get a list of currently running plugins. + Set timeout of MAVLink transfers. + + The default timeout used is generally (0.5 seconds) seconds. + If MAVSDK is used on the same host this timeout can be reduced, while + if MAVSDK has to communicate over links with high latency it might + need to be increased to prevent timeouts. + - Parameter timeoutS: Timeout in seconds */ - public func listRunningPlugins() -> Single<[PluginInfo]> { - return Single<[PluginInfo]>.create { single in - let request = Mavsdk_Rpc_Core_ListRunningPluginsRequest() + public func setMavlinkTimeout(timeoutS: Double) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest() + + request.timeoutS = timeoutS + + do { - let response = self.service.listRunningPlugins(request) - - - - let pluginInfo = try response.response.wait().pluginInfo.map{ PluginInfo.translateFromRpc($0) } + let _ = try self.service.setMavlinkTimeout(request) + completable(.completed) - single(.success(pluginInfo)) } catch { - single(.error(error)) + completable(.error(error)) } return Disposables.create() diff --git a/Sources/Mavsdk/Generated/FollowMe.swift b/Sources/Mavsdk/Generated/FollowMe.swift index 7cf5d23..7645dbb 100644 --- a/Sources/Mavsdk/Generated/FollowMe.swift +++ b/Sources/Mavsdk/Generated/FollowMe.swift @@ -285,7 +285,7 @@ public class FollowMe { Possible results returned for followme operations */ public enum Result: Equatable { - /// Unkown result. + /// Unknown result. case unknown /// Request succeeded. case success diff --git a/Sources/Mavsdk/Generated/Ftp.swift b/Sources/Mavsdk/Generated/Ftp.swift index 1ab9c89..b74c7d0 100644 --- a/Sources/Mavsdk/Generated/Ftp.swift +++ b/Sources/Mavsdk/Generated/Ftp.swift @@ -143,6 +143,8 @@ public class Ftp { case unsupported /// General protocol error. case protocolError + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Ftp_FtpResult.Result { @@ -171,6 +173,8 @@ public class Ftp { return .unsupported case .protocolError: return .protocolError + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -202,6 +206,8 @@ public class Ftp { return .unsupported case .protocolError: return .protocolError + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Geofence.swift b/Sources/Mavsdk/Generated/Geofence.swift index 0ecc4ad..fd676c1 100644 --- a/Sources/Mavsdk/Generated/Geofence.swift +++ b/Sources/Mavsdk/Generated/Geofence.swift @@ -220,6 +220,8 @@ public class Geofence { case timeout /// Invalid argument. case invalidArgument + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Geofence_GeofenceResult.Result { @@ -238,6 +240,8 @@ public class Geofence { return .timeout case .invalidArgument: return .invalidArgument + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -259,6 +263,8 @@ public class Geofence { return .timeout case .invalidArgument: return .invalidArgument + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Gimbal.swift b/Sources/Mavsdk/Generated/Gimbal.swift index e028c9e..01a5776 100644 --- a/Sources/Mavsdk/Generated/Gimbal.swift +++ b/Sources/Mavsdk/Generated/Gimbal.swift @@ -231,6 +231,8 @@ public class Gimbal { case timeout /// Functionality not supported. case unsupported + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Gimbal_GimbalResult.Result { @@ -245,6 +247,8 @@ public class Gimbal { return .timeout case .unsupported: return .unsupported + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -262,6 +266,8 @@ public class Gimbal { return .timeout case .unsupported: return .unsupported + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Info.swift b/Sources/Mavsdk/Generated/Info.swift index b66937f..9c40dbb 100644 --- a/Sources/Mavsdk/Generated/Info.swift +++ b/Sources/Mavsdk/Generated/Info.swift @@ -391,6 +391,8 @@ public class Info { case success /// Information has not been received yet. case informationNotReceivedYet + /// No system is connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Info_InfoResult.Result { @@ -401,6 +403,8 @@ public class Info { return .success case .informationNotReceivedYet: return .informationNotReceivedYet + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -414,6 +418,8 @@ public class Info { return .success case .informationNotReceivedYet: return .informationNotReceivedYet + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/LogFiles.swift b/Sources/Mavsdk/Generated/LogFiles.swift index 7049ad9..eda7f59 100644 --- a/Sources/Mavsdk/Generated/LogFiles.swift +++ b/Sources/Mavsdk/Generated/LogFiles.swift @@ -183,6 +183,8 @@ public class LogFiles { case invalidArgument /// File open failed. case fileOpenFailed + /// No system is connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_LogFiles_LogFilesResult.Result { @@ -201,6 +203,8 @@ public class LogFiles { return .invalidArgument case .fileOpenFailed: return .fileOpenFailed + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -222,6 +226,8 @@ public class LogFiles { return .invalidArgument case .fileOpenFailed: return .fileOpenFailed + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Mission.swift b/Sources/Mavsdk/Generated/Mission.swift index 9c2e204..b2a88b3 100644 --- a/Sources/Mavsdk/Generated/Mission.swift +++ b/Sources/Mavsdk/Generated/Mission.swift @@ -72,6 +72,8 @@ public class Mission { public let cameraAction: CameraAction public let loiterTimeS: Float public let cameraPhotoIntervalS: Double + public let acceptanceRadiusM: Float + public let yawDeg: Float @@ -160,9 +162,13 @@ public class Mission { - cameraPhotoIntervalS: Camera photo interval to use after this mission item (in seconds) + - acceptanceRadiusM: Radius for completing a mission item (in metres) + + - yawDeg: Absolute yaw angle (in degrees) + */ - public init(latitudeDeg: Double, longitudeDeg: Double, relativeAltitudeM: Float, speedMS: Float, isFlyThrough: Bool, gimbalPitchDeg: Float, gimbalYawDeg: Float, cameraAction: CameraAction, loiterTimeS: Float, cameraPhotoIntervalS: Double) { + public init(latitudeDeg: Double, longitudeDeg: Double, relativeAltitudeM: Float, speedMS: Float, isFlyThrough: Bool, gimbalPitchDeg: Float, gimbalYawDeg: Float, cameraAction: CameraAction, loiterTimeS: Float, cameraPhotoIntervalS: Double, acceptanceRadiusM: Float, yawDeg: Float) { self.latitudeDeg = latitudeDeg self.longitudeDeg = longitudeDeg self.relativeAltitudeM = relativeAltitudeM @@ -173,6 +179,8 @@ public class Mission { self.cameraAction = cameraAction self.loiterTimeS = loiterTimeS self.cameraPhotoIntervalS = cameraPhotoIntervalS + self.acceptanceRadiusM = acceptanceRadiusM + self.yawDeg = yawDeg } internal var rpcMissionItem: Mavsdk_Rpc_Mission_MissionItem { @@ -227,12 +235,22 @@ public class Mission { rpcMissionItem.cameraPhotoIntervalS = cameraPhotoIntervalS + + + rpcMissionItem.acceptanceRadiusM = acceptanceRadiusM + + + + + rpcMissionItem.yawDeg = yawDeg + + return rpcMissionItem } internal static func translateFromRpc(_ rpcMissionItem: Mavsdk_Rpc_Mission_MissionItem) -> MissionItem { - return MissionItem(latitudeDeg: rpcMissionItem.latitudeDeg, longitudeDeg: rpcMissionItem.longitudeDeg, relativeAltitudeM: rpcMissionItem.relativeAltitudeM, speedMS: rpcMissionItem.speedMS, isFlyThrough: rpcMissionItem.isFlyThrough, gimbalPitchDeg: rpcMissionItem.gimbalPitchDeg, gimbalYawDeg: rpcMissionItem.gimbalYawDeg, cameraAction: CameraAction.translateFromRpc(rpcMissionItem.cameraAction), loiterTimeS: rpcMissionItem.loiterTimeS, cameraPhotoIntervalS: rpcMissionItem.cameraPhotoIntervalS) + return MissionItem(latitudeDeg: rpcMissionItem.latitudeDeg, longitudeDeg: rpcMissionItem.longitudeDeg, relativeAltitudeM: rpcMissionItem.relativeAltitudeM, speedMS: rpcMissionItem.speedMS, isFlyThrough: rpcMissionItem.isFlyThrough, gimbalPitchDeg: rpcMissionItem.gimbalPitchDeg, gimbalYawDeg: rpcMissionItem.gimbalYawDeg, cameraAction: CameraAction.translateFromRpc(rpcMissionItem.cameraAction), loiterTimeS: rpcMissionItem.loiterTimeS, cameraPhotoIntervalS: rpcMissionItem.cameraPhotoIntervalS, acceptanceRadiusM: rpcMissionItem.acceptanceRadiusM, yawDeg: rpcMissionItem.yawDeg) } public static func == (lhs: MissionItem, rhs: MissionItem) -> Bool { @@ -246,6 +264,8 @@ public class Mission { && lhs.cameraAction == rhs.cameraAction && lhs.loiterTimeS == rhs.loiterTimeS && lhs.cameraPhotoIntervalS == rhs.cameraPhotoIntervalS + && lhs.acceptanceRadiusM == rhs.acceptanceRadiusM + && lhs.yawDeg == rhs.yawDeg } } @@ -376,6 +396,8 @@ public class Mission { case unsupportedMissionCmd /// Mission transfer (upload or download) has been cancelled. case transferCancelled + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Mission_MissionResult.Result { @@ -402,6 +424,8 @@ public class Mission { return .unsupportedMissionCmd case .transferCancelled: return .transferCancelled + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -431,6 +455,8 @@ public class Mission { return .unsupportedMissionCmd case .transferCancelled: return .transferCancelled + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/MissionRaw.swift b/Sources/Mavsdk/Generated/MissionRaw.swift index a72ee97..85c164d 100644 --- a/Sources/Mavsdk/Generated/MissionRaw.swift +++ b/Sources/Mavsdk/Generated/MissionRaw.swift @@ -367,6 +367,8 @@ public class MissionRaw { case failedToOpenQgcPlan /// Failed to parse the QGroundControl plan. case failedToParseQgcPlan + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_MissionRaw_MissionRawResult.Result { @@ -395,6 +397,8 @@ public class MissionRaw { return .failedToOpenQgcPlan case .failedToParseQgcPlan: return .failedToParseQgcPlan + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -426,6 +430,8 @@ public class MissionRaw { return .failedToOpenQgcPlan case .failedToParseQgcPlan: return .failedToParseQgcPlan + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/Param.swift b/Sources/Mavsdk/Generated/Param.swift index 5947abe..f0be61e 100644 --- a/Sources/Mavsdk/Generated/Param.swift +++ b/Sources/Mavsdk/Generated/Param.swift @@ -106,7 +106,7 @@ public class Param { } /** - Type for float paramters. + Type for float parameters. */ public struct FloatParam: Equatable { public let name: String @@ -235,6 +235,8 @@ public class Param { case wrongType /// Parameter name too long (> 16). case paramNameTooLong + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Param_ParamResult.Result { @@ -251,6 +253,8 @@ public class Param { return .wrongType case .paramNameTooLong: return .paramNameTooLong + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -270,6 +274,8 @@ public class Param { return .wrongType case .paramNameTooLong: return .paramNameTooLong + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/ParamServer.swift b/Sources/Mavsdk/Generated/ParamServer.swift new file mode 100644 index 0000000..1c87f4e --- /dev/null +++ b/Sources/Mavsdk/Generated/ParamServer.swift @@ -0,0 +1,513 @@ +import Foundation +import RxSwift +import GRPC +import NIO + +/** + Provide raw access to retrieve and provide server parameters. + */ +public class ParamServer { + private let service: Mavsdk_Rpc_ParamServer_ParamServerServiceClient + private let scheduler: SchedulerType + private let clientEventLoopGroup: EventLoopGroup + + /** + Initializes a new `ParamServer` plugin. + + Normally never created manually, but used from the `Drone` helper class instead. + + - Parameters: + - address: The address of the `MavsdkServer` instance to connect to + - port: The port of the `MavsdkServer` instance to connect to + - scheduler: The scheduler to be used by `Observable`s + */ + public convenience init(address: String = "localhost", + port: Int32 = 50051, + scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background)) { + let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 2) + let channel = ClientConnection.insecure(group: eventLoopGroup).connect(host: address, port: Int(port)) + let service = Mavsdk_Rpc_ParamServer_ParamServerServiceClient(channel: channel) + + self.init(service: service, scheduler: scheduler, eventLoopGroup: eventLoopGroup) + } + + init(service: Mavsdk_Rpc_ParamServer_ParamServerServiceClient, scheduler: SchedulerType, eventLoopGroup: EventLoopGroup) { + self.service = service + self.scheduler = scheduler + self.clientEventLoopGroup = eventLoopGroup + } + + public struct RuntimeParamServerError: Error { + public let description: String + + init(_ description: String) { + self.description = description + } + } + + + public struct ParamServerError: Error { + public let code: ParamServer.ParamServerResult.Result + public let description: String + } + + + + /** + Type for integer parameters. + */ + public struct IntParam: Equatable { + public let name: String + public let value: Int32 + + + + /** + Initializes a new `IntParam`. + + + - Parameters: + + - name: Name of the parameter + + - value: Value of the parameter + + + */ + public init(name: String, value: Int32) { + self.name = name + self.value = value + } + + internal var rpcIntParam: Mavsdk_Rpc_ParamServer_IntParam { + var rpcIntParam = Mavsdk_Rpc_ParamServer_IntParam() + + + rpcIntParam.name = name + + + + + rpcIntParam.value = value + + + + return rpcIntParam + } + + internal static func translateFromRpc(_ rpcIntParam: Mavsdk_Rpc_ParamServer_IntParam) -> IntParam { + return IntParam(name: rpcIntParam.name, value: rpcIntParam.value) + } + + public static func == (lhs: IntParam, rhs: IntParam) -> Bool { + return lhs.name == rhs.name + && lhs.value == rhs.value + } + } + + /** + Type for float parameters. + */ + public struct FloatParam: Equatable { + public let name: String + public let value: Float + + + + /** + Initializes a new `FloatParam`. + + + - Parameters: + + - name: Name of the parameter + + - value: Value of the parameter + + + */ + public init(name: String, value: Float) { + self.name = name + self.value = value + } + + internal var rpcFloatParam: Mavsdk_Rpc_ParamServer_FloatParam { + var rpcFloatParam = Mavsdk_Rpc_ParamServer_FloatParam() + + + rpcFloatParam.name = name + + + + + rpcFloatParam.value = value + + + + return rpcFloatParam + } + + internal static func translateFromRpc(_ rpcFloatParam: Mavsdk_Rpc_ParamServer_FloatParam) -> FloatParam { + return FloatParam(name: rpcFloatParam.name, value: rpcFloatParam.value) + } + + public static func == (lhs: FloatParam, rhs: FloatParam) -> Bool { + return lhs.name == rhs.name + && lhs.value == rhs.value + } + } + + /** + Type collecting all integer and float parameters. + */ + public struct AllParams: Equatable { + public let intParams: [IntParam] + public let floatParams: [FloatParam] + + + + /** + Initializes a new `AllParams`. + + + - Parameters: + + - intParams: Collection of all parameter names and values of type int + + - floatParams: Collection of all parameter names and values of type float + + + */ + public init(intParams: [IntParam], floatParams: [FloatParam]) { + self.intParams = intParams + self.floatParams = floatParams + } + + internal var rpcAllParams: Mavsdk_Rpc_ParamServer_AllParams { + var rpcAllParams = Mavsdk_Rpc_ParamServer_AllParams() + + + rpcAllParams.intParams = intParams.map{ $0.rpcIntParam } + + + + + rpcAllParams.floatParams = floatParams.map{ $0.rpcFloatParam } + + + + return rpcAllParams + } + + internal static func translateFromRpc(_ rpcAllParams: Mavsdk_Rpc_ParamServer_AllParams) -> AllParams { + return AllParams(intParams: rpcAllParams.intParams.map{ IntParam.translateFromRpc($0) }, floatParams: rpcAllParams.floatParams.map{ FloatParam.translateFromRpc($0) }) + } + + public static func == (lhs: AllParams, rhs: AllParams) -> Bool { + return lhs.intParams == rhs.intParams + && lhs.floatParams == rhs.floatParams + } + } + + /** + Result type. + */ + public struct ParamServerResult: Equatable { + public let result: Result + public let resultStr: String + + + + + /** + Possible results returned for param requests. + */ + public enum Result: Equatable { + /// Unknown result. + case unknown + /// Request succeeded. + case success + /// Not Found. + case notFound + /// Wrong type. + case wrongType + /// Parameter name too long (> 16). + case paramNameTooLong + case UNRECOGNIZED(Int) + + internal var rpcResult: Mavsdk_Rpc_ParamServer_ParamServerResult.Result { + switch self { + case .unknown: + return .unknown + case .success: + return .success + case .notFound: + return .notFound + case .wrongType: + return .wrongType + case .paramNameTooLong: + return .paramNameTooLong + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcResult: Mavsdk_Rpc_ParamServer_ParamServerResult.Result) -> Result { + switch rpcResult { + case .unknown: + return .unknown + case .success: + return .success + case .notFound: + return .notFound + case .wrongType: + return .wrongType + case .paramNameTooLong: + return .paramNameTooLong + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + + /** + Initializes a new `ParamServerResult`. + + + - Parameters: + + - result: Result enum value + + - resultStr: Human-readable English string describing the result + + + */ + public init(result: Result, resultStr: String) { + self.result = result + self.resultStr = resultStr + } + + internal var rpcParamServerResult: Mavsdk_Rpc_ParamServer_ParamServerResult { + var rpcParamServerResult = Mavsdk_Rpc_ParamServer_ParamServerResult() + + + rpcParamServerResult.result = result.rpcResult + + + + + rpcParamServerResult.resultStr = resultStr + + + + return rpcParamServerResult + } + + internal static func translateFromRpc(_ rpcParamServerResult: Mavsdk_Rpc_ParamServer_ParamServerResult) -> ParamServerResult { + return ParamServerResult(result: Result.translateFromRpc(rpcParamServerResult.result), resultStr: rpcParamServerResult.resultStr) + } + + public static func == (lhs: ParamServerResult, rhs: ParamServerResult) -> Bool { + return lhs.result == rhs.result + && lhs.resultStr == rhs.resultStr + } + } + + + /** + Retrieve an int parameter. + + If the type is wrong, the result will be `WRONG_TYPE`. + + - Parameter name: Name of the parameter + + */ + public func retrieveParamInt(name: String) -> Single { + return Single.create { single in + var request = Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest() + + + + request.name = name + + + + do { + let response = self.service.retrieveParamInt(request) + + + let result = try response.response.wait().paramServerResult + if (result.result != Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { + single(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + + return Disposables.create() + } + + + let value = try response.response.wait().value + + single(.success(value)) + } catch { + single(.error(error)) + } + + return Disposables.create() + } + } + + /** + Provide an int parameter. + + If the type is wrong, the result will be `WRONG_TYPE`. + + - Parameters: + - name: Name of the parameter to provide + - value: Value the parameter should be set to + + */ + public func provideParamInt(name: String, value: Int32) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_ParamServer_ProvideParamIntRequest() + + + + request.name = name + + + + request.value = value + + + + do { + + let response = self.service.provideParamInt(request) + + let result = try response.response.wait().paramServerResult + if (result.result == Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Retrieve a float parameter. + + If the type is wrong, the result will be `WRONG_TYPE`. + + - Parameter name: Name of the parameter + + */ + public func retrieveParamFloat(name: String) -> Single { + return Single.create { single in + var request = Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest() + + + + request.name = name + + + + do { + let response = self.service.retrieveParamFloat(request) + + + let result = try response.response.wait().paramServerResult + if (result.result != Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { + single(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + + return Disposables.create() + } + + + let value = try response.response.wait().value + + single(.success(value)) + } catch { + single(.error(error)) + } + + return Disposables.create() + } + } + + /** + Provide a float parameter. + + If the type is wrong, the result will be `WRONG_TYPE`. + + - Parameters: + - name: Name of the parameter to provide + - value: Value the parameter should be set to + + */ + public func provideParamFloat(name: String, value: Float) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest() + + + + request.name = name + + + + request.value = value + + + + do { + + let response = self.service.provideParamFloat(request) + + let result = try response.response.wait().paramServerResult + if (result.result == Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Retrieve all parameters. + + + */ + public func retrieveAllParams() -> Single { + return Single.create { single in + let request = Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest() + + + + do { + let response = self.service.retrieveAllParams(request) + + + + + let params = try AllParams.translateFromRpc(response.response.wait().params) + + single(.success(params)) + } catch { + single(.error(error)) + } + + return Disposables.create() + } + } +} \ No newline at end of file diff --git a/Sources/Mavsdk/Generated/Telemetry.swift b/Sources/Mavsdk/Generated/Telemetry.swift index 02942aa..ac86414 100644 --- a/Sources/Mavsdk/Generated/Telemetry.swift +++ b/Sources/Mavsdk/Generated/Telemetry.swift @@ -882,6 +882,7 @@ public class Telemetry { Battery type. */ public struct Battery: Equatable { + public let id: UInt32 public let voltageV: Float public let remainingPercent: Float @@ -893,13 +894,16 @@ public class Telemetry { - Parameters: + - id: Battery ID, for systems with multiple batteries + - voltageV: Voltage in volts - remainingPercent: Estimated battery remaining (range: 0.0 to 1.0) */ - public init(voltageV: Float, remainingPercent: Float) { + public init(id: UInt32, voltageV: Float, remainingPercent: Float) { + self.id = id self.voltageV = voltageV self.remainingPercent = remainingPercent } @@ -908,6 +912,11 @@ public class Telemetry { var rpcBattery = Mavsdk_Rpc_Telemetry_Battery() + rpcBattery.id = id + + + + rpcBattery.voltageV = voltageV @@ -921,11 +930,12 @@ public class Telemetry { } internal static func translateFromRpc(_ rpcBattery: Mavsdk_Rpc_Telemetry_Battery) -> Battery { - return Battery(voltageV: rpcBattery.voltageV, remainingPercent: rpcBattery.remainingPercent) + return Battery(id: rpcBattery.id, voltageV: rpcBattery.voltageV, remainingPercent: rpcBattery.remainingPercent) } public static func == (lhs: Battery, rhs: Battery) -> Bool { - return lhs.voltageV == rhs.voltageV + return lhs.id == rhs.id + && lhs.voltageV == rhs.voltageV && lhs.remainingPercent == rhs.remainingPercent } } @@ -937,10 +947,10 @@ public class Telemetry { public let isGyrometerCalibrationOk: Bool public let isAccelerometerCalibrationOk: Bool public let isMagnetometerCalibrationOk: Bool - public let isLevelCalibrationOk: Bool public let isLocalPositionOk: Bool public let isGlobalPositionOk: Bool public let isHomePositionOk: Bool + public let isArmable: Bool @@ -956,24 +966,24 @@ public class Telemetry { - isMagnetometerCalibrationOk: True if the magnetometer is calibrated - - isLevelCalibrationOk: True if the vehicle has a valid level calibration - - isLocalPositionOk: True if the local position estimate is good enough to fly in 'position control' mode - isGlobalPositionOk: True if the global position estimate is good enough to fly in 'position control' mode - isHomePositionOk: True if the home position has been initialized properly + - isArmable: True if system can be armed + */ - public init(isGyrometerCalibrationOk: Bool, isAccelerometerCalibrationOk: Bool, isMagnetometerCalibrationOk: Bool, isLevelCalibrationOk: Bool, isLocalPositionOk: Bool, isGlobalPositionOk: Bool, isHomePositionOk: Bool) { + public init(isGyrometerCalibrationOk: Bool, isAccelerometerCalibrationOk: Bool, isMagnetometerCalibrationOk: Bool, isLocalPositionOk: Bool, isGlobalPositionOk: Bool, isHomePositionOk: Bool, isArmable: Bool) { self.isGyrometerCalibrationOk = isGyrometerCalibrationOk self.isAccelerometerCalibrationOk = isAccelerometerCalibrationOk self.isMagnetometerCalibrationOk = isMagnetometerCalibrationOk - self.isLevelCalibrationOk = isLevelCalibrationOk self.isLocalPositionOk = isLocalPositionOk self.isGlobalPositionOk = isGlobalPositionOk self.isHomePositionOk = isHomePositionOk + self.isArmable = isArmable } internal var rpcHealth: Mavsdk_Rpc_Telemetry_Health { @@ -995,22 +1005,22 @@ public class Telemetry { - rpcHealth.isLevelCalibrationOk = isLevelCalibrationOk + rpcHealth.isLocalPositionOk = isLocalPositionOk - rpcHealth.isLocalPositionOk = isLocalPositionOk + rpcHealth.isGlobalPositionOk = isGlobalPositionOk - rpcHealth.isGlobalPositionOk = isGlobalPositionOk + rpcHealth.isHomePositionOk = isHomePositionOk - rpcHealth.isHomePositionOk = isHomePositionOk + rpcHealth.isArmable = isArmable @@ -1018,17 +1028,17 @@ public class Telemetry { } internal static func translateFromRpc(_ rpcHealth: Mavsdk_Rpc_Telemetry_Health) -> Health { - return Health(isGyrometerCalibrationOk: rpcHealth.isGyrometerCalibrationOk, isAccelerometerCalibrationOk: rpcHealth.isAccelerometerCalibrationOk, isMagnetometerCalibrationOk: rpcHealth.isMagnetometerCalibrationOk, isLevelCalibrationOk: rpcHealth.isLevelCalibrationOk, isLocalPositionOk: rpcHealth.isLocalPositionOk, isGlobalPositionOk: rpcHealth.isGlobalPositionOk, isHomePositionOk: rpcHealth.isHomePositionOk) + return Health(isGyrometerCalibrationOk: rpcHealth.isGyrometerCalibrationOk, isAccelerometerCalibrationOk: rpcHealth.isAccelerometerCalibrationOk, isMagnetometerCalibrationOk: rpcHealth.isMagnetometerCalibrationOk, isLocalPositionOk: rpcHealth.isLocalPositionOk, isGlobalPositionOk: rpcHealth.isGlobalPositionOk, isHomePositionOk: rpcHealth.isHomePositionOk, isArmable: rpcHealth.isArmable) } public static func == (lhs: Health, rhs: Health) -> Bool { return lhs.isGyrometerCalibrationOk == rhs.isGyrometerCalibrationOk && lhs.isAccelerometerCalibrationOk == rhs.isAccelerometerCalibrationOk && lhs.isMagnetometerCalibrationOk == rhs.isMagnetometerCalibrationOk - && lhs.isLevelCalibrationOk == rhs.isLevelCalibrationOk && lhs.isLocalPositionOk == rhs.isLocalPositionOk && lhs.isGlobalPositionOk == rhs.isGlobalPositionOk && lhs.isHomePositionOk == rhs.isHomePositionOk + && lhs.isArmable == rhs.isArmable } } @@ -1052,7 +1062,7 @@ public class Telemetry { - isAvailable: True if the RC signal is available now - - signalStrengthPercent: Signal strength (range: 0 to 100) + - signalStrengthPercent: Signal strength (range: 0 to 100, NaN if unknown) */ @@ -1672,9 +1682,9 @@ public class Telemetry { - differentialPressureHpa: Differential pressure 1 in hPa - - temperatureDeg: Absolute pressure temperature (in celcius) + - temperatureDeg: Absolute pressure temperature (in celsius) - - differentialPressureTemperatureDeg: Differential pressure temperature (in celcius, 0 if not available) + - differentialPressureTemperatureDeg: Differential pressure temperature (in celsius, 0 if not available) */ @@ -2388,6 +2398,8 @@ public class Telemetry { case commandDenied /// Request timed out. case timeout + /// Request not supported. + case unsupported case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Telemetry_TelemetryResult.Result { @@ -2406,6 +2418,8 @@ public class Telemetry { return .commandDenied case .timeout: return .timeout + case .unsupported: + return .unsupported case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -2427,6 +2441,8 @@ public class Telemetry { return .commandDenied case .timeout: return .timeout + case .unsupported: + return .unsupported case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/TelemetryServer.swift b/Sources/Mavsdk/Generated/TelemetryServer.swift new file mode 100644 index 0000000..be2f1c5 --- /dev/null +++ b/Sources/Mavsdk/Generated/TelemetryServer.swift @@ -0,0 +1,2996 @@ +import Foundation +import RxSwift +import GRPC +import NIO + +/** + Allow users to provide vehicle telemetry and state information + (e.g. battery, GPS, RC connection, flight mode etc.) and set telemetry update rates. + */ +public class TelemetryServer { + private let service: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClient + private let scheduler: SchedulerType + private let clientEventLoopGroup: EventLoopGroup + + /** + Initializes a new `TelemetryServer` plugin. + + Normally never created manually, but used from the `Drone` helper class instead. + + - Parameters: + - address: The address of the `MavsdkServer` instance to connect to + - port: The port of the `MavsdkServer` instance to connect to + - scheduler: The scheduler to be used by `Observable`s + */ + public convenience init(address: String = "localhost", + port: Int32 = 50051, + scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background)) { + let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 2) + let channel = ClientConnection.insecure(group: eventLoopGroup).connect(host: address, port: Int(port)) + let service = Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClient(channel: channel) + + self.init(service: service, scheduler: scheduler, eventLoopGroup: eventLoopGroup) + } + + init(service: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClient, scheduler: SchedulerType, eventLoopGroup: EventLoopGroup) { + self.service = service + self.scheduler = scheduler + self.clientEventLoopGroup = eventLoopGroup + } + + public struct RuntimeTelemetryServerError: Error { + public let description: String + + init(_ description: String) { + self.description = description + } + } + + + public struct TelemetryServerError: Error { + public let code: TelemetryServer.TelemetryServerResult.Result + public let description: String + } + + + /** + GPS fix type. + */ + public enum FixType: Equatable { + /// No GPS connected. + case noGps + /// No position information, GPS is connected. + case noFix + /// 2D position. + case fix2D + /// 3D position. + case fix3D + /// DGPS/SBAS aided 3D position. + case fixDgps + /// RTK float, 3D position. + case rtkFloat + /// RTK Fixed, 3D position. + case rtkFixed + case UNRECOGNIZED(Int) + + internal var rpcFixType: Mavsdk_Rpc_TelemetryServer_FixType { + switch self { + case .noGps: + return .noGps + case .noFix: + return .noFix + case .fix2D: + return .fix2D + case .fix3D: + return .fix3D + case .fixDgps: + return .fixDgps + case .rtkFloat: + return .rtkFloat + case .rtkFixed: + return .rtkFixed + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcFixType: Mavsdk_Rpc_TelemetryServer_FixType) -> FixType { + switch rpcFixType { + case .noGps: + return .noGps + case .noFix: + return .noFix + case .fix2D: + return .fix2D + case .fix3D: + return .fix3D + case .fixDgps: + return .fixDgps + case .rtkFloat: + return .rtkFloat + case .rtkFixed: + return .rtkFixed + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + /** + Flight modes. + + For more information about flight modes, check out + https://docs.px4.io/master/en/config/flight_mode.html. + */ + public enum FlightMode: Equatable { + /// Mode not known. + case unknown + /// Armed and ready to take off. + case ready + /// Taking off. + case takeoff + /// Holding (hovering in place (or circling for fixed-wing vehicles). + case hold + /// In mission. + case mission + /// Returning to launch position (then landing). + case returnToLaunch + /// Landing. + case land + /// In 'offboard' mode. + case offboard + /// In 'follow-me' mode. + case followMe + /// In 'Manual' mode. + case manual + /// In 'Altitude Control' mode. + case altctl + /// In 'Position Control' mode. + case posctl + /// In 'Acro' mode. + case acro + /// In 'Stabilize' mode. + case stabilized + /// In 'Rattitude' mode. + case rattitude + case UNRECOGNIZED(Int) + + internal var rpcFlightMode: Mavsdk_Rpc_TelemetryServer_FlightMode { + switch self { + case .unknown: + return .unknown + case .ready: + return .ready + case .takeoff: + return .takeoff + case .hold: + return .hold + case .mission: + return .mission + case .returnToLaunch: + return .returnToLaunch + case .land: + return .land + case .offboard: + return .offboard + case .followMe: + return .followMe + case .manual: + return .manual + case .altctl: + return .altctl + case .posctl: + return .posctl + case .acro: + return .acro + case .stabilized: + return .stabilized + case .rattitude: + return .rattitude + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcFlightMode: Mavsdk_Rpc_TelemetryServer_FlightMode) -> FlightMode { + switch rpcFlightMode { + case .unknown: + return .unknown + case .ready: + return .ready + case .takeoff: + return .takeoff + case .hold: + return .hold + case .mission: + return .mission + case .returnToLaunch: + return .returnToLaunch + case .land: + return .land + case .offboard: + return .offboard + case .followMe: + return .followMe + case .manual: + return .manual + case .altctl: + return .altctl + case .posctl: + return .posctl + case .acro: + return .acro + case .stabilized: + return .stabilized + case .rattitude: + return .rattitude + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + /** + Status types. + */ + public enum StatusTextType: Equatable { + /// Debug. + case debug + /// Information. + case info + /// Notice. + case notice + /// Warning. + case warning + /// Error. + case error + /// Critical. + case critical + /// Alert. + case alert + /// Emergency. + case emergency + case UNRECOGNIZED(Int) + + internal var rpcStatusTextType: Mavsdk_Rpc_TelemetryServer_StatusTextType { + switch self { + case .debug: + return .debug + case .info: + return .info + case .notice: + return .notice + case .warning: + return .warning + case .error: + return .error + case .critical: + return .critical + case .alert: + return .alert + case .emergency: + return .emergency + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcStatusTextType: Mavsdk_Rpc_TelemetryServer_StatusTextType) -> StatusTextType { + switch rpcStatusTextType { + case .debug: + return .debug + case .info: + return .info + case .notice: + return .notice + case .warning: + return .warning + case .error: + return .error + case .critical: + return .critical + case .alert: + return .alert + case .emergency: + return .emergency + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + /** + Landed State enumeration. + */ + public enum LandedState: Equatable { + /// Landed state is unknown. + case unknown + /// The vehicle is on the ground. + case onGround + /// The vehicle is in the air. + case inAir + /// The vehicle is taking off. + case takingOff + /// The vehicle is landing. + case landing + case UNRECOGNIZED(Int) + + internal var rpcLandedState: Mavsdk_Rpc_TelemetryServer_LandedState { + switch self { + case .unknown: + return .unknown + case .onGround: + return .onGround + case .inAir: + return .inAir + case .takingOff: + return .takingOff + case .landing: + return .landing + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcLandedState: Mavsdk_Rpc_TelemetryServer_LandedState) -> LandedState { + switch rpcLandedState { + case .unknown: + return .unknown + case .onGround: + return .onGround + case .inAir: + return .inAir + case .takingOff: + return .takingOff + case .landing: + return .landing + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + + /** + Position type in global coordinates. + */ + public struct Position: Equatable { + public let latitudeDeg: Double + public let longitudeDeg: Double + public let absoluteAltitudeM: Float + public let relativeAltitudeM: Float + + + + /** + Initializes a new `Position`. + + + - Parameters: + + - latitudeDeg: Latitude in degrees (range: -90 to +90) + + - longitudeDeg: Longitude in degrees (range: -180 to +180) + + - absoluteAltitudeM: Altitude AMSL (above mean sea level) in metres + + - relativeAltitudeM: Altitude relative to takeoff altitude in metres + + + */ + public init(latitudeDeg: Double, longitudeDeg: Double, absoluteAltitudeM: Float, relativeAltitudeM: Float) { + self.latitudeDeg = latitudeDeg + self.longitudeDeg = longitudeDeg + self.absoluteAltitudeM = absoluteAltitudeM + self.relativeAltitudeM = relativeAltitudeM + } + + internal var rpcPosition: Mavsdk_Rpc_TelemetryServer_Position { + var rpcPosition = Mavsdk_Rpc_TelemetryServer_Position() + + + rpcPosition.latitudeDeg = latitudeDeg + + + + + rpcPosition.longitudeDeg = longitudeDeg + + + + + rpcPosition.absoluteAltitudeM = absoluteAltitudeM + + + + + rpcPosition.relativeAltitudeM = relativeAltitudeM + + + + return rpcPosition + } + + internal static func translateFromRpc(_ rpcPosition: Mavsdk_Rpc_TelemetryServer_Position) -> Position { + return Position(latitudeDeg: rpcPosition.latitudeDeg, longitudeDeg: rpcPosition.longitudeDeg, absoluteAltitudeM: rpcPosition.absoluteAltitudeM, relativeAltitudeM: rpcPosition.relativeAltitudeM) + } + + public static func == (lhs: Position, rhs: Position) -> Bool { + return lhs.latitudeDeg == rhs.latitudeDeg + && lhs.longitudeDeg == rhs.longitudeDeg + && lhs.absoluteAltitudeM == rhs.absoluteAltitudeM + && lhs.relativeAltitudeM == rhs.relativeAltitudeM + } + } + + /** + Quaternion type. + + All rotations and axis systems follow the right-hand rule. + The Hamilton quaternion product definition is used. + A zero-rotation quaternion is represented by (1,0,0,0). + The quaternion could also be written as w + xi + yj + zk. + + For more info see: https://en.wikipedia.org/wiki/Quaternion + */ + public struct Quaternion: Equatable { + public let w: Float + public let x: Float + public let y: Float + public let z: Float + public let timestampUs: UInt64 + + + + /** + Initializes a new `Quaternion`. + + + - Parameters: + + - w: Quaternion entry 0, also denoted as a + + - x: Quaternion entry 1, also denoted as b + + - y: Quaternion entry 2, also denoted as c + + - z: Quaternion entry 3, also denoted as d + + - timestampUs: Timestamp in microseconds + + + */ + public init(w: Float, x: Float, y: Float, z: Float, timestampUs: UInt64) { + self.w = w + self.x = x + self.y = y + self.z = z + self.timestampUs = timestampUs + } + + internal var rpcQuaternion: Mavsdk_Rpc_TelemetryServer_Quaternion { + var rpcQuaternion = Mavsdk_Rpc_TelemetryServer_Quaternion() + + + rpcQuaternion.w = w + + + + + rpcQuaternion.x = x + + + + + rpcQuaternion.y = y + + + + + rpcQuaternion.z = z + + + + + rpcQuaternion.timestampUs = timestampUs + + + + return rpcQuaternion + } + + internal static func translateFromRpc(_ rpcQuaternion: Mavsdk_Rpc_TelemetryServer_Quaternion) -> Quaternion { + return Quaternion(w: rpcQuaternion.w, x: rpcQuaternion.x, y: rpcQuaternion.y, z: rpcQuaternion.z, timestampUs: rpcQuaternion.timestampUs) + } + + public static func == (lhs: Quaternion, rhs: Quaternion) -> Bool { + return lhs.w == rhs.w + && lhs.x == rhs.x + && lhs.y == rhs.y + && lhs.z == rhs.z + && lhs.timestampUs == rhs.timestampUs + } + } + + /** + Euler angle type. + + All rotations and axis systems follow the right-hand rule. + The Euler angles follow the convention of a 3-2-1 intrinsic Tait-Bryan rotation sequence. + + For more info see https://en.wikipedia.org/wiki/Euler_angles + */ + public struct EulerAngle: Equatable { + public let rollDeg: Float + public let pitchDeg: Float + public let yawDeg: Float + public let timestampUs: UInt64 + + + + /** + Initializes a new `EulerAngle`. + + + - Parameters: + + - rollDeg: Roll angle in degrees, positive is banking to the right + + - pitchDeg: Pitch angle in degrees, positive is pitching nose up + + - yawDeg: Yaw angle in degrees, positive is clock-wise seen from above + + - timestampUs: Timestamp in microseconds + + + */ + public init(rollDeg: Float, pitchDeg: Float, yawDeg: Float, timestampUs: UInt64) { + self.rollDeg = rollDeg + self.pitchDeg = pitchDeg + self.yawDeg = yawDeg + self.timestampUs = timestampUs + } + + internal var rpcEulerAngle: Mavsdk_Rpc_TelemetryServer_EulerAngle { + var rpcEulerAngle = Mavsdk_Rpc_TelemetryServer_EulerAngle() + + + rpcEulerAngle.rollDeg = rollDeg + + + + + rpcEulerAngle.pitchDeg = pitchDeg + + + + + rpcEulerAngle.yawDeg = yawDeg + + + + + rpcEulerAngle.timestampUs = timestampUs + + + + return rpcEulerAngle + } + + internal static func translateFromRpc(_ rpcEulerAngle: Mavsdk_Rpc_TelemetryServer_EulerAngle) -> EulerAngle { + return EulerAngle(rollDeg: rpcEulerAngle.rollDeg, pitchDeg: rpcEulerAngle.pitchDeg, yawDeg: rpcEulerAngle.yawDeg, timestampUs: rpcEulerAngle.timestampUs) + } + + public static func == (lhs: EulerAngle, rhs: EulerAngle) -> Bool { + return lhs.rollDeg == rhs.rollDeg + && lhs.pitchDeg == rhs.pitchDeg + && lhs.yawDeg == rhs.yawDeg + && lhs.timestampUs == rhs.timestampUs + } + } + + /** + Angular velocity type. + */ + public struct AngularVelocityBody: Equatable { + public let rollRadS: Float + public let pitchRadS: Float + public let yawRadS: Float + + + + /** + Initializes a new `AngularVelocityBody`. + + + - Parameters: + + - rollRadS: Roll angular velocity + + - pitchRadS: Pitch angular velocity + + - yawRadS: Yaw angular velocity + + + */ + public init(rollRadS: Float, pitchRadS: Float, yawRadS: Float) { + self.rollRadS = rollRadS + self.pitchRadS = pitchRadS + self.yawRadS = yawRadS + } + + internal var rpcAngularVelocityBody: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody { + var rpcAngularVelocityBody = Mavsdk_Rpc_TelemetryServer_AngularVelocityBody() + + + rpcAngularVelocityBody.rollRadS = rollRadS + + + + + rpcAngularVelocityBody.pitchRadS = pitchRadS + + + + + rpcAngularVelocityBody.yawRadS = yawRadS + + + + return rpcAngularVelocityBody + } + + internal static func translateFromRpc(_ rpcAngularVelocityBody: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody) -> AngularVelocityBody { + return AngularVelocityBody(rollRadS: rpcAngularVelocityBody.rollRadS, pitchRadS: rpcAngularVelocityBody.pitchRadS, yawRadS: rpcAngularVelocityBody.yawRadS) + } + + public static func == (lhs: AngularVelocityBody, rhs: AngularVelocityBody) -> Bool { + return lhs.rollRadS == rhs.rollRadS + && lhs.pitchRadS == rhs.pitchRadS + && lhs.yawRadS == rhs.yawRadS + } + } + + /** + GPS information type. + */ + public struct GpsInfo: Equatable { + public let numSatellites: Int32 + public let fixType: FixType + + + + /** + Initializes a new `GpsInfo`. + + + - Parameters: + + - numSatellites: Number of visible satellites in use + + - fixType: Fix type + + + */ + public init(numSatellites: Int32, fixType: FixType) { + self.numSatellites = numSatellites + self.fixType = fixType + } + + internal var rpcGpsInfo: Mavsdk_Rpc_TelemetryServer_GpsInfo { + var rpcGpsInfo = Mavsdk_Rpc_TelemetryServer_GpsInfo() + + + rpcGpsInfo.numSatellites = numSatellites + + + + + rpcGpsInfo.fixType = fixType.rpcFixType + + + + return rpcGpsInfo + } + + internal static func translateFromRpc(_ rpcGpsInfo: Mavsdk_Rpc_TelemetryServer_GpsInfo) -> GpsInfo { + return GpsInfo(numSatellites: rpcGpsInfo.numSatellites, fixType: FixType.translateFromRpc(rpcGpsInfo.fixType)) + } + + public static func == (lhs: GpsInfo, rhs: GpsInfo) -> Bool { + return lhs.numSatellites == rhs.numSatellites + && lhs.fixType == rhs.fixType + } + } + + /** + Raw GPS information type. + + Warning: this is an advanced type! If you want the location of the drone, use + the position instead. This message exposes the raw values of the GNSS sensor. + */ + public struct RawGps: Equatable { + public let timestampUs: UInt64 + public let latitudeDeg: Double + public let longitudeDeg: Double + public let absoluteAltitudeM: Float + public let hdop: Float + public let vdop: Float + public let velocityMS: Float + public let cogDeg: Float + public let altitudeEllipsoidM: Float + public let horizontalUncertaintyM: Float + public let verticalUncertaintyM: Float + public let velocityUncertaintyMS: Float + public let headingUncertaintyDeg: Float + public let yawDeg: Float + + + + /** + Initializes a new `RawGps`. + + + - Parameters: + + - timestampUs: Timestamp in microseconds (UNIX Epoch time or time since system boot, to be inferred) + + - latitudeDeg: Latitude in degrees (WGS84, EGM96 ellipsoid) + + - longitudeDeg: Longitude in degrees (WGS84, EGM96 ellipsoid) + + - absoluteAltitudeM: Altitude AMSL (above mean sea level) in metres + + - hdop: GPS HDOP horizontal dilution of position (unitless). If unknown, set to NaN + + - vdop: GPS VDOP vertical dilution of position (unitless). If unknown, set to NaN + + - velocityMS: Ground velocity in metres per second + + - cogDeg: Course over ground (NOT heading, but direction of movement) in degrees. If unknown, set to NaN + + - altitudeEllipsoidM: Altitude in metres (above WGS84, EGM96 ellipsoid) + + - horizontalUncertaintyM: Position uncertainty in metres + + - verticalUncertaintyM: Altitude uncertainty in metres + + - velocityUncertaintyMS: Velocity uncertainty in metres per second + + - headingUncertaintyDeg: Heading uncertainty in degrees + + - yawDeg: Yaw in earth frame from north. + + + */ + public init(timestampUs: UInt64, latitudeDeg: Double, longitudeDeg: Double, absoluteAltitudeM: Float, hdop: Float, vdop: Float, velocityMS: Float, cogDeg: Float, altitudeEllipsoidM: Float, horizontalUncertaintyM: Float, verticalUncertaintyM: Float, velocityUncertaintyMS: Float, headingUncertaintyDeg: Float, yawDeg: Float) { + self.timestampUs = timestampUs + self.latitudeDeg = latitudeDeg + self.longitudeDeg = longitudeDeg + self.absoluteAltitudeM = absoluteAltitudeM + self.hdop = hdop + self.vdop = vdop + self.velocityMS = velocityMS + self.cogDeg = cogDeg + self.altitudeEllipsoidM = altitudeEllipsoidM + self.horizontalUncertaintyM = horizontalUncertaintyM + self.verticalUncertaintyM = verticalUncertaintyM + self.velocityUncertaintyMS = velocityUncertaintyMS + self.headingUncertaintyDeg = headingUncertaintyDeg + self.yawDeg = yawDeg + } + + internal var rpcRawGps: Mavsdk_Rpc_TelemetryServer_RawGps { + var rpcRawGps = Mavsdk_Rpc_TelemetryServer_RawGps() + + + rpcRawGps.timestampUs = timestampUs + + + + + rpcRawGps.latitudeDeg = latitudeDeg + + + + + rpcRawGps.longitudeDeg = longitudeDeg + + + + + rpcRawGps.absoluteAltitudeM = absoluteAltitudeM + + + + + rpcRawGps.hdop = hdop + + + + + rpcRawGps.vdop = vdop + + + + + rpcRawGps.velocityMS = velocityMS + + + + + rpcRawGps.cogDeg = cogDeg + + + + + rpcRawGps.altitudeEllipsoidM = altitudeEllipsoidM + + + + + rpcRawGps.horizontalUncertaintyM = horizontalUncertaintyM + + + + + rpcRawGps.verticalUncertaintyM = verticalUncertaintyM + + + + + rpcRawGps.velocityUncertaintyMS = velocityUncertaintyMS + + + + + rpcRawGps.headingUncertaintyDeg = headingUncertaintyDeg + + + + + rpcRawGps.yawDeg = yawDeg + + + + return rpcRawGps + } + + internal static func translateFromRpc(_ rpcRawGps: Mavsdk_Rpc_TelemetryServer_RawGps) -> RawGps { + return RawGps(timestampUs: rpcRawGps.timestampUs, latitudeDeg: rpcRawGps.latitudeDeg, longitudeDeg: rpcRawGps.longitudeDeg, absoluteAltitudeM: rpcRawGps.absoluteAltitudeM, hdop: rpcRawGps.hdop, vdop: rpcRawGps.vdop, velocityMS: rpcRawGps.velocityMS, cogDeg: rpcRawGps.cogDeg, altitudeEllipsoidM: rpcRawGps.altitudeEllipsoidM, horizontalUncertaintyM: rpcRawGps.horizontalUncertaintyM, verticalUncertaintyM: rpcRawGps.verticalUncertaintyM, velocityUncertaintyMS: rpcRawGps.velocityUncertaintyMS, headingUncertaintyDeg: rpcRawGps.headingUncertaintyDeg, yawDeg: rpcRawGps.yawDeg) + } + + public static func == (lhs: RawGps, rhs: RawGps) -> Bool { + return lhs.timestampUs == rhs.timestampUs + && lhs.latitudeDeg == rhs.latitudeDeg + && lhs.longitudeDeg == rhs.longitudeDeg + && lhs.absoluteAltitudeM == rhs.absoluteAltitudeM + && lhs.hdop == rhs.hdop + && lhs.vdop == rhs.vdop + && lhs.velocityMS == rhs.velocityMS + && lhs.cogDeg == rhs.cogDeg + && lhs.altitudeEllipsoidM == rhs.altitudeEllipsoidM + && lhs.horizontalUncertaintyM == rhs.horizontalUncertaintyM + && lhs.verticalUncertaintyM == rhs.verticalUncertaintyM + && lhs.velocityUncertaintyMS == rhs.velocityUncertaintyMS + && lhs.headingUncertaintyDeg == rhs.headingUncertaintyDeg + && lhs.yawDeg == rhs.yawDeg + } + } + + /** + Battery type. + */ + public struct Battery: Equatable { + public let voltageV: Float + public let remainingPercent: Float + + + + /** + Initializes a new `Battery`. + + + - Parameters: + + - voltageV: Voltage in volts + + - remainingPercent: Estimated battery remaining (range: 0.0 to 1.0) + + + */ + public init(voltageV: Float, remainingPercent: Float) { + self.voltageV = voltageV + self.remainingPercent = remainingPercent + } + + internal var rpcBattery: Mavsdk_Rpc_TelemetryServer_Battery { + var rpcBattery = Mavsdk_Rpc_TelemetryServer_Battery() + + + rpcBattery.voltageV = voltageV + + + + + rpcBattery.remainingPercent = remainingPercent + + + + return rpcBattery + } + + internal static func translateFromRpc(_ rpcBattery: Mavsdk_Rpc_TelemetryServer_Battery) -> Battery { + return Battery(voltageV: rpcBattery.voltageV, remainingPercent: rpcBattery.remainingPercent) + } + + public static func == (lhs: Battery, rhs: Battery) -> Bool { + return lhs.voltageV == rhs.voltageV + && lhs.remainingPercent == rhs.remainingPercent + } + } + + /** + Health type. + */ + public struct Health: Equatable { + public let isGyrometerCalibrationOk: Bool + public let isAccelerometerCalibrationOk: Bool + public let isMagnetometerCalibrationOk: Bool + public let isLocalPositionOk: Bool + public let isGlobalPositionOk: Bool + public let isHomePositionOk: Bool + public let isArmable: Bool + + + + /** + Initializes a new `Health`. + + + - Parameters: + + - isGyrometerCalibrationOk: True if the gyrometer is calibrated + + - isAccelerometerCalibrationOk: True if the accelerometer is calibrated + + - isMagnetometerCalibrationOk: True if the magnetometer is calibrated + + - isLocalPositionOk: True if the local position estimate is good enough to fly in 'position control' mode + + - isGlobalPositionOk: True if the global position estimate is good enough to fly in 'position control' mode + + - isHomePositionOk: True if the home position has been initialized properly + + - isArmable: True if system can be armed + + + */ + public init(isGyrometerCalibrationOk: Bool, isAccelerometerCalibrationOk: Bool, isMagnetometerCalibrationOk: Bool, isLocalPositionOk: Bool, isGlobalPositionOk: Bool, isHomePositionOk: Bool, isArmable: Bool) { + self.isGyrometerCalibrationOk = isGyrometerCalibrationOk + self.isAccelerometerCalibrationOk = isAccelerometerCalibrationOk + self.isMagnetometerCalibrationOk = isMagnetometerCalibrationOk + self.isLocalPositionOk = isLocalPositionOk + self.isGlobalPositionOk = isGlobalPositionOk + self.isHomePositionOk = isHomePositionOk + self.isArmable = isArmable + } + + internal var rpcHealth: Mavsdk_Rpc_TelemetryServer_Health { + var rpcHealth = Mavsdk_Rpc_TelemetryServer_Health() + + + rpcHealth.isGyrometerCalibrationOk = isGyrometerCalibrationOk + + + + + rpcHealth.isAccelerometerCalibrationOk = isAccelerometerCalibrationOk + + + + + rpcHealth.isMagnetometerCalibrationOk = isMagnetometerCalibrationOk + + + + + rpcHealth.isLocalPositionOk = isLocalPositionOk + + + + + rpcHealth.isGlobalPositionOk = isGlobalPositionOk + + + + + rpcHealth.isHomePositionOk = isHomePositionOk + + + + + rpcHealth.isArmable = isArmable + + + + return rpcHealth + } + + internal static func translateFromRpc(_ rpcHealth: Mavsdk_Rpc_TelemetryServer_Health) -> Health { + return Health(isGyrometerCalibrationOk: rpcHealth.isGyrometerCalibrationOk, isAccelerometerCalibrationOk: rpcHealth.isAccelerometerCalibrationOk, isMagnetometerCalibrationOk: rpcHealth.isMagnetometerCalibrationOk, isLocalPositionOk: rpcHealth.isLocalPositionOk, isGlobalPositionOk: rpcHealth.isGlobalPositionOk, isHomePositionOk: rpcHealth.isHomePositionOk, isArmable: rpcHealth.isArmable) + } + + public static func == (lhs: Health, rhs: Health) -> Bool { + return lhs.isGyrometerCalibrationOk == rhs.isGyrometerCalibrationOk + && lhs.isAccelerometerCalibrationOk == rhs.isAccelerometerCalibrationOk + && lhs.isMagnetometerCalibrationOk == rhs.isMagnetometerCalibrationOk + && lhs.isLocalPositionOk == rhs.isLocalPositionOk + && lhs.isGlobalPositionOk == rhs.isGlobalPositionOk + && lhs.isHomePositionOk == rhs.isHomePositionOk + && lhs.isArmable == rhs.isArmable + } + } + + /** + Remote control status type. + */ + public struct RcStatus: Equatable { + public let wasAvailableOnce: Bool + public let isAvailable: Bool + public let signalStrengthPercent: Float + + + + /** + Initializes a new `RcStatus`. + + + - Parameters: + + - wasAvailableOnce: True if an RC signal has been available once + + - isAvailable: True if the RC signal is available now + + - signalStrengthPercent: Signal strength (range: 0 to 100, NaN if unknown) + + + */ + public init(wasAvailableOnce: Bool, isAvailable: Bool, signalStrengthPercent: Float) { + self.wasAvailableOnce = wasAvailableOnce + self.isAvailable = isAvailable + self.signalStrengthPercent = signalStrengthPercent + } + + internal var rpcRcStatus: Mavsdk_Rpc_TelemetryServer_RcStatus { + var rpcRcStatus = Mavsdk_Rpc_TelemetryServer_RcStatus() + + + rpcRcStatus.wasAvailableOnce = wasAvailableOnce + + + + + rpcRcStatus.isAvailable = isAvailable + + + + + rpcRcStatus.signalStrengthPercent = signalStrengthPercent + + + + return rpcRcStatus + } + + internal static func translateFromRpc(_ rpcRcStatus: Mavsdk_Rpc_TelemetryServer_RcStatus) -> RcStatus { + return RcStatus(wasAvailableOnce: rpcRcStatus.wasAvailableOnce, isAvailable: rpcRcStatus.isAvailable, signalStrengthPercent: rpcRcStatus.signalStrengthPercent) + } + + public static func == (lhs: RcStatus, rhs: RcStatus) -> Bool { + return lhs.wasAvailableOnce == rhs.wasAvailableOnce + && lhs.isAvailable == rhs.isAvailable + && lhs.signalStrengthPercent == rhs.signalStrengthPercent + } + } + + /** + StatusText information type. + */ + public struct StatusText: Equatable { + public let type: StatusTextType + public let text: String + + + + /** + Initializes a new `StatusText`. + + + - Parameters: + + - type: Message type + + - text: MAVLink status message + + + */ + public init(type: StatusTextType, text: String) { + self.type = type + self.text = text + } + + internal var rpcStatusText: Mavsdk_Rpc_TelemetryServer_StatusText { + var rpcStatusText = Mavsdk_Rpc_TelemetryServer_StatusText() + + + rpcStatusText.type = type.rpcStatusTextType + + + + + rpcStatusText.text = text + + + + return rpcStatusText + } + + internal static func translateFromRpc(_ rpcStatusText: Mavsdk_Rpc_TelemetryServer_StatusText) -> StatusText { + return StatusText(type: StatusTextType.translateFromRpc(rpcStatusText.type), text: rpcStatusText.text) + } + + public static func == (lhs: StatusText, rhs: StatusText) -> Bool { + return lhs.type == rhs.type + && lhs.text == rhs.text + } + } + + /** + Actuator control target type. + */ + public struct ActuatorControlTarget: Equatable { + public let group: Int32 + public let controls: [Float] + + + + /** + Initializes a new `ActuatorControlTarget`. + + + - Parameters: + + - group: An actuator control group is e.g. 'attitude' for the core flight controls, or 'gimbal' for a payload. + + - controls: Controls normed from -1 to 1, where 0 is neutral position. + + + */ + public init(group: Int32, controls: [Float]) { + self.group = group + self.controls = controls + } + + internal var rpcActuatorControlTarget: Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget { + var rpcActuatorControlTarget = Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget() + + + rpcActuatorControlTarget.group = group + + + + + rpcActuatorControlTarget.controls = controls + + + + return rpcActuatorControlTarget + } + + internal static func translateFromRpc(_ rpcActuatorControlTarget: Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget) -> ActuatorControlTarget { + return ActuatorControlTarget(group: rpcActuatorControlTarget.group, controls: rpcActuatorControlTarget.controls) + } + + public static func == (lhs: ActuatorControlTarget, rhs: ActuatorControlTarget) -> Bool { + return lhs.group == rhs.group + && lhs.controls == rhs.controls + } + } + + /** + Actuator output status type. + */ + public struct ActuatorOutputStatus: Equatable { + public let active: UInt32 + public let actuator: [Float] + + + + /** + Initializes a new `ActuatorOutputStatus`. + + + - Parameters: + + - active: Active outputs + + - actuator: Servo/motor output values + + + */ + public init(active: UInt32, actuator: [Float]) { + self.active = active + self.actuator = actuator + } + + internal var rpcActuatorOutputStatus: Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus { + var rpcActuatorOutputStatus = Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus() + + + rpcActuatorOutputStatus.active = active + + + + + rpcActuatorOutputStatus.actuator = actuator + + + + return rpcActuatorOutputStatus + } + + internal static func translateFromRpc(_ rpcActuatorOutputStatus: Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus) -> ActuatorOutputStatus { + return ActuatorOutputStatus(active: rpcActuatorOutputStatus.active, actuator: rpcActuatorOutputStatus.actuator) + } + + public static func == (lhs: ActuatorOutputStatus, rhs: ActuatorOutputStatus) -> Bool { + return lhs.active == rhs.active + && lhs.actuator == rhs.actuator + } + } + + /** + Covariance type. + + Row-major representation of a 6x6 cross-covariance matrix + upper right triangle. + Set first to NaN if unknown. + */ + public struct Covariance: Equatable { + public let covarianceMatrix: [Float] + + + + /** + Initializes a new `Covariance`. + + + - Parameter covarianceMatrix: Representation of a covariance matrix. + + */ + public init(covarianceMatrix: [Float]) { + self.covarianceMatrix = covarianceMatrix + } + + internal var rpcCovariance: Mavsdk_Rpc_TelemetryServer_Covariance { + var rpcCovariance = Mavsdk_Rpc_TelemetryServer_Covariance() + + + rpcCovariance.covarianceMatrix = covarianceMatrix + + + + return rpcCovariance + } + + internal static func translateFromRpc(_ rpcCovariance: Mavsdk_Rpc_TelemetryServer_Covariance) -> Covariance { + return Covariance(covarianceMatrix: rpcCovariance.covarianceMatrix) + } + + public static func == (lhs: Covariance, rhs: Covariance) -> Bool { + return lhs.covarianceMatrix == rhs.covarianceMatrix + } + } + + /** + Velocity type, represented in the Body (X Y Z) frame and in metres/second. + */ + public struct VelocityBody: Equatable { + public let xMS: Float + public let yMS: Float + public let zMS: Float + + + + /** + Initializes a new `VelocityBody`. + + + - Parameters: + + - xMS: Velocity in X in metres/second + + - yMS: Velocity in Y in metres/second + + - zMS: Velocity in Z in metres/second + + + */ + public init(xMS: Float, yMS: Float, zMS: Float) { + self.xMS = xMS + self.yMS = yMS + self.zMS = zMS + } + + internal var rpcVelocityBody: Mavsdk_Rpc_TelemetryServer_VelocityBody { + var rpcVelocityBody = Mavsdk_Rpc_TelemetryServer_VelocityBody() + + + rpcVelocityBody.xMS = xMS + + + + + rpcVelocityBody.yMS = yMS + + + + + rpcVelocityBody.zMS = zMS + + + + return rpcVelocityBody + } + + internal static func translateFromRpc(_ rpcVelocityBody: Mavsdk_Rpc_TelemetryServer_VelocityBody) -> VelocityBody { + return VelocityBody(xMS: rpcVelocityBody.xMS, yMS: rpcVelocityBody.yMS, zMS: rpcVelocityBody.zMS) + } + + public static func == (lhs: VelocityBody, rhs: VelocityBody) -> Bool { + return lhs.xMS == rhs.xMS + && lhs.yMS == rhs.yMS + && lhs.zMS == rhs.zMS + } + } + + /** + Position type, represented in the Body (X Y Z) frame + */ + public struct PositionBody: Equatable { + public let xM: Float + public let yM: Float + public let zM: Float + + + + /** + Initializes a new `PositionBody`. + + + - Parameters: + + - xM: X Position in metres. + + - yM: Y Position in metres. + + - zM: Z Position in metres. + + + */ + public init(xM: Float, yM: Float, zM: Float) { + self.xM = xM + self.yM = yM + self.zM = zM + } + + internal var rpcPositionBody: Mavsdk_Rpc_TelemetryServer_PositionBody { + var rpcPositionBody = Mavsdk_Rpc_TelemetryServer_PositionBody() + + + rpcPositionBody.xM = xM + + + + + rpcPositionBody.yM = yM + + + + + rpcPositionBody.zM = zM + + + + return rpcPositionBody + } + + internal static func translateFromRpc(_ rpcPositionBody: Mavsdk_Rpc_TelemetryServer_PositionBody) -> PositionBody { + return PositionBody(xM: rpcPositionBody.xM, yM: rpcPositionBody.yM, zM: rpcPositionBody.zM) + } + + public static func == (lhs: PositionBody, rhs: PositionBody) -> Bool { + return lhs.xM == rhs.xM + && lhs.yM == rhs.yM + && lhs.zM == rhs.zM + } + } + + /** + Odometry message type. + */ + public struct Odometry: Equatable { + public let timeUsec: UInt64 + public let frameID: MavFrame + public let childFrameID: MavFrame + public let positionBody: PositionBody + public let q: Quaternion + public let velocityBody: VelocityBody + public let angularVelocityBody: AngularVelocityBody + public let poseCovariance: Covariance + public let velocityCovariance: Covariance + + + + + /** + Mavlink frame id + */ + public enum MavFrame: Equatable { + /// Frame is undefined.. + case undef + /// Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right.. + case bodyNed + /// Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: north, y: east, z: down).. + case visionNed + /// Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: north, y: east, z: down).. + case estimNed + case UNRECOGNIZED(Int) + + internal var rpcMavFrame: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame { + switch self { + case .undef: + return .undef + case .bodyNed: + return .bodyNed + case .visionNed: + return .visionNed + case .estimNed: + return .estimNed + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcMavFrame: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame) -> MavFrame { + switch rpcMavFrame { + case .undef: + return .undef + case .bodyNed: + return .bodyNed + case .visionNed: + return .visionNed + case .estimNed: + return .estimNed + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + + /** + Initializes a new `Odometry`. + + + - Parameters: + + - timeUsec: Timestamp (0 to use Backend timestamp). + + - frameID: Coordinate frame of reference for the pose data. + + - childFrameID: Coordinate frame of reference for the velocity in free space (twist) data. + + - positionBody: Position. + + - q: Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). + + - velocityBody: Linear velocity (m/s). + + - angularVelocityBody: Angular velocity (rad/s). + + - poseCovariance: Pose cross-covariance matrix. + + - velocityCovariance: Velocity cross-covariance matrix. + + + */ + public init(timeUsec: UInt64, frameID: MavFrame, childFrameID: MavFrame, positionBody: PositionBody, q: Quaternion, velocityBody: VelocityBody, angularVelocityBody: AngularVelocityBody, poseCovariance: Covariance, velocityCovariance: Covariance) { + self.timeUsec = timeUsec + self.frameID = frameID + self.childFrameID = childFrameID + self.positionBody = positionBody + self.q = q + self.velocityBody = velocityBody + self.angularVelocityBody = angularVelocityBody + self.poseCovariance = poseCovariance + self.velocityCovariance = velocityCovariance + } + + internal var rpcOdometry: Mavsdk_Rpc_TelemetryServer_Odometry { + var rpcOdometry = Mavsdk_Rpc_TelemetryServer_Odometry() + + + rpcOdometry.timeUsec = timeUsec + + + + + rpcOdometry.frameID = frameID.rpcMavFrame + + + + + rpcOdometry.childFrameID = childFrameID.rpcMavFrame + + + + + rpcOdometry.positionBody = positionBody.rpcPositionBody + + + + + rpcOdometry.q = q.rpcQuaternion + + + + + rpcOdometry.velocityBody = velocityBody.rpcVelocityBody + + + + + rpcOdometry.angularVelocityBody = angularVelocityBody.rpcAngularVelocityBody + + + + + rpcOdometry.poseCovariance = poseCovariance.rpcCovariance + + + + + rpcOdometry.velocityCovariance = velocityCovariance.rpcCovariance + + + + return rpcOdometry + } + + internal static func translateFromRpc(_ rpcOdometry: Mavsdk_Rpc_TelemetryServer_Odometry) -> Odometry { + return Odometry(timeUsec: rpcOdometry.timeUsec, frameID: MavFrame.translateFromRpc(rpcOdometry.frameID), childFrameID: MavFrame.translateFromRpc(rpcOdometry.childFrameID), positionBody: PositionBody.translateFromRpc(rpcOdometry.positionBody), q: Quaternion.translateFromRpc(rpcOdometry.q), velocityBody: VelocityBody.translateFromRpc(rpcOdometry.velocityBody), angularVelocityBody: AngularVelocityBody.translateFromRpc(rpcOdometry.angularVelocityBody), poseCovariance: Covariance.translateFromRpc(rpcOdometry.poseCovariance), velocityCovariance: Covariance.translateFromRpc(rpcOdometry.velocityCovariance)) + } + + public static func == (lhs: Odometry, rhs: Odometry) -> Bool { + return lhs.timeUsec == rhs.timeUsec + && lhs.frameID == rhs.frameID + && lhs.childFrameID == rhs.childFrameID + && lhs.positionBody == rhs.positionBody + && lhs.q == rhs.q + && lhs.velocityBody == rhs.velocityBody + && lhs.angularVelocityBody == rhs.angularVelocityBody + && lhs.poseCovariance == rhs.poseCovariance + && lhs.velocityCovariance == rhs.velocityCovariance + } + } + + /** + DistanceSensor message type. + */ + public struct DistanceSensor: Equatable { + public let minimumDistanceM: Float + public let maximumDistanceM: Float + public let currentDistanceM: Float + + + + /** + Initializes a new `DistanceSensor`. + + + - Parameters: + + - minimumDistanceM: Minimum distance the sensor can measure, NaN if unknown. + + - maximumDistanceM: Maximum distance the sensor can measure, NaN if unknown. + + - currentDistanceM: Current distance reading, NaN if unknown. + + + */ + public init(minimumDistanceM: Float, maximumDistanceM: Float, currentDistanceM: Float) { + self.minimumDistanceM = minimumDistanceM + self.maximumDistanceM = maximumDistanceM + self.currentDistanceM = currentDistanceM + } + + internal var rpcDistanceSensor: Mavsdk_Rpc_TelemetryServer_DistanceSensor { + var rpcDistanceSensor = Mavsdk_Rpc_TelemetryServer_DistanceSensor() + + + rpcDistanceSensor.minimumDistanceM = minimumDistanceM + + + + + rpcDistanceSensor.maximumDistanceM = maximumDistanceM + + + + + rpcDistanceSensor.currentDistanceM = currentDistanceM + + + + return rpcDistanceSensor + } + + internal static func translateFromRpc(_ rpcDistanceSensor: Mavsdk_Rpc_TelemetryServer_DistanceSensor) -> DistanceSensor { + return DistanceSensor(minimumDistanceM: rpcDistanceSensor.minimumDistanceM, maximumDistanceM: rpcDistanceSensor.maximumDistanceM, currentDistanceM: rpcDistanceSensor.currentDistanceM) + } + + public static func == (lhs: DistanceSensor, rhs: DistanceSensor) -> Bool { + return lhs.minimumDistanceM == rhs.minimumDistanceM + && lhs.maximumDistanceM == rhs.maximumDistanceM + && lhs.currentDistanceM == rhs.currentDistanceM + } + } + + /** + Scaled Pressure message type. + */ + public struct ScaledPressure: Equatable { + public let timestampUs: UInt64 + public let absolutePressureHpa: Float + public let differentialPressureHpa: Float + public let temperatureDeg: Float + public let differentialPressureTemperatureDeg: Float + + + + /** + Initializes a new `ScaledPressure`. + + + - Parameters: + + - timestampUs: Timestamp (time since system boot) + + - absolutePressureHpa: Absolute pressure in hPa + + - differentialPressureHpa: Differential pressure 1 in hPa + + - temperatureDeg: Absolute pressure temperature (in celsius) + + - differentialPressureTemperatureDeg: Differential pressure temperature (in celsius, 0 if not available) + + + */ + public init(timestampUs: UInt64, absolutePressureHpa: Float, differentialPressureHpa: Float, temperatureDeg: Float, differentialPressureTemperatureDeg: Float) { + self.timestampUs = timestampUs + self.absolutePressureHpa = absolutePressureHpa + self.differentialPressureHpa = differentialPressureHpa + self.temperatureDeg = temperatureDeg + self.differentialPressureTemperatureDeg = differentialPressureTemperatureDeg + } + + internal var rpcScaledPressure: Mavsdk_Rpc_TelemetryServer_ScaledPressure { + var rpcScaledPressure = Mavsdk_Rpc_TelemetryServer_ScaledPressure() + + + rpcScaledPressure.timestampUs = timestampUs + + + + + rpcScaledPressure.absolutePressureHpa = absolutePressureHpa + + + + + rpcScaledPressure.differentialPressureHpa = differentialPressureHpa + + + + + rpcScaledPressure.temperatureDeg = temperatureDeg + + + + + rpcScaledPressure.differentialPressureTemperatureDeg = differentialPressureTemperatureDeg + + + + return rpcScaledPressure + } + + internal static func translateFromRpc(_ rpcScaledPressure: Mavsdk_Rpc_TelemetryServer_ScaledPressure) -> ScaledPressure { + return ScaledPressure(timestampUs: rpcScaledPressure.timestampUs, absolutePressureHpa: rpcScaledPressure.absolutePressureHpa, differentialPressureHpa: rpcScaledPressure.differentialPressureHpa, temperatureDeg: rpcScaledPressure.temperatureDeg, differentialPressureTemperatureDeg: rpcScaledPressure.differentialPressureTemperatureDeg) + } + + public static func == (lhs: ScaledPressure, rhs: ScaledPressure) -> Bool { + return lhs.timestampUs == rhs.timestampUs + && lhs.absolutePressureHpa == rhs.absolutePressureHpa + && lhs.differentialPressureHpa == rhs.differentialPressureHpa + && lhs.temperatureDeg == rhs.temperatureDeg + && lhs.differentialPressureTemperatureDeg == rhs.differentialPressureTemperatureDeg + } + } + + /** + PositionNed message type. + */ + public struct PositionNed: Equatable { + public let northM: Float + public let eastM: Float + public let downM: Float + + + + /** + Initializes a new `PositionNed`. + + + - Parameters: + + - northM: Position along north direction in metres + + - eastM: Position along east direction in metres + + - downM: Position along down direction in metres + + + */ + public init(northM: Float, eastM: Float, downM: Float) { + self.northM = northM + self.eastM = eastM + self.downM = downM + } + + internal var rpcPositionNed: Mavsdk_Rpc_TelemetryServer_PositionNed { + var rpcPositionNed = Mavsdk_Rpc_TelemetryServer_PositionNed() + + + rpcPositionNed.northM = northM + + + + + rpcPositionNed.eastM = eastM + + + + + rpcPositionNed.downM = downM + + + + return rpcPositionNed + } + + internal static func translateFromRpc(_ rpcPositionNed: Mavsdk_Rpc_TelemetryServer_PositionNed) -> PositionNed { + return PositionNed(northM: rpcPositionNed.northM, eastM: rpcPositionNed.eastM, downM: rpcPositionNed.downM) + } + + public static func == (lhs: PositionNed, rhs: PositionNed) -> Bool { + return lhs.northM == rhs.northM + && lhs.eastM == rhs.eastM + && lhs.downM == rhs.downM + } + } + + /** + VelocityNed message type. + */ + public struct VelocityNed: Equatable { + public let northMS: Float + public let eastMS: Float + public let downMS: Float + + + + /** + Initializes a new `VelocityNed`. + + + - Parameters: + + - northMS: Velocity along north direction in metres per second + + - eastMS: Velocity along east direction in metres per second + + - downMS: Velocity along down direction in metres per second + + + */ + public init(northMS: Float, eastMS: Float, downMS: Float) { + self.northMS = northMS + self.eastMS = eastMS + self.downMS = downMS + } + + internal var rpcVelocityNed: Mavsdk_Rpc_TelemetryServer_VelocityNed { + var rpcVelocityNed = Mavsdk_Rpc_TelemetryServer_VelocityNed() + + + rpcVelocityNed.northMS = northMS + + + + + rpcVelocityNed.eastMS = eastMS + + + + + rpcVelocityNed.downMS = downMS + + + + return rpcVelocityNed + } + + internal static func translateFromRpc(_ rpcVelocityNed: Mavsdk_Rpc_TelemetryServer_VelocityNed) -> VelocityNed { + return VelocityNed(northMS: rpcVelocityNed.northMS, eastMS: rpcVelocityNed.eastMS, downMS: rpcVelocityNed.downMS) + } + + public static func == (lhs: VelocityNed, rhs: VelocityNed) -> Bool { + return lhs.northMS == rhs.northMS + && lhs.eastMS == rhs.eastMS + && lhs.downMS == rhs.downMS + } + } + + /** + PositionVelocityNed message type. + */ + public struct PositionVelocityNed: Equatable { + public let position: PositionNed + public let velocity: VelocityNed + + + + /** + Initializes a new `PositionVelocityNed`. + + + - Parameters: + + - position: Position (NED) + + - velocity: Velocity (NED) + + + */ + public init(position: PositionNed, velocity: VelocityNed) { + self.position = position + self.velocity = velocity + } + + internal var rpcPositionVelocityNed: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed { + var rpcPositionVelocityNed = Mavsdk_Rpc_TelemetryServer_PositionVelocityNed() + + + rpcPositionVelocityNed.position = position.rpcPositionNed + + + + + rpcPositionVelocityNed.velocity = velocity.rpcVelocityNed + + + + return rpcPositionVelocityNed + } + + internal static func translateFromRpc(_ rpcPositionVelocityNed: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed) -> PositionVelocityNed { + return PositionVelocityNed(position: PositionNed.translateFromRpc(rpcPositionVelocityNed.position), velocity: VelocityNed.translateFromRpc(rpcPositionVelocityNed.velocity)) + } + + public static func == (lhs: PositionVelocityNed, rhs: PositionVelocityNed) -> Bool { + return lhs.position == rhs.position + && lhs.velocity == rhs.velocity + } + } + + /** + GroundTruth message type. + */ + public struct GroundTruth: Equatable { + public let latitudeDeg: Double + public let longitudeDeg: Double + public let absoluteAltitudeM: Float + + + + /** + Initializes a new `GroundTruth`. + + + - Parameters: + + - latitudeDeg: Latitude in degrees (range: -90 to +90) + + - longitudeDeg: Longitude in degrees (range: -180 to 180) + + - absoluteAltitudeM: Altitude AMSL (above mean sea level) in metres + + + */ + public init(latitudeDeg: Double, longitudeDeg: Double, absoluteAltitudeM: Float) { + self.latitudeDeg = latitudeDeg + self.longitudeDeg = longitudeDeg + self.absoluteAltitudeM = absoluteAltitudeM + } + + internal var rpcGroundTruth: Mavsdk_Rpc_TelemetryServer_GroundTruth { + var rpcGroundTruth = Mavsdk_Rpc_TelemetryServer_GroundTruth() + + + rpcGroundTruth.latitudeDeg = latitudeDeg + + + + + rpcGroundTruth.longitudeDeg = longitudeDeg + + + + + rpcGroundTruth.absoluteAltitudeM = absoluteAltitudeM + + + + return rpcGroundTruth + } + + internal static func translateFromRpc(_ rpcGroundTruth: Mavsdk_Rpc_TelemetryServer_GroundTruth) -> GroundTruth { + return GroundTruth(latitudeDeg: rpcGroundTruth.latitudeDeg, longitudeDeg: rpcGroundTruth.longitudeDeg, absoluteAltitudeM: rpcGroundTruth.absoluteAltitudeM) + } + + public static func == (lhs: GroundTruth, rhs: GroundTruth) -> Bool { + return lhs.latitudeDeg == rhs.latitudeDeg + && lhs.longitudeDeg == rhs.longitudeDeg + && lhs.absoluteAltitudeM == rhs.absoluteAltitudeM + } + } + + /** + FixedwingMetrics message type. + */ + public struct FixedwingMetrics: Equatable { + public let airspeedMS: Float + public let throttlePercentage: Float + public let climbRateMS: Float + + + + /** + Initializes a new `FixedwingMetrics`. + + + - Parameters: + + - airspeedMS: Current indicated airspeed (IAS) in metres per second + + - throttlePercentage: Current throttle setting (0 to 100) + + - climbRateMS: Current climb rate in metres per second + + + */ + public init(airspeedMS: Float, throttlePercentage: Float, climbRateMS: Float) { + self.airspeedMS = airspeedMS + self.throttlePercentage = throttlePercentage + self.climbRateMS = climbRateMS + } + + internal var rpcFixedwingMetrics: Mavsdk_Rpc_TelemetryServer_FixedwingMetrics { + var rpcFixedwingMetrics = Mavsdk_Rpc_TelemetryServer_FixedwingMetrics() + + + rpcFixedwingMetrics.airspeedMS = airspeedMS + + + + + rpcFixedwingMetrics.throttlePercentage = throttlePercentage + + + + + rpcFixedwingMetrics.climbRateMS = climbRateMS + + + + return rpcFixedwingMetrics + } + + internal static func translateFromRpc(_ rpcFixedwingMetrics: Mavsdk_Rpc_TelemetryServer_FixedwingMetrics) -> FixedwingMetrics { + return FixedwingMetrics(airspeedMS: rpcFixedwingMetrics.airspeedMS, throttlePercentage: rpcFixedwingMetrics.throttlePercentage, climbRateMS: rpcFixedwingMetrics.climbRateMS) + } + + public static func == (lhs: FixedwingMetrics, rhs: FixedwingMetrics) -> Bool { + return lhs.airspeedMS == rhs.airspeedMS + && lhs.throttlePercentage == rhs.throttlePercentage + && lhs.climbRateMS == rhs.climbRateMS + } + } + + /** + AccelerationFrd message type. + */ + public struct AccelerationFrd: Equatable { + public let forwardMS2: Float + public let rightMS2: Float + public let downMS2: Float + + + + /** + Initializes a new `AccelerationFrd`. + + + - Parameters: + + - forwardMS2: Acceleration in forward direction in metres per second^2 + + - rightMS2: Acceleration in right direction in metres per second^2 + + - downMS2: Acceleration in down direction in metres per second^2 + + + */ + public init(forwardMS2: Float, rightMS2: Float, downMS2: Float) { + self.forwardMS2 = forwardMS2 + self.rightMS2 = rightMS2 + self.downMS2 = downMS2 + } + + internal var rpcAccelerationFrd: Mavsdk_Rpc_TelemetryServer_AccelerationFrd { + var rpcAccelerationFrd = Mavsdk_Rpc_TelemetryServer_AccelerationFrd() + + + rpcAccelerationFrd.forwardMS2 = forwardMS2 + + + + + rpcAccelerationFrd.rightMS2 = rightMS2 + + + + + rpcAccelerationFrd.downMS2 = downMS2 + + + + return rpcAccelerationFrd + } + + internal static func translateFromRpc(_ rpcAccelerationFrd: Mavsdk_Rpc_TelemetryServer_AccelerationFrd) -> AccelerationFrd { + return AccelerationFrd(forwardMS2: rpcAccelerationFrd.forwardMS2, rightMS2: rpcAccelerationFrd.rightMS2, downMS2: rpcAccelerationFrd.downMS2) + } + + public static func == (lhs: AccelerationFrd, rhs: AccelerationFrd) -> Bool { + return lhs.forwardMS2 == rhs.forwardMS2 + && lhs.rightMS2 == rhs.rightMS2 + && lhs.downMS2 == rhs.downMS2 + } + } + + /** + AngularVelocityFrd message type. + */ + public struct AngularVelocityFrd: Equatable { + public let forwardRadS: Float + public let rightRadS: Float + public let downRadS: Float + + + + /** + Initializes a new `AngularVelocityFrd`. + + + - Parameters: + + - forwardRadS: Angular velocity in forward direction in radians per second + + - rightRadS: Angular velocity in right direction in radians per second + + - downRadS: Angular velocity in Down direction in radians per second + + + */ + public init(forwardRadS: Float, rightRadS: Float, downRadS: Float) { + self.forwardRadS = forwardRadS + self.rightRadS = rightRadS + self.downRadS = downRadS + } + + internal var rpcAngularVelocityFrd: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd { + var rpcAngularVelocityFrd = Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd() + + + rpcAngularVelocityFrd.forwardRadS = forwardRadS + + + + + rpcAngularVelocityFrd.rightRadS = rightRadS + + + + + rpcAngularVelocityFrd.downRadS = downRadS + + + + return rpcAngularVelocityFrd + } + + internal static func translateFromRpc(_ rpcAngularVelocityFrd: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd) -> AngularVelocityFrd { + return AngularVelocityFrd(forwardRadS: rpcAngularVelocityFrd.forwardRadS, rightRadS: rpcAngularVelocityFrd.rightRadS, downRadS: rpcAngularVelocityFrd.downRadS) + } + + public static func == (lhs: AngularVelocityFrd, rhs: AngularVelocityFrd) -> Bool { + return lhs.forwardRadS == rhs.forwardRadS + && lhs.rightRadS == rhs.rightRadS + && lhs.downRadS == rhs.downRadS + } + } + + /** + MagneticFieldFrd message type. + */ + public struct MagneticFieldFrd: Equatable { + public let forwardGauss: Float + public let rightGauss: Float + public let downGauss: Float + + + + /** + Initializes a new `MagneticFieldFrd`. + + + - Parameters: + + - forwardGauss: Magnetic field in forward direction measured in Gauss + + - rightGauss: Magnetic field in East direction measured in Gauss + + - downGauss: Magnetic field in Down direction measured in Gauss + + + */ + public init(forwardGauss: Float, rightGauss: Float, downGauss: Float) { + self.forwardGauss = forwardGauss + self.rightGauss = rightGauss + self.downGauss = downGauss + } + + internal var rpcMagneticFieldFrd: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd { + var rpcMagneticFieldFrd = Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd() + + + rpcMagneticFieldFrd.forwardGauss = forwardGauss + + + + + rpcMagneticFieldFrd.rightGauss = rightGauss + + + + + rpcMagneticFieldFrd.downGauss = downGauss + + + + return rpcMagneticFieldFrd + } + + internal static func translateFromRpc(_ rpcMagneticFieldFrd: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd) -> MagneticFieldFrd { + return MagneticFieldFrd(forwardGauss: rpcMagneticFieldFrd.forwardGauss, rightGauss: rpcMagneticFieldFrd.rightGauss, downGauss: rpcMagneticFieldFrd.downGauss) + } + + public static func == (lhs: MagneticFieldFrd, rhs: MagneticFieldFrd) -> Bool { + return lhs.forwardGauss == rhs.forwardGauss + && lhs.rightGauss == rhs.rightGauss + && lhs.downGauss == rhs.downGauss + } + } + + /** + Imu message type. + */ + public struct Imu: Equatable { + public let accelerationFrd: AccelerationFrd + public let angularVelocityFrd: AngularVelocityFrd + public let magneticFieldFrd: MagneticFieldFrd + public let temperatureDegc: Float + public let timestampUs: UInt64 + + + + /** + Initializes a new `Imu`. + + + - Parameters: + + - accelerationFrd: Acceleration + + - angularVelocityFrd: Angular velocity + + - magneticFieldFrd: Magnetic field + + - temperatureDegc: Temperature + + - timestampUs: Timestamp in microseconds + + + */ + public init(accelerationFrd: AccelerationFrd, angularVelocityFrd: AngularVelocityFrd, magneticFieldFrd: MagneticFieldFrd, temperatureDegc: Float, timestampUs: UInt64) { + self.accelerationFrd = accelerationFrd + self.angularVelocityFrd = angularVelocityFrd + self.magneticFieldFrd = magneticFieldFrd + self.temperatureDegc = temperatureDegc + self.timestampUs = timestampUs + } + + internal var rpcImu: Mavsdk_Rpc_TelemetryServer_Imu { + var rpcImu = Mavsdk_Rpc_TelemetryServer_Imu() + + + rpcImu.accelerationFrd = accelerationFrd.rpcAccelerationFrd + + + + + rpcImu.angularVelocityFrd = angularVelocityFrd.rpcAngularVelocityFrd + + + + + rpcImu.magneticFieldFrd = magneticFieldFrd.rpcMagneticFieldFrd + + + + + rpcImu.temperatureDegc = temperatureDegc + + + + + rpcImu.timestampUs = timestampUs + + + + return rpcImu + } + + internal static func translateFromRpc(_ rpcImu: Mavsdk_Rpc_TelemetryServer_Imu) -> Imu { + return Imu(accelerationFrd: AccelerationFrd.translateFromRpc(rpcImu.accelerationFrd), angularVelocityFrd: AngularVelocityFrd.translateFromRpc(rpcImu.angularVelocityFrd), magneticFieldFrd: MagneticFieldFrd.translateFromRpc(rpcImu.magneticFieldFrd), temperatureDegc: rpcImu.temperatureDegc, timestampUs: rpcImu.timestampUs) + } + + public static func == (lhs: Imu, rhs: Imu) -> Bool { + return lhs.accelerationFrd == rhs.accelerationFrd + && lhs.angularVelocityFrd == rhs.angularVelocityFrd + && lhs.magneticFieldFrd == rhs.magneticFieldFrd + && lhs.temperatureDegc == rhs.temperatureDegc + && lhs.timestampUs == rhs.timestampUs + } + } + + /** + Result type. + */ + public struct TelemetryServerResult: Equatable { + public let result: Result + public let resultStr: String + + + + + /** + Possible results returned for telemetry requests. + */ + public enum Result: Equatable { + /// Unknown result. + case unknown + /// Success: the telemetry command was accepted by the vehicle. + case success + /// No system connected. + case noSystem + /// Connection error. + case connectionError + /// Vehicle is busy. + case busy + /// Command refused by vehicle. + case commandDenied + /// Request timed out. + case timeout + /// Request not supported. + case unsupported + case UNRECOGNIZED(Int) + + internal var rpcResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result { + switch self { + case .unknown: + return .unknown + case .success: + return .success + case .noSystem: + return .noSystem + case .connectionError: + return .connectionError + case .busy: + return .busy + case .commandDenied: + return .commandDenied + case .timeout: + return .timeout + case .unsupported: + return .unsupported + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + + internal static func translateFromRpc(_ rpcResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result) -> Result { + switch rpcResult { + case .unknown: + return .unknown + case .success: + return .success + case .noSystem: + return .noSystem + case .connectionError: + return .connectionError + case .busy: + return .busy + case .commandDenied: + return .commandDenied + case .timeout: + return .timeout + case .unsupported: + return .unsupported + case .UNRECOGNIZED(let i): + return .UNRECOGNIZED(i) + } + } + } + + + /** + Initializes a new `TelemetryServerResult`. + + + - Parameters: + + - result: Result enum value + + - resultStr: Human-readable English string describing the result + + + */ + public init(result: Result, resultStr: String) { + self.result = result + self.resultStr = resultStr + } + + internal var rpcTelemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + var rpcTelemetryServerResult = Mavsdk_Rpc_TelemetryServer_TelemetryServerResult() + + + rpcTelemetryServerResult.result = result.rpcResult + + + + + rpcTelemetryServerResult.resultStr = resultStr + + + + return rpcTelemetryServerResult + } + + internal static func translateFromRpc(_ rpcTelemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult) -> TelemetryServerResult { + return TelemetryServerResult(result: Result.translateFromRpc(rpcTelemetryServerResult.result), resultStr: rpcTelemetryServerResult.resultStr) + } + + public static func == (lhs: TelemetryServerResult, rhs: TelemetryServerResult) -> Bool { + return lhs.result == rhs.result + && lhs.resultStr == rhs.resultStr + } + } + + + /** + Publish to 'position' updates. + + - Parameters: + - position: The next position + - velocityNed: The next velocity (NED) + + */ + public func publishPosition(position: Position, velocityNed: VelocityNed) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishPositionRequest() + + + + request.position = position.rpcPosition + + + + request.velocityNed = velocityNed.rpcVelocityNed + + + + do { + + let response = self.service.publishPosition(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'home position' updates. + + - Parameter home: The next home position + + */ + public func publishHome(home: Position) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishHomeRequest() + + + + request.home = home.rpcPosition + + + + do { + + let response = self.service.publishHome(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to armed updates. + + - Parameter isArmed: The next 'armed' state + + */ + public func publishArmed(isArmed: Bool) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishArmedRequest() + + + + request.isArmed = isArmed + + + + do { + + let response = self.service.publishArmed(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'Raw GPS' updates. + + - Parameters: + - rawGps: The next 'Raw GPS' state. Warning: this is an advanced feature, use `Position` updates to get the location of the drone! + - gpsInfo: The next 'GPS info' state + + */ + public func publishRawGps(rawGps: RawGps, gpsInfo: GpsInfo) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest() + + + + request.rawGps = rawGps.rpcRawGps + + + + request.gpsInfo = gpsInfo.rpcGpsInfo + + + + do { + + let response = self.service.publishRawGps(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'battery' updates. + + - Parameter battery: The next 'battery' state + + */ + public func publishBattery(battery: Battery) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest() + + + + request.battery = battery.rpcBattery + + + + do { + + let response = self.service.publishBattery(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'flight mode' updates. + + - Parameter flightMode: The next flight mode + + */ + public func publishFlightMode(flightMode: FlightMode) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest() + + + + request.flightMode = flightMode.rpcFlightMode + + + + do { + + let response = self.service.publishFlightMode(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'health' updates. + + - Parameter health: The next 'health' state + + */ + public func publishHealth(health: Health) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishHealthRequest() + + + + request.health = health.rpcHealth + + + + do { + + let response = self.service.publishHealth(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'status text' updates. + + - Parameter statusText: The next 'status text' + + */ + public func publishStatusText(statusText: StatusText) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest() + + + + request.statusText = statusText.rpcStatusText + + + + do { + + let response = self.service.publishStatusText(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'odometry' updates. + + - Parameter odometry: The next odometry status + + */ + public func publishOdometry(odometry: Odometry) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest() + + + + request.odometry = odometry.rpcOdometry + + + + do { + + let response = self.service.publishOdometry(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'position velocity' updates. + + - Parameter positionVelocityNed: The next position and velocity status + + */ + public func publishPositionVelocityNed(positionVelocityNed: PositionVelocityNed) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest() + + + + request.positionVelocityNed = positionVelocityNed.rpcPositionVelocityNed + + + + do { + + let response = self.service.publishPositionVelocityNed(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'ground truth' updates. + + - Parameter groundTruth: Ground truth position information available in simulation + + */ + public func publishGroundTruth(groundTruth: GroundTruth) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest() + + + + request.groundTruth = groundTruth.rpcGroundTruth + + + + do { + + let response = self.service.publishGroundTruth(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'IMU' updates (in SI units in NED body frame). + + - Parameter imu: The next IMU status + + */ + public func publishImu(imu: Imu) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishImuRequest() + + + + request.imu = imu.rpcImu + + + + do { + + let response = self.service.publishImu(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'Scaled IMU' updates. + + - Parameter imu: The next scaled IMU status + + */ + public func publishScaledImu(imu: Imu) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest() + + + + request.imu = imu.rpcImu + + + + do { + + let response = self.service.publishScaledImu(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'Raw IMU' updates. + + - Parameter imu: The next raw IMU status + + */ + public func publishRawImu(imu: Imu) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest() + + + + request.imu = imu.rpcImu + + + + do { + + let response = self.service.publishRawImu(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'HealthAllOk' updates. + + - Parameter isHealthAllOk: The next 'health all ok' status + + */ + public func publishHealthAllOk(isHealthAllOk: Bool) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest() + + + + request.isHealthAllOk = isHealthAllOk + + + + do { + + let response = self.service.publishHealthAllOk(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } + + /** + Publish to 'unix epoch time' updates. + + - Parameter timeUs: The next 'unix epoch time' status + + */ + public func publishUnixEpochTime(timeUs: UInt64) -> Completable { + return Completable.create { completable in + var request = Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest() + + + + request.timeUs = timeUs + + + + do { + + let response = self.service.publishUnixEpochTime(request) + + let result = try response.response.wait().telemetryServerResult + if (result.result == Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result.success) { + completable(.completed) + } else { + completable(.error(TelemetryServerError(code: TelemetryServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) + } + + } catch { + completable(.error(error)) + } + + return Disposables.create() + } + } +} \ No newline at end of file diff --git a/Sources/Mavsdk/Generated/Tune.swift b/Sources/Mavsdk/Generated/Tune.swift index e9b739c..375761b 100644 --- a/Sources/Mavsdk/Generated/Tune.swift +++ b/Sources/Mavsdk/Generated/Tune.swift @@ -276,6 +276,8 @@ public class Tune { case tuneTooLong /// Failed to send the request. case error + /// No system connected. + case noSystem case UNRECOGNIZED(Int) internal var rpcResult: Mavsdk_Rpc_Tune_TuneResult.Result { @@ -290,6 +292,8 @@ public class Tune { return .tuneTooLong case .error: return .error + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } @@ -307,6 +311,8 @@ public class Tune { return .tuneTooLong case .error: return .error + case .noSystem: + return .noSystem case .UNRECOGNIZED(let i): return .UNRECOGNIZED(i) } diff --git a/Sources/Mavsdk/Generated/camera.pb.swift b/Sources/Mavsdk/Generated/camera.pb.swift index f05b763..9394006 100644 --- a/Sources/Mavsdk/Generated/camera.pb.swift +++ b/Sources/Mavsdk/Generated/camera.pb.swift @@ -765,7 +765,7 @@ struct Mavsdk_Rpc_Camera_CameraResult { /// Camera denied the command case denied // = 4 - /// An error has occured while executing the command + /// An error has occurred while executing the command case error // = 5 /// Command timed out @@ -773,6 +773,9 @@ struct Mavsdk_Rpc_Camera_CameraResult { /// Command has wrong argument(s) case wrongArgument // = 7 + + /// No system connected + case noSystem // = 8 case UNRECOGNIZED(Int) init() { @@ -789,6 +792,7 @@ struct Mavsdk_Rpc_Camera_CameraResult { case 5: self = .error case 6: self = .timeout case 7: self = .wrongArgument + case 8: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -803,6 +807,7 @@ struct Mavsdk_Rpc_Camera_CameraResult { case .error: return 5 case .timeout: return 6 case .wrongArgument: return 7 + case .noSystem: return 8 case .UNRECOGNIZED(let i): return i } } @@ -825,6 +830,7 @@ extension Mavsdk_Rpc_Camera_CameraResult.Result: CaseIterable { .error, .timeout, .wrongArgument, + .noSystem, ] } @@ -2429,6 +2435,7 @@ extension Mavsdk_Rpc_Camera_CameraResult.Result: SwiftProtobuf._ProtoNameProvidi 5: .same(proto: "RESULT_ERROR"), 6: .same(proto: "RESULT_TIMEOUT"), 7: .same(proto: "RESULT_WRONG_ARGUMENT"), + 8: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/core.grpc.swift b/Sources/Mavsdk/Generated/core.grpc.swift index ade667d..7f782be 100644 --- a/Sources/Mavsdk/Generated/core.grpc.swift +++ b/Sources/Mavsdk/Generated/core.grpc.swift @@ -25,7 +25,7 @@ import NIO import SwiftProtobuf -/// Access to the connection state and running plugins. +/// Access to the connection state and core configurations /// /// Usage: instantiate `Mavsdk_Rpc_Core_CoreServiceClient`, then call methods of this protocol to make API calls. internal protocol Mavsdk_Rpc_Core_CoreServiceClientProtocol: GRPCClient { @@ -38,10 +38,10 @@ internal protocol Mavsdk_Rpc_Core_CoreServiceClientProtocol: GRPCClient { handler: @escaping (Mavsdk_Rpc_Core_ConnectionStateResponse) -> Void ) -> ServerStreamingCall - func listRunningPlugins( - _ request: Mavsdk_Rpc_Core_ListRunningPluginsRequest, + func setMavlinkTimeout( + _ request: Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest, callOptions: CallOptions? - ) -> UnaryCall + ) -> UnaryCall } extension Mavsdk_Rpc_Core_CoreServiceClientProtocol { @@ -49,6 +49,7 @@ extension Mavsdk_Rpc_Core_CoreServiceClientProtocol { return "mavsdk.rpc.core.CoreService" } + /// /// Subscribe to 'connection state' updates. /// /// - Parameters: @@ -70,21 +71,27 @@ extension Mavsdk_Rpc_Core_CoreServiceClientProtocol { ) } - /// Get a list of currently running plugins. + /// + /// Set timeout of MAVLink transfers. + /// + /// The default timeout used is generally (0.5 seconds) seconds. + /// If MAVSDK is used on the same host this timeout can be reduced, while + /// if MAVSDK has to communicate over links with high latency it might + /// need to be increased to prevent timeouts. /// /// - Parameters: - /// - request: Request to send to ListRunningPlugins. + /// - request: Request to send to SetMavlinkTimeout. /// - callOptions: Call options. /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func listRunningPlugins( - _ request: Mavsdk_Rpc_Core_ListRunningPluginsRequest, + internal func setMavlinkTimeout( + _ request: Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest, callOptions: CallOptions? = nil - ) -> UnaryCall { + ) -> UnaryCall { return self.makeUnaryCall( - path: "/mavsdk.rpc.core.CoreService/ListRunningPlugins", + path: "/mavsdk.rpc.core.CoreService/SetMavlinkTimeout", request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeListRunningPluginsInterceptors() ?? [] + interceptors: self.interceptors?.makeSetMavlinkTimeoutInterceptors() ?? [] ) } } @@ -94,8 +101,8 @@ internal protocol Mavsdk_Rpc_Core_CoreServiceClientInterceptorFactoryProtocol { /// - Returns: Interceptors to use when invoking 'subscribeConnectionState'. func makeSubscribeConnectionStateInterceptors() -> [ClientInterceptor] - /// - Returns: Interceptors to use when invoking 'listRunningPlugins'. - func makeListRunningPluginsInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'setMavlinkTimeout'. + func makeSetMavlinkTimeoutInterceptors() -> [ClientInterceptor] } internal final class Mavsdk_Rpc_Core_CoreServiceClient: Mavsdk_Rpc_Core_CoreServiceClientProtocol { @@ -120,17 +127,24 @@ internal final class Mavsdk_Rpc_Core_CoreServiceClient: Mavsdk_Rpc_Core_CoreServ } } -/// Access to the connection state and running plugins. +/// Access to the connection state and core configurations /// /// To build a server, implement a class that conforms to this protocol. internal protocol Mavsdk_Rpc_Core_CoreServiceProvider: CallHandlerProvider { var interceptors: Mavsdk_Rpc_Core_CoreServiceServerInterceptorFactoryProtocol? { get } + /// /// Subscribe to 'connection state' updates. func subscribeConnectionState(request: Mavsdk_Rpc_Core_SubscribeConnectionStateRequest, context: StreamingResponseCallContext) -> EventLoopFuture - /// Get a list of currently running plugins. - func listRunningPlugins(request: Mavsdk_Rpc_Core_ListRunningPluginsRequest, context: StatusOnlyCallContext) -> EventLoopFuture + /// + /// Set timeout of MAVLink transfers. + /// + /// The default timeout used is generally (0.5 seconds) seconds. + /// If MAVSDK is used on the same host this timeout can be reduced, while + /// if MAVSDK has to communicate over links with high latency it might + /// need to be increased to prevent timeouts. + func setMavlinkTimeout(request: Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest, context: StatusOnlyCallContext) -> EventLoopFuture } extension Mavsdk_Rpc_Core_CoreServiceProvider { @@ -152,13 +166,13 @@ extension Mavsdk_Rpc_Core_CoreServiceProvider { userFunction: self.subscribeConnectionState(request:context:) ) - case "ListRunningPlugins": + case "SetMavlinkTimeout": return UnaryServerHandler( context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeListRunningPluginsInterceptors() ?? [], - userFunction: self.listRunningPlugins(request:context:) + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeSetMavlinkTimeoutInterceptors() ?? [], + userFunction: self.setMavlinkTimeout(request:context:) ) default: @@ -173,7 +187,7 @@ internal protocol Mavsdk_Rpc_Core_CoreServiceServerInterceptorFactoryProtocol { /// Defaults to calling `self.makeInterceptors()`. func makeSubscribeConnectionStateInterceptors() -> [ServerInterceptor] - /// - Returns: Interceptors to use when handling 'listRunningPlugins'. + /// - Returns: Interceptors to use when handling 'setMavlinkTimeout'. /// Defaults to calling `self.makeInterceptors()`. - func makeListRunningPluginsInterceptors() -> [ServerInterceptor] + func makeSetMavlinkTimeoutInterceptors() -> [ServerInterceptor] } diff --git a/Sources/Mavsdk/Generated/core.pb.swift b/Sources/Mavsdk/Generated/core.pb.swift index 8b9ca12..39e0463 100644 --- a/Sources/Mavsdk/Generated/core.pb.swift +++ b/Sources/Mavsdk/Generated/core.pb.swift @@ -52,24 +52,24 @@ struct Mavsdk_Rpc_Core_ConnectionStateResponse { fileprivate var _connectionState: Mavsdk_Rpc_Core_ConnectionState? = nil } -struct Mavsdk_Rpc_Core_ListRunningPluginsRequest { +struct Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Timeout in seconds + var timeoutS: Double = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct Mavsdk_Rpc_Core_ListRunningPluginsResponse { +struct Mavsdk_Rpc_Core_SetMavlinkTimeoutResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Plugin info - var pluginInfo: [Mavsdk_Rpc_Core_PluginInfo] = [] - var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -89,26 +89,6 @@ struct Mavsdk_Rpc_Core_ConnectionState { init() {} } -/// Plugin info type. -struct Mavsdk_Rpc_Core_PluginInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the plugin - var name: String = String() - - /// Address where the plugin is running - var address: String = String() - - /// Port where the plugin is running - var port: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "mavsdk.rpc.core" @@ -164,29 +144,10 @@ extension Mavsdk_Rpc_Core_ConnectionStateResponse: SwiftProtobuf.Message, SwiftP } } -extension Mavsdk_Rpc_Core_ListRunningPluginsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ListRunningPluginsRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_Core_ListRunningPluginsRequest, rhs: Mavsdk_Rpc_Core_ListRunningPluginsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_Core_ListRunningPluginsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ListRunningPluginsResponse" +extension Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SetMavlinkTimeoutRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "plugin_info"), + 1: .standard(proto: "timeout_s"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -195,64 +156,49 @@ extension Mavsdk_Rpc_Core_ListRunningPluginsResponse: SwiftProtobuf.Message, Swi // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.pluginInfo) }() + case 1: try { try decoder.decodeSingularDoubleField(value: &self.timeoutS) }() default: break } } } func traverse(visitor: inout V) throws { - if !self.pluginInfo.isEmpty { - try visitor.visitRepeatedMessageField(value: self.pluginInfo, fieldNumber: 1) + if self.timeoutS != 0 { + try visitor.visitSingularDoubleField(value: self.timeoutS, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Mavsdk_Rpc_Core_ListRunningPluginsResponse, rhs: Mavsdk_Rpc_Core_ListRunningPluginsResponse) -> Bool { - if lhs.pluginInfo != rhs.pluginInfo {return false} + static func ==(lhs: Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest, rhs: Mavsdk_Rpc_Core_SetMavlinkTimeoutRequest) -> Bool { + if lhs.timeoutS != rhs.timeoutS {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Mavsdk_Rpc_Core_ConnectionState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ConnectionState" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .standard(proto: "is_connected"), - ] +extension Mavsdk_Rpc_Core_SetMavlinkTimeoutResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SetMavlinkTimeoutResponse" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeSingularBoolField(value: &self.isConnected) }() - default: break - } + while let _ = try decoder.nextFieldNumber() { } } func traverse(visitor: inout V) throws { - if self.isConnected != false { - try visitor.visitSingularBoolField(value: self.isConnected, fieldNumber: 2) - } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Mavsdk_Rpc_Core_ConnectionState, rhs: Mavsdk_Rpc_Core_ConnectionState) -> Bool { - if lhs.isConnected != rhs.isConnected {return false} + static func ==(lhs: Mavsdk_Rpc_Core_SetMavlinkTimeoutResponse, rhs: Mavsdk_Rpc_Core_SetMavlinkTimeoutResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Mavsdk_Rpc_Core_PluginInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PluginInfo" +extension Mavsdk_Rpc_Core_ConnectionState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ConnectionState" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "address"), - 3: .same(proto: "port"), + 2: .standard(proto: "is_connected"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -261,31 +207,21 @@ extension Mavsdk_Rpc_Core_PluginInfo: SwiftProtobuf.Message, SwiftProtobuf._Mess // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.address) }() - case 3: try { try decoder.decodeSingularInt32Field(value: &self.port) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.isConnected) }() default: break } } } func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.address.isEmpty { - try visitor.visitSingularStringField(value: self.address, fieldNumber: 2) - } - if self.port != 0 { - try visitor.visitSingularInt32Field(value: self.port, fieldNumber: 3) + if self.isConnected != false { + try visitor.visitSingularBoolField(value: self.isConnected, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Mavsdk_Rpc_Core_PluginInfo, rhs: Mavsdk_Rpc_Core_PluginInfo) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.address != rhs.address {return false} - if lhs.port != rhs.port {return false} + static func ==(lhs: Mavsdk_Rpc_Core_ConnectionState, rhs: Mavsdk_Rpc_Core_ConnectionState) -> Bool { + if lhs.isConnected != rhs.isConnected {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Sources/Mavsdk/Generated/follow_me.pb.swift b/Sources/Mavsdk/Generated/follow_me.pb.swift index 1aa30f1..51cd984 100644 --- a/Sources/Mavsdk/Generated/follow_me.pb.swift +++ b/Sources/Mavsdk/Generated/follow_me.pb.swift @@ -387,7 +387,7 @@ struct Mavsdk_Rpc_FollowMe_FollowMeResult { enum Result: SwiftProtobuf.Enum { typealias RawValue = Int - /// Unkown result + /// Unknown result case unknown // = 0 /// Request succeeded diff --git a/Sources/Mavsdk/Generated/ftp.pb.swift b/Sources/Mavsdk/Generated/ftp.pb.swift index 525100a..53bb189 100644 --- a/Sources/Mavsdk/Generated/ftp.pb.swift +++ b/Sources/Mavsdk/Generated/ftp.pb.swift @@ -524,6 +524,9 @@ struct Mavsdk_Rpc_Ftp_FtpResult { /// General protocol error case protocolError // = 11 + + /// No system connected + case noSystem // = 12 case UNRECOGNIZED(Int) init() { @@ -544,6 +547,7 @@ struct Mavsdk_Rpc_Ftp_FtpResult { case 9: self = .invalidParameter case 10: self = .unsupported case 11: self = .protocolError + case 12: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -562,6 +566,7 @@ struct Mavsdk_Rpc_Ftp_FtpResult { case .invalidParameter: return 9 case .unsupported: return 10 case .protocolError: return 11 + case .noSystem: return 12 case .UNRECOGNIZED(let i): return i } } @@ -588,6 +593,7 @@ extension Mavsdk_Rpc_Ftp_FtpResult.Result: CaseIterable { .invalidParameter, .unsupported, .protocolError, + .noSystem, ] } @@ -1477,5 +1483,6 @@ extension Mavsdk_Rpc_Ftp_FtpResult.Result: SwiftProtobuf._ProtoNameProviding { 9: .same(proto: "RESULT_INVALID_PARAMETER"), 10: .same(proto: "RESULT_UNSUPPORTED"), 11: .same(proto: "RESULT_PROTOCOL_ERROR"), + 12: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/geofence.pb.swift b/Sources/Mavsdk/Generated/geofence.pb.swift index de12399..aac3b59 100644 --- a/Sources/Mavsdk/Generated/geofence.pb.swift +++ b/Sources/Mavsdk/Generated/geofence.pb.swift @@ -171,6 +171,9 @@ struct Mavsdk_Rpc_Geofence_GeofenceResult { /// Invalid argument case invalidArgument // = 6 + + /// No system connected + case noSystem // = 7 case UNRECOGNIZED(Int) init() { @@ -186,6 +189,7 @@ struct Mavsdk_Rpc_Geofence_GeofenceResult { case 4: self = .busy case 5: self = .timeout case 6: self = .invalidArgument + case 7: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -199,6 +203,7 @@ struct Mavsdk_Rpc_Geofence_GeofenceResult { case .busy: return 4 case .timeout: return 5 case .invalidArgument: return 6 + case .noSystem: return 7 case .UNRECOGNIZED(let i): return i } } @@ -220,6 +225,7 @@ extension Mavsdk_Rpc_Geofence_GeofenceResult.Result: CaseIterable { .busy, .timeout, .invalidArgument, + .noSystem, ] } @@ -423,5 +429,6 @@ extension Mavsdk_Rpc_Geofence_GeofenceResult.Result: SwiftProtobuf._ProtoNamePro 4: .same(proto: "RESULT_BUSY"), 5: .same(proto: "RESULT_TIMEOUT"), 6: .same(proto: "RESULT_INVALID_ARGUMENT"), + 7: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/gimbal.pb.swift b/Sources/Mavsdk/Generated/gimbal.pb.swift index aba4bc9..2d76b1d 100644 --- a/Sources/Mavsdk/Generated/gimbal.pb.swift +++ b/Sources/Mavsdk/Generated/gimbal.pb.swift @@ -419,6 +419,9 @@ struct Mavsdk_Rpc_Gimbal_GimbalResult { /// Functionality not supported case unsupported // = 4 + + /// No system connected + case noSystem // = 5 case UNRECOGNIZED(Int) init() { @@ -432,6 +435,7 @@ struct Mavsdk_Rpc_Gimbal_GimbalResult { case 2: self = .error case 3: self = .timeout case 4: self = .unsupported + case 5: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -443,6 +447,7 @@ struct Mavsdk_Rpc_Gimbal_GimbalResult { case .error: return 2 case .timeout: return 3 case .unsupported: return 4 + case .noSystem: return 5 case .UNRECOGNIZED(let i): return i } } @@ -462,6 +467,7 @@ extension Mavsdk_Rpc_Gimbal_GimbalResult.Result: CaseIterable { .error, .timeout, .unsupported, + .noSystem, ] } @@ -1033,5 +1039,6 @@ extension Mavsdk_Rpc_Gimbal_GimbalResult.Result: SwiftProtobuf._ProtoNameProvidi 2: .same(proto: "RESULT_ERROR"), 3: .same(proto: "RESULT_TIMEOUT"), 4: .same(proto: "RESULT_UNSUPPORTED"), + 5: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/info.pb.swift b/Sources/Mavsdk/Generated/info.pb.swift index 3ba6aa8..996f0e7 100644 --- a/Sources/Mavsdk/Generated/info.pb.swift +++ b/Sources/Mavsdk/Generated/info.pb.swift @@ -349,6 +349,9 @@ struct Mavsdk_Rpc_Info_InfoResult { /// Information has not been received yet case informationNotReceivedYet // = 2 + + /// No system is connected + case noSystem // = 3 case UNRECOGNIZED(Int) init() { @@ -360,6 +363,7 @@ struct Mavsdk_Rpc_Info_InfoResult { case 0: self = .unknown case 1: self = .success case 2: self = .informationNotReceivedYet + case 3: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -369,6 +373,7 @@ struct Mavsdk_Rpc_Info_InfoResult { case .unknown: return 0 case .success: return 1 case .informationNotReceivedYet: return 2 + case .noSystem: return 3 case .UNRECOGNIZED(let i): return i } } @@ -386,6 +391,7 @@ extension Mavsdk_Rpc_Info_InfoResult.Result: CaseIterable { .unknown, .success, .informationNotReceivedYet, + .noSystem, ] } @@ -941,5 +947,6 @@ extension Mavsdk_Rpc_Info_InfoResult.Result: SwiftProtobuf._ProtoNameProviding { 0: .same(proto: "RESULT_UNKNOWN"), 1: .same(proto: "RESULT_SUCCESS"), 2: .same(proto: "RESULT_INFORMATION_NOT_RECEIVED_YET"), + 3: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/log_files.pb.swift b/Sources/Mavsdk/Generated/log_files.pb.swift index c12e0e3..6aa9d87 100644 --- a/Sources/Mavsdk/Generated/log_files.pb.swift +++ b/Sources/Mavsdk/Generated/log_files.pb.swift @@ -184,6 +184,9 @@ struct Mavsdk_Rpc_LogFiles_LogFilesResult { /// File open failed case fileOpenFailed // = 6 + + /// No system is connected + case noSystem // = 7 case UNRECOGNIZED(Int) init() { @@ -199,6 +202,7 @@ struct Mavsdk_Rpc_LogFiles_LogFilesResult { case 4: self = .timeout case 5: self = .invalidArgument case 6: self = .fileOpenFailed + case 7: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -212,6 +216,7 @@ struct Mavsdk_Rpc_LogFiles_LogFilesResult { case .timeout: return 4 case .invalidArgument: return 5 case .fileOpenFailed: return 6 + case .noSystem: return 7 case .UNRECOGNIZED(let i): return i } } @@ -233,6 +238,7 @@ extension Mavsdk_Rpc_LogFiles_LogFilesResult.Result: CaseIterable { .timeout, .invalidArgument, .fileOpenFailed, + .noSystem, ] } @@ -498,5 +504,6 @@ extension Mavsdk_Rpc_LogFiles_LogFilesResult.Result: SwiftProtobuf._ProtoNamePro 4: .same(proto: "RESULT_TIMEOUT"), 5: .same(proto: "RESULT_INVALID_ARGUMENT"), 6: .same(proto: "RESULT_FILE_OPEN_FAILED"), + 7: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/mission.pb.swift b/Sources/Mavsdk/Generated/mission.pb.swift index 6dc9678..7593968 100644 --- a/Sources/Mavsdk/Generated/mission.pb.swift +++ b/Sources/Mavsdk/Generated/mission.pb.swift @@ -470,6 +470,12 @@ struct Mavsdk_Rpc_Mission_MissionItem { /// Camera photo interval to use after this mission item (in seconds) var cameraPhotoIntervalS: Double = 0 + /// Radius for completing a mission item (in metres) + var acceptanceRadiusM: Float = 0 + + /// Absolute yaw angle (in degrees) + var yawDeg: Float = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() /// Possible camera actions at a mission item. @@ -625,6 +631,9 @@ struct Mavsdk_Rpc_Mission_MissionResult { /// Mission transfer (upload or download) has been cancelled case transferCancelled // = 12 + + /// No system connected + case noSystem // = 13 case UNRECOGNIZED(Int) init() { @@ -644,6 +653,7 @@ struct Mavsdk_Rpc_Mission_MissionResult { case 8: self = .noMissionAvailable case 11: self = .unsupportedMissionCmd case 12: self = .transferCancelled + case 13: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -661,6 +671,7 @@ struct Mavsdk_Rpc_Mission_MissionResult { case .noMissionAvailable: return 8 case .unsupportedMissionCmd: return 11 case .transferCancelled: return 12 + case .noSystem: return 13 case .UNRECOGNIZED(let i): return i } } @@ -686,6 +697,7 @@ extension Mavsdk_Rpc_Mission_MissionResult.Result: CaseIterable { .noMissionAvailable, .unsupportedMissionCmd, .transferCancelled, + .noSystem, ] } @@ -1377,6 +1389,8 @@ extension Mavsdk_Rpc_Mission_MissionItem: SwiftProtobuf.Message, SwiftProtobuf._ 8: .standard(proto: "camera_action"), 9: .standard(proto: "loiter_time_s"), 10: .standard(proto: "camera_photo_interval_s"), + 11: .standard(proto: "acceptance_radius_m"), + 12: .standard(proto: "yaw_deg"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1395,6 +1409,8 @@ extension Mavsdk_Rpc_Mission_MissionItem: SwiftProtobuf.Message, SwiftProtobuf._ case 8: try { try decoder.decodeSingularEnumField(value: &self.cameraAction) }() case 9: try { try decoder.decodeSingularFloatField(value: &self.loiterTimeS) }() case 10: try { try decoder.decodeSingularDoubleField(value: &self.cameraPhotoIntervalS) }() + case 11: try { try decoder.decodeSingularFloatField(value: &self.acceptanceRadiusM) }() + case 12: try { try decoder.decodeSingularFloatField(value: &self.yawDeg) }() default: break } } @@ -1431,6 +1447,12 @@ extension Mavsdk_Rpc_Mission_MissionItem: SwiftProtobuf.Message, SwiftProtobuf._ if self.cameraPhotoIntervalS != 0 { try visitor.visitSingularDoubleField(value: self.cameraPhotoIntervalS, fieldNumber: 10) } + if self.acceptanceRadiusM != 0 { + try visitor.visitSingularFloatField(value: self.acceptanceRadiusM, fieldNumber: 11) + } + if self.yawDeg != 0 { + try visitor.visitSingularFloatField(value: self.yawDeg, fieldNumber: 12) + } try unknownFields.traverse(visitor: &visitor) } @@ -1445,6 +1467,8 @@ extension Mavsdk_Rpc_Mission_MissionItem: SwiftProtobuf.Message, SwiftProtobuf._ if lhs.cameraAction != rhs.cameraAction {return false} if lhs.loiterTimeS != rhs.loiterTimeS {return false} if lhs.cameraPhotoIntervalS != rhs.cameraPhotoIntervalS {return false} + if lhs.acceptanceRadiusM != rhs.acceptanceRadiusM {return false} + if lhs.yawDeg != rhs.yawDeg {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1582,5 +1606,6 @@ extension Mavsdk_Rpc_Mission_MissionResult.Result: SwiftProtobuf._ProtoNameProvi 8: .same(proto: "RESULT_NO_MISSION_AVAILABLE"), 11: .same(proto: "RESULT_UNSUPPORTED_MISSION_CMD"), 12: .same(proto: "RESULT_TRANSFER_CANCELLED"), + 13: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/mission_raw.pb.swift b/Sources/Mavsdk/Generated/mission_raw.pb.swift index 732e9ff..66eda46 100644 --- a/Sources/Mavsdk/Generated/mission_raw.pb.swift +++ b/Sources/Mavsdk/Generated/mission_raw.pb.swift @@ -517,6 +517,9 @@ struct Mavsdk_Rpc_MissionRaw_MissionRawResult { /// Failed to parse the QGroundControl plan case failedToParseQgcPlan // = 11 + + /// No system connected + case noSystem // = 12 case UNRECOGNIZED(Int) init() { @@ -537,6 +540,7 @@ struct Mavsdk_Rpc_MissionRaw_MissionRawResult { case 9: self = .transferCancelled case 10: self = .failedToOpenQgcPlan case 11: self = .failedToParseQgcPlan + case 12: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -555,6 +559,7 @@ struct Mavsdk_Rpc_MissionRaw_MissionRawResult { case .transferCancelled: return 9 case .failedToOpenQgcPlan: return 10 case .failedToParseQgcPlan: return 11 + case .noSystem: return 12 case .UNRECOGNIZED(let i): return i } } @@ -581,6 +586,7 @@ extension Mavsdk_Rpc_MissionRaw_MissionRawResult.Result: CaseIterable { .transferCancelled, .failedToOpenQgcPlan, .failedToParseQgcPlan, + .noSystem, ] } @@ -1440,5 +1446,6 @@ extension Mavsdk_Rpc_MissionRaw_MissionRawResult.Result: SwiftProtobuf._ProtoNam 9: .same(proto: "RESULT_TRANSFER_CANCELLED"), 10: .same(proto: "RESULT_FAILED_TO_OPEN_QGC_PLAN"), 11: .same(proto: "RESULT_FAILED_TO_PARSE_QGC_PLAN"), + 12: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/param.pb.swift b/Sources/Mavsdk/Generated/param.pb.swift index fc43d82..1e708ec 100644 --- a/Sources/Mavsdk/Generated/param.pb.swift +++ b/Sources/Mavsdk/Generated/param.pb.swift @@ -219,7 +219,7 @@ struct Mavsdk_Rpc_Param_IntParam { } /// -/// Type for float paramters. +/// Type for float parameters. struct Mavsdk_Rpc_Param_FloatParam { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -289,6 +289,9 @@ struct Mavsdk_Rpc_Param_ParamResult { /// Parameter name too long (> 16) case paramNameTooLong // = 5 + + /// No system connected + case noSystem // = 6 case UNRECOGNIZED(Int) init() { @@ -303,6 +306,7 @@ struct Mavsdk_Rpc_Param_ParamResult { case 3: self = .connectionError case 4: self = .wrongType case 5: self = .paramNameTooLong + case 6: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -315,6 +319,7 @@ struct Mavsdk_Rpc_Param_ParamResult { case .connectionError: return 3 case .wrongType: return 4 case .paramNameTooLong: return 5 + case .noSystem: return 6 case .UNRECOGNIZED(let i): return i } } @@ -335,6 +340,7 @@ extension Mavsdk_Rpc_Param_ParamResult.Result: CaseIterable { .connectionError, .wrongType, .paramNameTooLong, + .noSystem, ] } @@ -835,5 +841,6 @@ extension Mavsdk_Rpc_Param_ParamResult.Result: SwiftProtobuf._ProtoNameProviding 3: .same(proto: "RESULT_CONNECTION_ERROR"), 4: .same(proto: "RESULT_WRONG_TYPE"), 5: .same(proto: "RESULT_PARAM_NAME_TOO_LONG"), + 6: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/Generated/param_server.grpc.swift b/Sources/Mavsdk/Generated/param_server.grpc.swift new file mode 100644 index 0000000..cd16438 --- /dev/null +++ b/Sources/Mavsdk/Generated/param_server.grpc.swift @@ -0,0 +1,327 @@ +// +// DO NOT EDIT. +// +// Generated by the protocol buffer compiler. +// Source: param_server.proto +// + +// +// Copyright 2018, gRPC Authors All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import GRPC +import NIO +import SwiftProtobuf + + +/// Provide raw access to retrieve and provide server parameters. +/// +/// Usage: instantiate `Mavsdk_Rpc_ParamServer_ParamServerServiceClient`, then call methods of this protocol to make API calls. +internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol: GRPCClient { + var serviceName: String { get } + var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? { get } + + func retrieveParamInt( + _ request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func provideParamInt( + _ request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func retrieveParamFloat( + _ request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func provideParamFloat( + _ request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func retrieveAllParams( + _ request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, + callOptions: CallOptions? + ) -> UnaryCall +} + +extension Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol { + internal var serviceName: String { + return "mavsdk.rpc.param_server.ParamServerService" + } + + /// + /// Retrieve an int parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + /// + /// - Parameters: + /// - request: Request to send to RetrieveParamInt. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func retrieveParamInt( + _ request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveParamInt", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeRetrieveParamIntInterceptors() ?? [] + ) + } + + /// + /// Provide an int parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + /// + /// - Parameters: + /// - request: Request to send to ProvideParamInt. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func provideParamInt( + _ request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.param_server.ParamServerService/ProvideParamInt", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeProvideParamIntInterceptors() ?? [] + ) + } + + /// + /// Retrieve a float parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + /// + /// - Parameters: + /// - request: Request to send to RetrieveParamFloat. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func retrieveParamFloat( + _ request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveParamFloat", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeRetrieveParamFloatInterceptors() ?? [] + ) + } + + /// + /// Provide a float parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + /// + /// - Parameters: + /// - request: Request to send to ProvideParamFloat. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func provideParamFloat( + _ request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.param_server.ParamServerService/ProvideParamFloat", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeProvideParamFloatInterceptors() ?? [] + ) + } + + /// + /// Retrieve all parameters. + /// + /// - Parameters: + /// - request: Request to send to RetrieveAllParams. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func retrieveAllParams( + _ request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveAllParams", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeRetrieveAllParamsInterceptors() ?? [] + ) + } +} + +internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol { + + /// - Returns: Interceptors to use when invoking 'retrieveParamInt'. + func makeRetrieveParamIntInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'provideParamInt'. + func makeProvideParamIntInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'retrieveParamFloat'. + func makeRetrieveParamFloatInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'provideParamFloat'. + func makeProvideParamFloatInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'retrieveAllParams'. + func makeRetrieveAllParamsInterceptors() -> [ClientInterceptor] +} + +internal final class Mavsdk_Rpc_ParamServer_ParamServerServiceClient: Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol { + internal let channel: GRPCChannel + internal var defaultCallOptions: CallOptions + internal var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? + + /// Creates a client for the mavsdk.rpc.param_server.ParamServerService service. + /// + /// - Parameters: + /// - channel: `GRPCChannel` to the service host. + /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. + /// - interceptors: A factory providing interceptors for each RPC. + internal init( + channel: GRPCChannel, + defaultCallOptions: CallOptions = CallOptions(), + interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? = nil + ) { + self.channel = channel + self.defaultCallOptions = defaultCallOptions + self.interceptors = interceptors + } +} + +/// Provide raw access to retrieve and provide server parameters. +/// +/// To build a server, implement a class that conforms to this protocol. +internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceProvider: CallHandlerProvider { + var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceServerInterceptorFactoryProtocol? { get } + + /// + /// Retrieve an int parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + func retrieveParamInt(request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// + /// Provide an int parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + func provideParamInt(request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// + /// Retrieve a float parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + func retrieveParamFloat(request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// + /// Provide a float parameter. + /// + /// If the type is wrong, the result will be `WRONG_TYPE`. + func provideParamFloat(request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// + /// Retrieve all parameters. + func retrieveAllParams(request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, context: StatusOnlyCallContext) -> EventLoopFuture +} + +extension Mavsdk_Rpc_ParamServer_ParamServerServiceProvider { + internal var serviceName: Substring { return "mavsdk.rpc.param_server.ParamServerService" } + + /// Determines, calls and returns the appropriate request handler, depending on the request's method. + /// Returns nil for methods not handled by this service. + internal func handle( + method name: Substring, + context: CallHandlerContext + ) -> GRPCServerHandlerProtocol? { + switch name { + case "RetrieveParamInt": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeRetrieveParamIntInterceptors() ?? [], + userFunction: self.retrieveParamInt(request:context:) + ) + + case "ProvideParamInt": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeProvideParamIntInterceptors() ?? [], + userFunction: self.provideParamInt(request:context:) + ) + + case "RetrieveParamFloat": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeRetrieveParamFloatInterceptors() ?? [], + userFunction: self.retrieveParamFloat(request:context:) + ) + + case "ProvideParamFloat": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeProvideParamFloatInterceptors() ?? [], + userFunction: self.provideParamFloat(request:context:) + ) + + case "RetrieveAllParams": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeRetrieveAllParamsInterceptors() ?? [], + userFunction: self.retrieveAllParams(request:context:) + ) + + default: + return nil + } + } +} + +internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceServerInterceptorFactoryProtocol { + + /// - Returns: Interceptors to use when handling 'retrieveParamInt'. + /// Defaults to calling `self.makeInterceptors()`. + func makeRetrieveParamIntInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'provideParamInt'. + /// Defaults to calling `self.makeInterceptors()`. + func makeProvideParamIntInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'retrieveParamFloat'. + /// Defaults to calling `self.makeInterceptors()`. + func makeRetrieveParamFloatInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'provideParamFloat'. + /// Defaults to calling `self.makeInterceptors()`. + func makeProvideParamFloatInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'retrieveAllParams'. + /// Defaults to calling `self.makeInterceptors()`. + func makeRetrieveAllParamsInterceptors() -> [ServerInterceptor] +} diff --git a/Sources/Mavsdk/Generated/param_server.pb.swift b/Sources/Mavsdk/Generated/param_server.pb.swift new file mode 100644 index 0000000..ac32802 --- /dev/null +++ b/Sources/Mavsdk/Generated/param_server.pb.swift @@ -0,0 +1,832 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: param_server.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter + var name: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { + get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} + set {_paramResult = newValue} + } + /// Returns true if `paramResult` has been explicitly set. + var hasParamResult: Bool {return self._paramResult != nil} + /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. + mutating func clearParamResult() {self._paramResult = nil} + + /// Value of the requested parameter + var value: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil +} + +struct Mavsdk_Rpc_ParamServer_ProvideParamIntRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter to provide + var name: String = String() + + /// Value the parameter should be set to + var value: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_ParamServer_ProvideParamIntResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { + get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} + set {_paramResult = newValue} + } + /// Returns true if `paramResult` has been explicitly set. + var hasParamResult: Bool {return self._paramResult != nil} + /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. + mutating func clearParamResult() {self._paramResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil +} + +struct Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter + var name: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { + get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} + set {_paramResult = newValue} + } + /// Returns true if `paramResult` has been explicitly set. + var hasParamResult: Bool {return self._paramResult != nil} + /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. + mutating func clearParamResult() {self._paramResult = nil} + + /// Value of the requested parameter + var value: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil +} + +struct Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter to provide + var name: String = String() + + /// Value the parameter should be set to + var value: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { + get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} + set {_paramResult = newValue} + } + /// Returns true if `paramResult` has been explicitly set. + var hasParamResult: Bool {return self._paramResult != nil} + /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. + mutating func clearParamResult() {self._paramResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil +} + +struct Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Collection of all parameters + var params: Mavsdk_Rpc_ParamServer_AllParams { + get {return _params ?? Mavsdk_Rpc_ParamServer_AllParams()} + set {_params = newValue} + } + /// Returns true if `params` has been explicitly set. + var hasParams: Bool {return self._params != nil} + /// Clears the value of `params`. Subsequent reads from it will return its default value. + mutating func clearParams() {self._params = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _params: Mavsdk_Rpc_ParamServer_AllParams? = nil +} + +/// +/// Type for integer parameters. +struct Mavsdk_Rpc_ParamServer_IntParam { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter + var name: String = String() + + /// Value of the parameter + var value: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Type for float parameters. +struct Mavsdk_Rpc_ParamServer_FloatParam { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Name of the parameter + var name: String = String() + + /// Value of the parameter + var value: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Type collecting all integer and float parameters. +struct Mavsdk_Rpc_ParamServer_AllParams { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Collection of all parameter names and values of type int + var intParams: [Mavsdk_Rpc_ParamServer_IntParam] = [] + + /// Collection of all parameter names and values of type float + var floatParams: [Mavsdk_Rpc_ParamServer_FloatParam] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Result type. +struct Mavsdk_Rpc_ParamServer_ParamServerResult { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Result enum value + var result: Mavsdk_Rpc_ParamServer_ParamServerResult.Result = .unknown + + /// Human-readable English string describing the result + var resultStr: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// Possible results returned for param requests. + enum Result: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Unknown result + case unknown // = 0 + + /// Request succeeded + case success // = 1 + + /// Not Found + case notFound // = 2 + + /// Wrong type + case wrongType // = 3 + + /// Parameter name too long (> 16) + case paramNameTooLong // = 4 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .success + case 2: self = .notFound + case 3: self = .wrongType + case 4: self = .paramNameTooLong + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .success: return 1 + case .notFound: return 2 + case .wrongType: return 3 + case .paramNameTooLong: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + } + + init() {} +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_ParamServer_ParamServerResult.Result: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_ParamServer_ParamServerResult.Result] = [ + .unknown, + .success, + .notFound, + .wrongType, + .paramNameTooLong, + ] +} + +#endif // swift(>=4.2) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "mavsdk.rpc.param_server" + +extension Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveParamIntRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveParamIntResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "param_result"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._paramResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse) -> Bool { + if lhs._paramResult != rhs._paramResult {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ProvideParamIntRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProvideParamIntRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, rhs: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ProvideParamIntResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProvideParamIntResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "param_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._paramResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamIntResponse, rhs: Mavsdk_Rpc_ParamServer_ProvideParamIntResponse) -> Bool { + if lhs._paramResult != rhs._paramResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveParamFloatRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveParamFloatResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "param_result"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._paramResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse) -> Bool { + if lhs._paramResult != rhs._paramResult {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProvideParamFloatRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, rhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProvideParamFloatResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "param_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._paramResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse, rhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse) -> Bool { + if lhs._paramResult != rhs._paramResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveAllParamsRequest" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RetrieveAllParamsResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "params"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._params) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._params { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse) -> Bool { + if lhs._params != rhs._params {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_IntParam: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".IntParam" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_IntParam, rhs: Mavsdk_Rpc_ParamServer_IntParam) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_FloatParam: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FloatParam" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_FloatParam, rhs: Mavsdk_Rpc_ParamServer_FloatParam) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_AllParams: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AllParams" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int_params"), + 2: .standard(proto: "float_params"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.intParams) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.floatParams) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.intParams.isEmpty { + try visitor.visitRepeatedMessageField(value: self.intParams, fieldNumber: 1) + } + if !self.floatParams.isEmpty { + try visitor.visitRepeatedMessageField(value: self.floatParams, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_AllParams, rhs: Mavsdk_Rpc_ParamServer_AllParams) -> Bool { + if lhs.intParams != rhs.intParams {return false} + if lhs.floatParams != rhs.floatParams {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ParamServerResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ParamServerResult" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "result"), + 2: .standard(proto: "result_str"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.resultStr) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.result != .unknown { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) + } + if !self.resultStr.isEmpty { + try visitor.visitSingularStringField(value: self.resultStr, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_ParamServer_ParamServerResult, rhs: Mavsdk_Rpc_ParamServer_ParamServerResult) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.resultStr != rhs.resultStr {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_ParamServer_ParamServerResult.Result: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "RESULT_UNKNOWN"), + 1: .same(proto: "RESULT_SUCCESS"), + 2: .same(proto: "RESULT_NOT_FOUND"), + 3: .same(proto: "RESULT_WRONG_TYPE"), + 4: .same(proto: "RESULT_PARAM_NAME_TOO_LONG"), + ] +} diff --git a/Sources/Mavsdk/Generated/telemetry.pb.swift b/Sources/Mavsdk/Generated/telemetry.pb.swift index 058dbaa..8e52d3c 100644 --- a/Sources/Mavsdk/Generated/telemetry.pb.swift +++ b/Sources/Mavsdk/Generated/telemetry.pb.swift @@ -2326,6 +2326,9 @@ struct Mavsdk_Rpc_Telemetry_Battery { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Battery ID, for systems with multiple batteries + var id: UInt32 = 0 + /// Voltage in volts var voltageV: Float = 0 @@ -2352,9 +2355,6 @@ struct Mavsdk_Rpc_Telemetry_Health { /// True if the magnetometer is calibrated var isMagnetometerCalibrationOk: Bool = false - /// True if the vehicle has a valid level calibration - var isLevelCalibrationOk: Bool = false - /// True if the local position estimate is good enough to fly in 'position control' mode var isLocalPositionOk: Bool = false @@ -2364,6 +2364,9 @@ struct Mavsdk_Rpc_Telemetry_Health { /// True if the home position has been initialized properly var isHomePositionOk: Bool = false + /// True if system can be armed + var isArmable: Bool = false + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -2381,7 +2384,7 @@ struct Mavsdk_Rpc_Telemetry_RcStatus { /// True if the RC signal is available now var isAvailable: Bool = false - /// Signal strength (range: 0 to 100) + /// Signal strength (range: 0 to 100, NaN if unknown) var signalStrengthPercent: Float = 0 var unknownFields = SwiftProtobuf.UnknownStorage() @@ -2682,10 +2685,10 @@ struct Mavsdk_Rpc_Telemetry_ScaledPressure { /// Differential pressure 1 in hPa var differentialPressureHpa: Float = 0 - /// Absolute pressure temperature (in celcius) + /// Absolute pressure temperature (in celsius) var temperatureDeg: Float = 0 - /// Differential pressure temperature (in celcius, 0 if not available) + /// Differential pressure temperature (in celsius, 0 if not available) var differentialPressureTemperatureDeg: Float = 0 var unknownFields = SwiftProtobuf.UnknownStorage() @@ -2976,6 +2979,9 @@ struct Mavsdk_Rpc_Telemetry_TelemetryResult { /// Request timed out case timeout // = 6 + + /// Request not supported + case unsupported // = 7 case UNRECOGNIZED(Int) init() { @@ -2991,6 +2997,7 @@ struct Mavsdk_Rpc_Telemetry_TelemetryResult { case 4: self = .busy case 5: self = .commandDenied case 6: self = .timeout + case 7: self = .unsupported default: self = .UNRECOGNIZED(rawValue) } } @@ -3004,6 +3011,7 @@ struct Mavsdk_Rpc_Telemetry_TelemetryResult { case .busy: return 4 case .commandDenied: return 5 case .timeout: return 6 + case .unsupported: return 7 case .UNRECOGNIZED(let i): return i } } @@ -3025,6 +3033,7 @@ extension Mavsdk_Rpc_Telemetry_TelemetryResult.Result: CaseIterable { .busy, .commandDenied, .timeout, + .unsupported, ] } @@ -6582,6 +6591,7 @@ extension Mavsdk_Rpc_Telemetry_RawGps: SwiftProtobuf.Message, SwiftProtobuf._Mes extension Mavsdk_Rpc_Telemetry_Battery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Battery" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 3: .same(proto: "id"), 1: .standard(proto: "voltage_v"), 2: .standard(proto: "remaining_percent"), ] @@ -6594,6 +6604,7 @@ extension Mavsdk_Rpc_Telemetry_Battery: SwiftProtobuf.Message, SwiftProtobuf._Me switch fieldNumber { case 1: try { try decoder.decodeSingularFloatField(value: &self.voltageV) }() case 2: try { try decoder.decodeSingularFloatField(value: &self.remainingPercent) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.id) }() default: break } } @@ -6606,10 +6617,14 @@ extension Mavsdk_Rpc_Telemetry_Battery: SwiftProtobuf.Message, SwiftProtobuf._Me if self.remainingPercent != 0 { try visitor.visitSingularFloatField(value: self.remainingPercent, fieldNumber: 2) } + if self.id != 0 { + try visitor.visitSingularUInt32Field(value: self.id, fieldNumber: 3) + } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Mavsdk_Rpc_Telemetry_Battery, rhs: Mavsdk_Rpc_Telemetry_Battery) -> Bool { + if lhs.id != rhs.id {return false} if lhs.voltageV != rhs.voltageV {return false} if lhs.remainingPercent != rhs.remainingPercent {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -6623,10 +6638,10 @@ extension Mavsdk_Rpc_Telemetry_Health: SwiftProtobuf.Message, SwiftProtobuf._Mes 1: .standard(proto: "is_gyrometer_calibration_ok"), 2: .standard(proto: "is_accelerometer_calibration_ok"), 3: .standard(proto: "is_magnetometer_calibration_ok"), - 4: .standard(proto: "is_level_calibration_ok"), 5: .standard(proto: "is_local_position_ok"), 6: .standard(proto: "is_global_position_ok"), 7: .standard(proto: "is_home_position_ok"), + 8: .standard(proto: "is_armable"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -6638,10 +6653,10 @@ extension Mavsdk_Rpc_Telemetry_Health: SwiftProtobuf.Message, SwiftProtobuf._Mes case 1: try { try decoder.decodeSingularBoolField(value: &self.isGyrometerCalibrationOk) }() case 2: try { try decoder.decodeSingularBoolField(value: &self.isAccelerometerCalibrationOk) }() case 3: try { try decoder.decodeSingularBoolField(value: &self.isMagnetometerCalibrationOk) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.isLevelCalibrationOk) }() case 5: try { try decoder.decodeSingularBoolField(value: &self.isLocalPositionOk) }() case 6: try { try decoder.decodeSingularBoolField(value: &self.isGlobalPositionOk) }() case 7: try { try decoder.decodeSingularBoolField(value: &self.isHomePositionOk) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self.isArmable) }() default: break } } @@ -6657,9 +6672,6 @@ extension Mavsdk_Rpc_Telemetry_Health: SwiftProtobuf.Message, SwiftProtobuf._Mes if self.isMagnetometerCalibrationOk != false { try visitor.visitSingularBoolField(value: self.isMagnetometerCalibrationOk, fieldNumber: 3) } - if self.isLevelCalibrationOk != false { - try visitor.visitSingularBoolField(value: self.isLevelCalibrationOk, fieldNumber: 4) - } if self.isLocalPositionOk != false { try visitor.visitSingularBoolField(value: self.isLocalPositionOk, fieldNumber: 5) } @@ -6669,6 +6681,9 @@ extension Mavsdk_Rpc_Telemetry_Health: SwiftProtobuf.Message, SwiftProtobuf._Mes if self.isHomePositionOk != false { try visitor.visitSingularBoolField(value: self.isHomePositionOk, fieldNumber: 7) } + if self.isArmable != false { + try visitor.visitSingularBoolField(value: self.isArmable, fieldNumber: 8) + } try unknownFields.traverse(visitor: &visitor) } @@ -6676,10 +6691,10 @@ extension Mavsdk_Rpc_Telemetry_Health: SwiftProtobuf.Message, SwiftProtobuf._Mes if lhs.isGyrometerCalibrationOk != rhs.isGyrometerCalibrationOk {return false} if lhs.isAccelerometerCalibrationOk != rhs.isAccelerometerCalibrationOk {return false} if lhs.isMagnetometerCalibrationOk != rhs.isMagnetometerCalibrationOk {return false} - if lhs.isLevelCalibrationOk != rhs.isLevelCalibrationOk {return false} if lhs.isLocalPositionOk != rhs.isLocalPositionOk {return false} if lhs.isGlobalPositionOk != rhs.isGlobalPositionOk {return false} if lhs.isHomePositionOk != rhs.isHomePositionOk {return false} + if lhs.isArmable != rhs.isArmable {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -7693,5 +7708,6 @@ extension Mavsdk_Rpc_Telemetry_TelemetryResult.Result: SwiftProtobuf._ProtoNameP 4: .same(proto: "RESULT_BUSY"), 5: .same(proto: "RESULT_COMMAND_DENIED"), 6: .same(proto: "RESULT_TIMEOUT"), + 7: .same(proto: "RESULT_UNSUPPORTED"), ] } diff --git a/Sources/Mavsdk/Generated/telemetry_server.grpc.swift b/Sources/Mavsdk/Generated/telemetry_server.grpc.swift new file mode 100644 index 0000000..b4903d0 --- /dev/null +++ b/Sources/Mavsdk/Generated/telemetry_server.grpc.swift @@ -0,0 +1,767 @@ +// +// DO NOT EDIT. +// +// Generated by the protocol buffer compiler. +// Source: telemetry_server.proto +// + +// +// Copyright 2018, gRPC Authors All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import GRPC +import NIO +import SwiftProtobuf + + +/// +/// Allow users to provide vehicle telemetry and state information +/// (e.g. battery, GPS, RC connection, flight mode etc.) and set telemetry update rates. +/// +/// Usage: instantiate `Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClient`, then call methods of this protocol to make API calls. +internal protocol Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientProtocol: GRPCClient { + var serviceName: String { get } + var interceptors: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientInterceptorFactoryProtocol? { get } + + func publishPosition( + _ request: Mavsdk_Rpc_TelemetryServer_PublishPositionRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishHome( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHomeRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishArmed( + _ request: Mavsdk_Rpc_TelemetryServer_PublishArmedRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishRawGps( + _ request: Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishBattery( + _ request: Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishFlightMode( + _ request: Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishHealth( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHealthRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishStatusText( + _ request: Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishOdometry( + _ request: Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishPositionVelocityNed( + _ request: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishGroundTruth( + _ request: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishImuRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishScaledImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishRawImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishHealthAllOk( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func publishUnixEpochTime( + _ request: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest, + callOptions: CallOptions? + ) -> UnaryCall +} + +extension Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientProtocol { + internal var serviceName: String { + return "mavsdk.rpc.telemetry_server.TelemetryServerService" + } + + /// Publish to 'position' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishPosition. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishPosition( + _ request: Mavsdk_Rpc_TelemetryServer_PublishPositionRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishPosition", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishPositionInterceptors() ?? [] + ) + } + + /// Publish to 'home position' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishHome. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishHome( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHomeRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishHome", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishHomeInterceptors() ?? [] + ) + } + + /// Publish to armed updates. + /// + /// - Parameters: + /// - request: Request to send to PublishArmed. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishArmed( + _ request: Mavsdk_Rpc_TelemetryServer_PublishArmedRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishArmed", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishArmedInterceptors() ?? [] + ) + } + + /// Publish to 'Raw GPS' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishRawGps. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishRawGps( + _ request: Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishRawGps", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishRawGpsInterceptors() ?? [] + ) + } + + /// Publish to 'battery' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishBattery. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishBattery( + _ request: Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishBattery", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishBatteryInterceptors() ?? [] + ) + } + + /// Publish to 'flight mode' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishFlightMode. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishFlightMode( + _ request: Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishFlightMode", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishFlightModeInterceptors() ?? [] + ) + } + + /// Publish to 'health' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishHealth. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishHealth( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHealthRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishHealth", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishHealthInterceptors() ?? [] + ) + } + + /// Publish to 'status text' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishStatusText. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishStatusText( + _ request: Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishStatusText", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishStatusTextInterceptors() ?? [] + ) + } + + /// Publish to 'odometry' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishOdometry. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishOdometry( + _ request: Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishOdometry", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishOdometryInterceptors() ?? [] + ) + } + + /// Publish to 'position velocity' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishPositionVelocityNed. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishPositionVelocityNed( + _ request: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishPositionVelocityNed", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishPositionVelocityNedInterceptors() ?? [] + ) + } + + /// Publish to 'ground truth' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishGroundTruth. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishGroundTruth( + _ request: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishGroundTruth", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishGroundTruthInterceptors() ?? [] + ) + } + + /// Publish to 'IMU' updates (in SI units in NED body frame). + /// + /// - Parameters: + /// - request: Request to send to PublishImu. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishImuRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishImu", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishImuInterceptors() ?? [] + ) + } + + /// Publish to 'Scaled IMU' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishScaledImu. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishScaledImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishScaledImu", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishScaledImuInterceptors() ?? [] + ) + } + + /// Publish to 'Raw IMU' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishRawImu. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishRawImu( + _ request: Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishRawImu", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishRawImuInterceptors() ?? [] + ) + } + + /// Publish to 'HealthAllOk' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishHealthAllOk. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishHealthAllOk( + _ request: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishHealthAllOk", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishHealthAllOkInterceptors() ?? [] + ) + } + + /// Publish to 'unix epoch time' updates. + /// + /// - Parameters: + /// - request: Request to send to PublishUnixEpochTime. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func publishUnixEpochTime( + _ request: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/mavsdk.rpc.telemetry_server.TelemetryServerService/PublishUnixEpochTime", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePublishUnixEpochTimeInterceptors() ?? [] + ) + } +} + +internal protocol Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientInterceptorFactoryProtocol { + + /// - Returns: Interceptors to use when invoking 'publishPosition'. + func makePublishPositionInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishHome'. + func makePublishHomeInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishArmed'. + func makePublishArmedInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishRawGps'. + func makePublishRawGpsInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishBattery'. + func makePublishBatteryInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishFlightMode'. + func makePublishFlightModeInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishHealth'. + func makePublishHealthInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishStatusText'. + func makePublishStatusTextInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishOdometry'. + func makePublishOdometryInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishPositionVelocityNed'. + func makePublishPositionVelocityNedInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishGroundTruth'. + func makePublishGroundTruthInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishImu'. + func makePublishImuInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishScaledImu'. + func makePublishScaledImuInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishRawImu'. + func makePublishRawImuInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishHealthAllOk'. + func makePublishHealthAllOkInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'publishUnixEpochTime'. + func makePublishUnixEpochTimeInterceptors() -> [ClientInterceptor] +} + +internal final class Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClient: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientProtocol { + internal let channel: GRPCChannel + internal var defaultCallOptions: CallOptions + internal var interceptors: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientInterceptorFactoryProtocol? + + /// Creates a client for the mavsdk.rpc.telemetry_server.TelemetryServerService service. + /// + /// - Parameters: + /// - channel: `GRPCChannel` to the service host. + /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. + /// - interceptors: A factory providing interceptors for each RPC. + internal init( + channel: GRPCChannel, + defaultCallOptions: CallOptions = CallOptions(), + interceptors: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceClientInterceptorFactoryProtocol? = nil + ) { + self.channel = channel + self.defaultCallOptions = defaultCallOptions + self.interceptors = interceptors + } +} + +/// +/// Allow users to provide vehicle telemetry and state information +/// (e.g. battery, GPS, RC connection, flight mode etc.) and set telemetry update rates. +/// +/// To build a server, implement a class that conforms to this protocol. +internal protocol Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceProvider: CallHandlerProvider { + var interceptors: Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceServerInterceptorFactoryProtocol? { get } + + /// Publish to 'position' updates. + func publishPosition(request: Mavsdk_Rpc_TelemetryServer_PublishPositionRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'home position' updates. + func publishHome(request: Mavsdk_Rpc_TelemetryServer_PublishHomeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to armed updates. + func publishArmed(request: Mavsdk_Rpc_TelemetryServer_PublishArmedRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'Raw GPS' updates. + func publishRawGps(request: Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'battery' updates. + func publishBattery(request: Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'flight mode' updates. + func publishFlightMode(request: Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'health' updates. + func publishHealth(request: Mavsdk_Rpc_TelemetryServer_PublishHealthRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'status text' updates. + func publishStatusText(request: Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'odometry' updates. + func publishOdometry(request: Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'position velocity' updates. + func publishPositionVelocityNed(request: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'ground truth' updates. + func publishGroundTruth(request: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'IMU' updates (in SI units in NED body frame). + func publishImu(request: Mavsdk_Rpc_TelemetryServer_PublishImuRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'Scaled IMU' updates. + func publishScaledImu(request: Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'Raw IMU' updates. + func publishRawImu(request: Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'HealthAllOk' updates. + func publishHealthAllOk(request: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + /// Publish to 'unix epoch time' updates. + func publishUnixEpochTime(request: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest, context: StatusOnlyCallContext) -> EventLoopFuture +} + +extension Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceProvider { + internal var serviceName: Substring { return "mavsdk.rpc.telemetry_server.TelemetryServerService" } + + /// Determines, calls and returns the appropriate request handler, depending on the request's method. + /// Returns nil for methods not handled by this service. + internal func handle( + method name: Substring, + context: CallHandlerContext + ) -> GRPCServerHandlerProtocol? { + switch name { + case "PublishPosition": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishPositionInterceptors() ?? [], + userFunction: self.publishPosition(request:context:) + ) + + case "PublishHome": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishHomeInterceptors() ?? [], + userFunction: self.publishHome(request:context:) + ) + + case "PublishArmed": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishArmedInterceptors() ?? [], + userFunction: self.publishArmed(request:context:) + ) + + case "PublishRawGps": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishRawGpsInterceptors() ?? [], + userFunction: self.publishRawGps(request:context:) + ) + + case "PublishBattery": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishBatteryInterceptors() ?? [], + userFunction: self.publishBattery(request:context:) + ) + + case "PublishFlightMode": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishFlightModeInterceptors() ?? [], + userFunction: self.publishFlightMode(request:context:) + ) + + case "PublishHealth": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishHealthInterceptors() ?? [], + userFunction: self.publishHealth(request:context:) + ) + + case "PublishStatusText": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishStatusTextInterceptors() ?? [], + userFunction: self.publishStatusText(request:context:) + ) + + case "PublishOdometry": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishOdometryInterceptors() ?? [], + userFunction: self.publishOdometry(request:context:) + ) + + case "PublishPositionVelocityNed": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishPositionVelocityNedInterceptors() ?? [], + userFunction: self.publishPositionVelocityNed(request:context:) + ) + + case "PublishGroundTruth": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishGroundTruthInterceptors() ?? [], + userFunction: self.publishGroundTruth(request:context:) + ) + + case "PublishImu": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishImuInterceptors() ?? [], + userFunction: self.publishImu(request:context:) + ) + + case "PublishScaledImu": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishScaledImuInterceptors() ?? [], + userFunction: self.publishScaledImu(request:context:) + ) + + case "PublishRawImu": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishRawImuInterceptors() ?? [], + userFunction: self.publishRawImu(request:context:) + ) + + case "PublishHealthAllOk": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishHealthAllOkInterceptors() ?? [], + userFunction: self.publishHealthAllOk(request:context:) + ) + + case "PublishUnixEpochTime": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePublishUnixEpochTimeInterceptors() ?? [], + userFunction: self.publishUnixEpochTime(request:context:) + ) + + default: + return nil + } + } +} + +internal protocol Mavsdk_Rpc_TelemetryServer_TelemetryServerServiceServerInterceptorFactoryProtocol { + + /// - Returns: Interceptors to use when handling 'publishPosition'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishPositionInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishHome'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishHomeInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishArmed'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishArmedInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishRawGps'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishRawGpsInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishBattery'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishBatteryInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishFlightMode'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishFlightModeInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishHealth'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishHealthInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishStatusText'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishStatusTextInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishOdometry'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishOdometryInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishPositionVelocityNed'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishPositionVelocityNedInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishGroundTruth'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishGroundTruthInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishImu'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishImuInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishScaledImu'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishScaledImuInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishRawImu'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishRawImuInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishHealthAllOk'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishHealthAllOkInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'publishUnixEpochTime'. + /// Defaults to calling `self.makeInterceptors()`. + func makePublishUnixEpochTimeInterceptors() -> [ServerInterceptor] +} diff --git a/Sources/Mavsdk/Generated/telemetry_server.pb.swift b/Sources/Mavsdk/Generated/telemetry_server.pb.swift new file mode 100644 index 0000000..2854f04 --- /dev/null +++ b/Sources/Mavsdk/Generated/telemetry_server.pb.swift @@ -0,0 +1,4578 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: telemetry_server.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +/// GPS fix type. +enum Mavsdk_Rpc_TelemetryServer_FixType: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// No GPS connected + case noGps // = 0 + + /// No position information, GPS is connected + case noFix // = 1 + + /// 2D position + case fix2D // = 2 + + /// 3D position + case fix3D // = 3 + + /// DGPS/SBAS aided 3D position + case fixDgps // = 4 + + /// RTK float, 3D position + case rtkFloat // = 5 + + /// RTK Fixed, 3D position + case rtkFixed // = 6 + case UNRECOGNIZED(Int) + + init() { + self = .noGps + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .noGps + case 1: self = .noFix + case 2: self = .fix2D + case 3: self = .fix3D + case 4: self = .fixDgps + case 5: self = .rtkFloat + case 6: self = .rtkFixed + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .noGps: return 0 + case .noFix: return 1 + case .fix2D: return 2 + case .fix3D: return 3 + case .fixDgps: return 4 + case .rtkFloat: return 5 + case .rtkFixed: return 6 + case .UNRECOGNIZED(let i): return i + } + } + +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_FixType: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_FixType] = [ + .noGps, + .noFix, + .fix2D, + .fix3D, + .fixDgps, + .rtkFloat, + .rtkFixed, + ] +} + +#endif // swift(>=4.2) + +/// +/// Flight modes. +/// +/// For more information about flight modes, check out +/// https://docs.px4.io/master/en/config/flight_mode.html. +enum Mavsdk_Rpc_TelemetryServer_FlightMode: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Mode not known + case unknown // = 0 + + /// Armed and ready to take off + case ready // = 1 + + /// Taking off + case takeoff // = 2 + + /// Holding (hovering in place (or circling for fixed-wing vehicles) + case hold // = 3 + + /// In mission + case mission // = 4 + + /// Returning to launch position (then landing) + case returnToLaunch // = 5 + + /// Landing + case land // = 6 + + /// In 'offboard' mode + case offboard // = 7 + + /// In 'follow-me' mode + case followMe // = 8 + + /// In 'Manual' mode + case manual // = 9 + + /// In 'Altitude Control' mode + case altctl // = 10 + + /// In 'Position Control' mode + case posctl // = 11 + + /// In 'Acro' mode + case acro // = 12 + + /// In 'Stabilize' mode + case stabilized // = 13 + + /// In 'Rattitude' mode + case rattitude // = 14 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .ready + case 2: self = .takeoff + case 3: self = .hold + case 4: self = .mission + case 5: self = .returnToLaunch + case 6: self = .land + case 7: self = .offboard + case 8: self = .followMe + case 9: self = .manual + case 10: self = .altctl + case 11: self = .posctl + case 12: self = .acro + case 13: self = .stabilized + case 14: self = .rattitude + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .ready: return 1 + case .takeoff: return 2 + case .hold: return 3 + case .mission: return 4 + case .returnToLaunch: return 5 + case .land: return 6 + case .offboard: return 7 + case .followMe: return 8 + case .manual: return 9 + case .altctl: return 10 + case .posctl: return 11 + case .acro: return 12 + case .stabilized: return 13 + case .rattitude: return 14 + case .UNRECOGNIZED(let i): return i + } + } + +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_FlightMode: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_FlightMode] = [ + .unknown, + .ready, + .takeoff, + .hold, + .mission, + .returnToLaunch, + .land, + .offboard, + .followMe, + .manual, + .altctl, + .posctl, + .acro, + .stabilized, + .rattitude, + ] +} + +#endif // swift(>=4.2) + +/// Status types. +enum Mavsdk_Rpc_TelemetryServer_StatusTextType: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Debug + case debug // = 0 + + /// Information + case info // = 1 + + /// Notice + case notice // = 2 + + /// Warning + case warning // = 3 + + /// Error + case error // = 4 + + /// Critical + case critical // = 5 + + /// Alert + case alert // = 6 + + /// Emergency + case emergency // = 7 + case UNRECOGNIZED(Int) + + init() { + self = .debug + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .debug + case 1: self = .info + case 2: self = .notice + case 3: self = .warning + case 4: self = .error + case 5: self = .critical + case 6: self = .alert + case 7: self = .emergency + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .debug: return 0 + case .info: return 1 + case .notice: return 2 + case .warning: return 3 + case .error: return 4 + case .critical: return 5 + case .alert: return 6 + case .emergency: return 7 + case .UNRECOGNIZED(let i): return i + } + } + +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_StatusTextType: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_StatusTextType] = [ + .debug, + .info, + .notice, + .warning, + .error, + .critical, + .alert, + .emergency, + ] +} + +#endif // swift(>=4.2) + +/// Landed State enumeration. +enum Mavsdk_Rpc_TelemetryServer_LandedState: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Landed state is unknown + case unknown // = 0 + + /// The vehicle is on the ground + case onGround // = 1 + + /// The vehicle is in the air + case inAir // = 2 + + /// The vehicle is taking off + case takingOff // = 3 + + /// The vehicle is landing + case landing // = 4 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .onGround + case 2: self = .inAir + case 3: self = .takingOff + case 4: self = .landing + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .onGround: return 1 + case .inAir: return 2 + case .takingOff: return 3 + case .landing: return 4 + case .UNRECOGNIZED(let i): return i + } + } + +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_LandedState: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_LandedState] = [ + .unknown, + .onGround, + .inAir, + .takingOff, + .landing, + ] +} + +#endif // swift(>=4.2) + +struct Mavsdk_Rpc_TelemetryServer_PublishPositionRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next position + var position: Mavsdk_Rpc_TelemetryServer_Position { + get {return _position ?? Mavsdk_Rpc_TelemetryServer_Position()} + set {_position = newValue} + } + /// Returns true if `position` has been explicitly set. + var hasPosition: Bool {return self._position != nil} + /// Clears the value of `position`. Subsequent reads from it will return its default value. + mutating func clearPosition() {self._position = nil} + + /// The next velocity (NED) + var velocityNed: Mavsdk_Rpc_TelemetryServer_VelocityNed { + get {return _velocityNed ?? Mavsdk_Rpc_TelemetryServer_VelocityNed()} + set {_velocityNed = newValue} + } + /// Returns true if `velocityNed` has been explicitly set. + var hasVelocityNed: Bool {return self._velocityNed != nil} + /// Clears the value of `velocityNed`. Subsequent reads from it will return its default value. + mutating func clearVelocityNed() {self._velocityNed = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _position: Mavsdk_Rpc_TelemetryServer_Position? = nil + fileprivate var _velocityNed: Mavsdk_Rpc_TelemetryServer_VelocityNed? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHomeRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next home position + var home: Mavsdk_Rpc_TelemetryServer_Position { + get {return _home ?? Mavsdk_Rpc_TelemetryServer_Position()} + set {_home = newValue} + } + /// Returns true if `home` has been explicitly set. + var hasHome: Bool {return self._home != nil} + /// Clears the value of `home`. Subsequent reads from it will return its default value. + mutating func clearHome() {self._home = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _home: Mavsdk_Rpc_TelemetryServer_Position? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishInAirRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'in-air' state + var isInAir: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishLandedStateRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'landed' state + var landedState: Mavsdk_Rpc_TelemetryServer_LandedState = .unknown + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishArmedRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'armed' state + var isArmed: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'Raw GPS' state. Warning: this is an advanced feature, use `Position` updates to get the location of the drone! + var rawGps: Mavsdk_Rpc_TelemetryServer_RawGps { + get {return _rawGps ?? Mavsdk_Rpc_TelemetryServer_RawGps()} + set {_rawGps = newValue} + } + /// Returns true if `rawGps` has been explicitly set. + var hasRawGps: Bool {return self._rawGps != nil} + /// Clears the value of `rawGps`. Subsequent reads from it will return its default value. + mutating func clearRawGps() {self._rawGps = nil} + + /// The next 'GPS info' state + var gpsInfo: Mavsdk_Rpc_TelemetryServer_GpsInfo { + get {return _gpsInfo ?? Mavsdk_Rpc_TelemetryServer_GpsInfo()} + set {_gpsInfo = newValue} + } + /// Returns true if `gpsInfo` has been explicitly set. + var hasGpsInfo: Bool {return self._gpsInfo != nil} + /// Clears the value of `gpsInfo`. Subsequent reads from it will return its default value. + mutating func clearGpsInfo() {self._gpsInfo = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _rawGps: Mavsdk_Rpc_TelemetryServer_RawGps? = nil + fileprivate var _gpsInfo: Mavsdk_Rpc_TelemetryServer_GpsInfo? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'battery' state + var battery: Mavsdk_Rpc_TelemetryServer_Battery { + get {return _battery ?? Mavsdk_Rpc_TelemetryServer_Battery()} + set {_battery = newValue} + } + /// Returns true if `battery` has been explicitly set. + var hasBattery: Bool {return self._battery != nil} + /// Clears the value of `battery`. Subsequent reads from it will return its default value. + mutating func clearBattery() {self._battery = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _battery: Mavsdk_Rpc_TelemetryServer_Battery? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next flight mode + var flightMode: Mavsdk_Rpc_TelemetryServer_FlightMode = .unknown + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHealthRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'health' state + var health: Mavsdk_Rpc_TelemetryServer_Health { + get {return _health ?? Mavsdk_Rpc_TelemetryServer_Health()} + set {_health = newValue} + } + /// Returns true if `health` has been explicitly set. + var hasHealth: Bool {return self._health != nil} + /// Clears the value of `health`. Subsequent reads from it will return its default value. + mutating func clearHealth() {self._health = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _health: Mavsdk_Rpc_TelemetryServer_Health? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishRcStatusRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next RC status + var rcStatus: Mavsdk_Rpc_TelemetryServer_RcStatus { + get {return _rcStatus ?? Mavsdk_Rpc_TelemetryServer_RcStatus()} + set {_rcStatus = newValue} + } + /// Returns true if `rcStatus` has been explicitly set. + var hasRcStatus: Bool {return self._rcStatus != nil} + /// Clears the value of `rcStatus`. Subsequent reads from it will return its default value. + mutating func clearRcStatus() {self._rcStatus = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _rcStatus: Mavsdk_Rpc_TelemetryServer_RcStatus? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'status text' + var statusText: Mavsdk_Rpc_TelemetryServer_StatusText { + get {return _statusText ?? Mavsdk_Rpc_TelemetryServer_StatusText()} + set {_statusText = newValue} + } + /// Returns true if `statusText` has been explicitly set. + var hasStatusText: Bool {return self._statusText != nil} + /// Clears the value of `statusText`. Subsequent reads from it will return its default value. + mutating func clearStatusText() {self._statusText = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _statusText: Mavsdk_Rpc_TelemetryServer_StatusText? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next odometry status + var odometry: Mavsdk_Rpc_TelemetryServer_Odometry { + get {return _odometry ?? Mavsdk_Rpc_TelemetryServer_Odometry()} + set {_odometry = newValue} + } + /// Returns true if `odometry` has been explicitly set. + var hasOdometry: Bool {return self._odometry != nil} + /// Clears the value of `odometry`. Subsequent reads from it will return its default value. + mutating func clearOdometry() {self._odometry = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _odometry: Mavsdk_Rpc_TelemetryServer_Odometry? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next position and velocity status + var positionVelocityNed: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed { + get {return _positionVelocityNed ?? Mavsdk_Rpc_TelemetryServer_PositionVelocityNed()} + set {_positionVelocityNed = newValue} + } + /// Returns true if `positionVelocityNed` has been explicitly set. + var hasPositionVelocityNed: Bool {return self._positionVelocityNed != nil} + /// Clears the value of `positionVelocityNed`. Subsequent reads from it will return its default value. + mutating func clearPositionVelocityNed() {self._positionVelocityNed = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _positionVelocityNed: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Ground truth position information available in simulation + var groundTruth: Mavsdk_Rpc_TelemetryServer_GroundTruth { + get {return _groundTruth ?? Mavsdk_Rpc_TelemetryServer_GroundTruth()} + set {_groundTruth = newValue} + } + /// Returns true if `groundTruth` has been explicitly set. + var hasGroundTruth: Bool {return self._groundTruth != nil} + /// Clears the value of `groundTruth`. Subsequent reads from it will return its default value. + mutating func clearGroundTruth() {self._groundTruth = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _groundTruth: Mavsdk_Rpc_TelemetryServer_GroundTruth? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishImuRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next IMU status + var imu: Mavsdk_Rpc_TelemetryServer_Imu { + get {return _imu ?? Mavsdk_Rpc_TelemetryServer_Imu()} + set {_imu = newValue} + } + /// Returns true if `imu` has been explicitly set. + var hasImu: Bool {return self._imu != nil} + /// Clears the value of `imu`. Subsequent reads from it will return its default value. + mutating func clearImu() {self._imu = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _imu: Mavsdk_Rpc_TelemetryServer_Imu? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next scaled IMU status + var imu: Mavsdk_Rpc_TelemetryServer_Imu { + get {return _imu ?? Mavsdk_Rpc_TelemetryServer_Imu()} + set {_imu = newValue} + } + /// Returns true if `imu` has been explicitly set. + var hasImu: Bool {return self._imu != nil} + /// Clears the value of `imu`. Subsequent reads from it will return its default value. + mutating func clearImu() {self._imu = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _imu: Mavsdk_Rpc_TelemetryServer_Imu? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next raw IMU status + var imu: Mavsdk_Rpc_TelemetryServer_Imu { + get {return _imu ?? Mavsdk_Rpc_TelemetryServer_Imu()} + set {_imu = newValue} + } + /// Returns true if `imu` has been explicitly set. + var hasImu: Bool {return self._imu != nil} + /// Clears the value of `imu`. Subsequent reads from it will return its default value. + mutating func clearImu() {self._imu = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _imu: Mavsdk_Rpc_TelemetryServer_Imu? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'health all ok' status + var isHealthAllOk: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The next 'unix epoch time' status + var timeUs: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Mavsdk_Rpc_TelemetryServer_PublishPositionResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHomeResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishArmedResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishRawGpsResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishBatteryResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishFlightModeResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHealthResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishStatusTextResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishOdometryResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishGroundTruthResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishImuResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishScaledImuResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishRawImuResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +struct Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + get {return _telemetryServerResult ?? Mavsdk_Rpc_TelemetryServer_TelemetryServerResult()} + set {_telemetryServerResult = newValue} + } + /// Returns true if `telemetryServerResult` has been explicitly set. + var hasTelemetryServerResult: Bool {return self._telemetryServerResult != nil} + /// Clears the value of `telemetryServerResult`. Subsequent reads from it will return its default value. + mutating func clearTelemetryServerResult() {self._telemetryServerResult = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _telemetryServerResult: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult? = nil +} + +/// Position type in global coordinates. +struct Mavsdk_Rpc_TelemetryServer_Position { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Latitude in degrees (range: -90 to +90) + var latitudeDeg: Double = 0 + + /// Longitude in degrees (range: -180 to +180) + var longitudeDeg: Double = 0 + + /// Altitude AMSL (above mean sea level) in metres + var absoluteAltitudeM: Float = 0 + + /// Altitude relative to takeoff altitude in metres + var relativeAltitudeM: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Quaternion type. +/// +/// All rotations and axis systems follow the right-hand rule. +/// The Hamilton quaternion product definition is used. +/// A zero-rotation quaternion is represented by (1,0,0,0). +/// The quaternion could also be written as w + xi + yj + zk. +/// +/// For more info see: https://en.wikipedia.org/wiki/Quaternion +struct Mavsdk_Rpc_TelemetryServer_Quaternion { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Quaternion entry 0, also denoted as a + var w: Float = 0 + + /// Quaternion entry 1, also denoted as b + var x: Float = 0 + + /// Quaternion entry 2, also denoted as c + var y: Float = 0 + + /// Quaternion entry 3, also denoted as d + var z: Float = 0 + + /// Timestamp in microseconds + var timestampUs: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Euler angle type. +/// +/// All rotations and axis systems follow the right-hand rule. +/// The Euler angles follow the convention of a 3-2-1 intrinsic Tait-Bryan rotation sequence. +/// +/// For more info see https://en.wikipedia.org/wiki/Euler_angles +struct Mavsdk_Rpc_TelemetryServer_EulerAngle { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Roll angle in degrees, positive is banking to the right + var rollDeg: Float = 0 + + /// Pitch angle in degrees, positive is pitching nose up + var pitchDeg: Float = 0 + + /// Yaw angle in degrees, positive is clock-wise seen from above + var yawDeg: Float = 0 + + /// Timestamp in microseconds + var timestampUs: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Angular velocity type. +struct Mavsdk_Rpc_TelemetryServer_AngularVelocityBody { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Roll angular velocity + var rollRadS: Float = 0 + + /// Pitch angular velocity + var pitchRadS: Float = 0 + + /// Yaw angular velocity + var yawRadS: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// GPS information type. +struct Mavsdk_Rpc_TelemetryServer_GpsInfo { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Number of visible satellites in use + var numSatellites: Int32 = 0 + + /// Fix type + var fixType: Mavsdk_Rpc_TelemetryServer_FixType = .noGps + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Raw GPS information type. +/// +/// Warning: this is an advanced type! If you want the location of the drone, use +/// the position instead. This message exposes the raw values of the GNSS sensor. +struct Mavsdk_Rpc_TelemetryServer_RawGps { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Timestamp in microseconds (UNIX Epoch time or time since system boot, to be inferred) + var timestampUs: UInt64 = 0 + + /// Latitude in degrees (WGS84, EGM96 ellipsoid) + var latitudeDeg: Double = 0 + + /// Longitude in degrees (WGS84, EGM96 ellipsoid) + var longitudeDeg: Double = 0 + + /// Altitude AMSL (above mean sea level) in metres + var absoluteAltitudeM: Float = 0 + + /// GPS HDOP horizontal dilution of position (unitless). If unknown, set to NaN + var hdop: Float = 0 + + /// GPS VDOP vertical dilution of position (unitless). If unknown, set to NaN + var vdop: Float = 0 + + /// Ground velocity in metres per second + var velocityMS: Float = 0 + + /// Course over ground (NOT heading, but direction of movement) in degrees. If unknown, set to NaN + var cogDeg: Float = 0 + + /// Altitude in metres (above WGS84, EGM96 ellipsoid) + var altitudeEllipsoidM: Float = 0 + + /// Position uncertainty in metres + var horizontalUncertaintyM: Float = 0 + + /// Altitude uncertainty in metres + var verticalUncertaintyM: Float = 0 + + /// Velocity uncertainty in metres per second + var velocityUncertaintyMS: Float = 0 + + /// Heading uncertainty in degrees + var headingUncertaintyDeg: Float = 0 + + /// Yaw in earth frame from north. + var yawDeg: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Battery type. +struct Mavsdk_Rpc_TelemetryServer_Battery { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Voltage in volts + var voltageV: Float = 0 + + /// Estimated battery remaining (range: 0.0 to 1.0) + var remainingPercent: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Health type. +struct Mavsdk_Rpc_TelemetryServer_Health { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// True if the gyrometer is calibrated + var isGyrometerCalibrationOk: Bool = false + + /// True if the accelerometer is calibrated + var isAccelerometerCalibrationOk: Bool = false + + /// True if the magnetometer is calibrated + var isMagnetometerCalibrationOk: Bool = false + + /// True if the local position estimate is good enough to fly in 'position control' mode + var isLocalPositionOk: Bool = false + + /// True if the global position estimate is good enough to fly in 'position control' mode + var isGlobalPositionOk: Bool = false + + /// True if the home position has been initialized properly + var isHomePositionOk: Bool = false + + /// True if system can be armed + var isArmable: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Remote control status type. +struct Mavsdk_Rpc_TelemetryServer_RcStatus { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// True if an RC signal has been available once + var wasAvailableOnce: Bool = false + + /// True if the RC signal is available now + var isAvailable: Bool = false + + /// Signal strength (range: 0 to 100, NaN if unknown) + var signalStrengthPercent: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// StatusText information type. +struct Mavsdk_Rpc_TelemetryServer_StatusText { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Message type + var type: Mavsdk_Rpc_TelemetryServer_StatusTextType = .debug + + /// MAVLink status message + var text: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Actuator control target type. +struct Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// An actuator control group is e.g. 'attitude' for the core flight controls, or 'gimbal' for a payload. + var group: Int32 = 0 + + /// Controls normed from -1 to 1, where 0 is neutral position. + var controls: [Float] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Actuator output status type. +struct Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Active outputs + var active: UInt32 = 0 + + /// Servo/motor output values + var actuator: [Float] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// +/// Covariance type. +/// +/// Row-major representation of a 6x6 cross-covariance matrix +/// upper right triangle. +/// Set first to NaN if unknown. +struct Mavsdk_Rpc_TelemetryServer_Covariance { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Representation of a covariance matrix. + var covarianceMatrix: [Float] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Velocity type, represented in the Body (X Y Z) frame and in metres/second. +struct Mavsdk_Rpc_TelemetryServer_VelocityBody { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Velocity in X in metres/second + var xMS: Float = 0 + + /// Velocity in Y in metres/second + var yMS: Float = 0 + + /// Velocity in Z in metres/second + var zMS: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Position type, represented in the Body (X Y Z) frame +struct Mavsdk_Rpc_TelemetryServer_PositionBody { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// X Position in metres. + var xM: Float = 0 + + /// Y Position in metres. + var yM: Float = 0 + + /// Z Position in metres. + var zM: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Odometry message type. +struct Mavsdk_Rpc_TelemetryServer_Odometry { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Timestamp (0 to use Backend timestamp). + var timeUsec: UInt64 { + get {return _storage._timeUsec} + set {_uniqueStorage()._timeUsec = newValue} + } + + /// Coordinate frame of reference for the pose data. + var frameID: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame { + get {return _storage._frameID} + set {_uniqueStorage()._frameID = newValue} + } + + /// Coordinate frame of reference for the velocity in free space (twist) data. + var childFrameID: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame { + get {return _storage._childFrameID} + set {_uniqueStorage()._childFrameID = newValue} + } + + /// Position. + var positionBody: Mavsdk_Rpc_TelemetryServer_PositionBody { + get {return _storage._positionBody ?? Mavsdk_Rpc_TelemetryServer_PositionBody()} + set {_uniqueStorage()._positionBody = newValue} + } + /// Returns true if `positionBody` has been explicitly set. + var hasPositionBody: Bool {return _storage._positionBody != nil} + /// Clears the value of `positionBody`. Subsequent reads from it will return its default value. + mutating func clearPositionBody() {_uniqueStorage()._positionBody = nil} + + /// Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). + var q: Mavsdk_Rpc_TelemetryServer_Quaternion { + get {return _storage._q ?? Mavsdk_Rpc_TelemetryServer_Quaternion()} + set {_uniqueStorage()._q = newValue} + } + /// Returns true if `q` has been explicitly set. + var hasQ: Bool {return _storage._q != nil} + /// Clears the value of `q`. Subsequent reads from it will return its default value. + mutating func clearQ() {_uniqueStorage()._q = nil} + + /// Linear velocity (m/s). + var velocityBody: Mavsdk_Rpc_TelemetryServer_VelocityBody { + get {return _storage._velocityBody ?? Mavsdk_Rpc_TelemetryServer_VelocityBody()} + set {_uniqueStorage()._velocityBody = newValue} + } + /// Returns true if `velocityBody` has been explicitly set. + var hasVelocityBody: Bool {return _storage._velocityBody != nil} + /// Clears the value of `velocityBody`. Subsequent reads from it will return its default value. + mutating func clearVelocityBody() {_uniqueStorage()._velocityBody = nil} + + /// Angular velocity (rad/s). + var angularVelocityBody: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody { + get {return _storage._angularVelocityBody ?? Mavsdk_Rpc_TelemetryServer_AngularVelocityBody()} + set {_uniqueStorage()._angularVelocityBody = newValue} + } + /// Returns true if `angularVelocityBody` has been explicitly set. + var hasAngularVelocityBody: Bool {return _storage._angularVelocityBody != nil} + /// Clears the value of `angularVelocityBody`. Subsequent reads from it will return its default value. + mutating func clearAngularVelocityBody() {_uniqueStorage()._angularVelocityBody = nil} + + /// Pose cross-covariance matrix. + var poseCovariance: Mavsdk_Rpc_TelemetryServer_Covariance { + get {return _storage._poseCovariance ?? Mavsdk_Rpc_TelemetryServer_Covariance()} + set {_uniqueStorage()._poseCovariance = newValue} + } + /// Returns true if `poseCovariance` has been explicitly set. + var hasPoseCovariance: Bool {return _storage._poseCovariance != nil} + /// Clears the value of `poseCovariance`. Subsequent reads from it will return its default value. + mutating func clearPoseCovariance() {_uniqueStorage()._poseCovariance = nil} + + /// Velocity cross-covariance matrix. + var velocityCovariance: Mavsdk_Rpc_TelemetryServer_Covariance { + get {return _storage._velocityCovariance ?? Mavsdk_Rpc_TelemetryServer_Covariance()} + set {_uniqueStorage()._velocityCovariance = newValue} + } + /// Returns true if `velocityCovariance` has been explicitly set. + var hasVelocityCovariance: Bool {return _storage._velocityCovariance != nil} + /// Clears the value of `velocityCovariance`. Subsequent reads from it will return its default value. + mutating func clearVelocityCovariance() {_uniqueStorage()._velocityCovariance = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// Mavlink frame id + enum MavFrame: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Frame is undefined. + case undef // = 0 + + /// Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. + case bodyNed // = 8 + + /// Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: north, y: east, z: down). + case visionNed // = 16 + + /// Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: north, y: east, z: down). + case estimNed // = 18 + case UNRECOGNIZED(Int) + + init() { + self = .undef + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .undef + case 8: self = .bodyNed + case 16: self = .visionNed + case 18: self = .estimNed + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .undef: return 0 + case .bodyNed: return 8 + case .visionNed: return 16 + case .estimNed: return 18 + case .UNRECOGNIZED(let i): return i + } + } + + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame] = [ + .undef, + .bodyNed, + .visionNed, + .estimNed, + ] +} + +#endif // swift(>=4.2) + +/// DistanceSensor message type. +struct Mavsdk_Rpc_TelemetryServer_DistanceSensor { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Minimum distance the sensor can measure, NaN if unknown. + var minimumDistanceM: Float = 0 + + /// Maximum distance the sensor can measure, NaN if unknown. + var maximumDistanceM: Float = 0 + + /// Current distance reading, NaN if unknown. + var currentDistanceM: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Scaled Pressure message type. +struct Mavsdk_Rpc_TelemetryServer_ScaledPressure { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Timestamp (time since system boot) + var timestampUs: UInt64 = 0 + + /// Absolute pressure in hPa + var absolutePressureHpa: Float = 0 + + /// Differential pressure 1 in hPa + var differentialPressureHpa: Float = 0 + + /// Absolute pressure temperature (in celsius) + var temperatureDeg: Float = 0 + + /// Differential pressure temperature (in celsius, 0 if not available) + var differentialPressureTemperatureDeg: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// PositionNed message type. +struct Mavsdk_Rpc_TelemetryServer_PositionNed { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Position along north direction in metres + var northM: Float = 0 + + /// Position along east direction in metres + var eastM: Float = 0 + + /// Position along down direction in metres + var downM: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// VelocityNed message type. +struct Mavsdk_Rpc_TelemetryServer_VelocityNed { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Velocity along north direction in metres per second + var northMS: Float = 0 + + /// Velocity along east direction in metres per second + var eastMS: Float = 0 + + /// Velocity along down direction in metres per second + var downMS: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// PositionVelocityNed message type. +struct Mavsdk_Rpc_TelemetryServer_PositionVelocityNed { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Position (NED) + var position: Mavsdk_Rpc_TelemetryServer_PositionNed { + get {return _position ?? Mavsdk_Rpc_TelemetryServer_PositionNed()} + set {_position = newValue} + } + /// Returns true if `position` has been explicitly set. + var hasPosition: Bool {return self._position != nil} + /// Clears the value of `position`. Subsequent reads from it will return its default value. + mutating func clearPosition() {self._position = nil} + + /// Velocity (NED) + var velocity: Mavsdk_Rpc_TelemetryServer_VelocityNed { + get {return _velocity ?? Mavsdk_Rpc_TelemetryServer_VelocityNed()} + set {_velocity = newValue} + } + /// Returns true if `velocity` has been explicitly set. + var hasVelocity: Bool {return self._velocity != nil} + /// Clears the value of `velocity`. Subsequent reads from it will return its default value. + mutating func clearVelocity() {self._velocity = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _position: Mavsdk_Rpc_TelemetryServer_PositionNed? = nil + fileprivate var _velocity: Mavsdk_Rpc_TelemetryServer_VelocityNed? = nil +} + +/// GroundTruth message type. +struct Mavsdk_Rpc_TelemetryServer_GroundTruth { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Latitude in degrees (range: -90 to +90) + var latitudeDeg: Double = 0 + + /// Longitude in degrees (range: -180 to 180) + var longitudeDeg: Double = 0 + + /// Altitude AMSL (above mean sea level) in metres + var absoluteAltitudeM: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// FixedwingMetrics message type. +struct Mavsdk_Rpc_TelemetryServer_FixedwingMetrics { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Current indicated airspeed (IAS) in metres per second + var airspeedMS: Float = 0 + + /// Current throttle setting (0 to 100) + var throttlePercentage: Float = 0 + + /// Current climb rate in metres per second + var climbRateMS: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// AccelerationFrd message type. +struct Mavsdk_Rpc_TelemetryServer_AccelerationFrd { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Acceleration in forward direction in metres per second^2 + var forwardMS2: Float = 0 + + /// Acceleration in right direction in metres per second^2 + var rightMS2: Float = 0 + + /// Acceleration in down direction in metres per second^2 + var downMS2: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// AngularVelocityFrd message type. +struct Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Angular velocity in forward direction in radians per second + var forwardRadS: Float = 0 + + /// Angular velocity in right direction in radians per second + var rightRadS: Float = 0 + + /// Angular velocity in Down direction in radians per second + var downRadS: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// MagneticFieldFrd message type. +struct Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Magnetic field in forward direction measured in Gauss + var forwardGauss: Float = 0 + + /// Magnetic field in East direction measured in Gauss + var rightGauss: Float = 0 + + /// Magnetic field in Down direction measured in Gauss + var downGauss: Float = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Imu message type. +struct Mavsdk_Rpc_TelemetryServer_Imu { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Acceleration + var accelerationFrd: Mavsdk_Rpc_TelemetryServer_AccelerationFrd { + get {return _accelerationFrd ?? Mavsdk_Rpc_TelemetryServer_AccelerationFrd()} + set {_accelerationFrd = newValue} + } + /// Returns true if `accelerationFrd` has been explicitly set. + var hasAccelerationFrd: Bool {return self._accelerationFrd != nil} + /// Clears the value of `accelerationFrd`. Subsequent reads from it will return its default value. + mutating func clearAccelerationFrd() {self._accelerationFrd = nil} + + /// Angular velocity + var angularVelocityFrd: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd { + get {return _angularVelocityFrd ?? Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd()} + set {_angularVelocityFrd = newValue} + } + /// Returns true if `angularVelocityFrd` has been explicitly set. + var hasAngularVelocityFrd: Bool {return self._angularVelocityFrd != nil} + /// Clears the value of `angularVelocityFrd`. Subsequent reads from it will return its default value. + mutating func clearAngularVelocityFrd() {self._angularVelocityFrd = nil} + + /// Magnetic field + var magneticFieldFrd: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd { + get {return _magneticFieldFrd ?? Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd()} + set {_magneticFieldFrd = newValue} + } + /// Returns true if `magneticFieldFrd` has been explicitly set. + var hasMagneticFieldFrd: Bool {return self._magneticFieldFrd != nil} + /// Clears the value of `magneticFieldFrd`. Subsequent reads from it will return its default value. + mutating func clearMagneticFieldFrd() {self._magneticFieldFrd = nil} + + /// Temperature + var temperatureDegc: Float = 0 + + /// Timestamp in microseconds + var timestampUs: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _accelerationFrd: Mavsdk_Rpc_TelemetryServer_AccelerationFrd? = nil + fileprivate var _angularVelocityFrd: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd? = nil + fileprivate var _magneticFieldFrd: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd? = nil +} + +/// Result type. +struct Mavsdk_Rpc_TelemetryServer_TelemetryServerResult { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Result enum value + var result: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result = .unknown + + /// Human-readable English string describing the result + var resultStr: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// Possible results returned for telemetry requests. + enum Result: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// Unknown result + case unknown // = 0 + + /// Success: the telemetry command was accepted by the vehicle + case success // = 1 + + /// No system connected + case noSystem // = 2 + + /// Connection error + case connectionError // = 3 + + /// Vehicle is busy + case busy // = 4 + + /// Command refused by vehicle + case commandDenied // = 5 + + /// Request timed out + case timeout // = 6 + + /// Request not supported + case unsupported // = 7 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .success + case 2: self = .noSystem + case 3: self = .connectionError + case 4: self = .busy + case 5: self = .commandDenied + case 6: self = .timeout + case 7: self = .unsupported + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .success: return 1 + case .noSystem: return 2 + case .connectionError: return 3 + case .busy: return 4 + case .commandDenied: return 5 + case .timeout: return 6 + case .unsupported: return 7 + case .UNRECOGNIZED(let i): return i + } + } + + } + + init() {} +} + +#if swift(>=4.2) + +extension Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + static var allCases: [Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result] = [ + .unknown, + .success, + .noSystem, + .connectionError, + .busy, + .commandDenied, + .timeout, + .unsupported, + ] +} + +#endif // swift(>=4.2) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "mavsdk.rpc.telemetry_server" + +extension Mavsdk_Rpc_TelemetryServer_FixType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FIX_TYPE_NO_GPS"), + 1: .same(proto: "FIX_TYPE_NO_FIX"), + 2: .same(proto: "FIX_TYPE_FIX_2D"), + 3: .same(proto: "FIX_TYPE_FIX_3D"), + 4: .same(proto: "FIX_TYPE_FIX_DGPS"), + 5: .same(proto: "FIX_TYPE_RTK_FLOAT"), + 6: .same(proto: "FIX_TYPE_RTK_FIXED"), + ] +} + +extension Mavsdk_Rpc_TelemetryServer_FlightMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FLIGHT_MODE_UNKNOWN"), + 1: .same(proto: "FLIGHT_MODE_READY"), + 2: .same(proto: "FLIGHT_MODE_TAKEOFF"), + 3: .same(proto: "FLIGHT_MODE_HOLD"), + 4: .same(proto: "FLIGHT_MODE_MISSION"), + 5: .same(proto: "FLIGHT_MODE_RETURN_TO_LAUNCH"), + 6: .same(proto: "FLIGHT_MODE_LAND"), + 7: .same(proto: "FLIGHT_MODE_OFFBOARD"), + 8: .same(proto: "FLIGHT_MODE_FOLLOW_ME"), + 9: .same(proto: "FLIGHT_MODE_MANUAL"), + 10: .same(proto: "FLIGHT_MODE_ALTCTL"), + 11: .same(proto: "FLIGHT_MODE_POSCTL"), + 12: .same(proto: "FLIGHT_MODE_ACRO"), + 13: .same(proto: "FLIGHT_MODE_STABILIZED"), + 14: .same(proto: "FLIGHT_MODE_RATTITUDE"), + ] +} + +extension Mavsdk_Rpc_TelemetryServer_StatusTextType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "STATUS_TEXT_TYPE_DEBUG"), + 1: .same(proto: "STATUS_TEXT_TYPE_INFO"), + 2: .same(proto: "STATUS_TEXT_TYPE_NOTICE"), + 3: .same(proto: "STATUS_TEXT_TYPE_WARNING"), + 4: .same(proto: "STATUS_TEXT_TYPE_ERROR"), + 5: .same(proto: "STATUS_TEXT_TYPE_CRITICAL"), + 6: .same(proto: "STATUS_TEXT_TYPE_ALERT"), + 7: .same(proto: "STATUS_TEXT_TYPE_EMERGENCY"), + ] +} + +extension Mavsdk_Rpc_TelemetryServer_LandedState: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "LANDED_STATE_UNKNOWN"), + 1: .same(proto: "LANDED_STATE_ON_GROUND"), + 2: .same(proto: "LANDED_STATE_IN_AIR"), + 3: .same(proto: "LANDED_STATE_TAKING_OFF"), + 4: .same(proto: "LANDED_STATE_LANDING"), + ] +} + +extension Mavsdk_Rpc_TelemetryServer_PublishPositionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishPositionRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "position"), + 2: .standard(proto: "velocity_ned"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._position) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._velocityNed) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._position { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if let v = self._velocityNed { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishPositionRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishPositionRequest) -> Bool { + if lhs._position != rhs._position {return false} + if lhs._velocityNed != rhs._velocityNed {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHomeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHomeRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "home"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._home) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._home { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHomeRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishHomeRequest) -> Bool { + if lhs._home != rhs._home {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishInAirRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishInAirRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "is_in_air"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isInAir) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.isInAir != false { + try visitor.visitSingularBoolField(value: self.isInAir, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishInAirRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishInAirRequest) -> Bool { + if lhs.isInAir != rhs.isInAir {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishLandedStateRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishLandedStateRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "landed_state"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.landedState) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.landedState != .unknown { + try visitor.visitSingularEnumField(value: self.landedState, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishLandedStateRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishLandedStateRequest) -> Bool { + if lhs.landedState != rhs.landedState {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishArmedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishArmedRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "is_armed"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isArmed) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.isArmed != false { + try visitor.visitSingularBoolField(value: self.isArmed, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishArmedRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishArmedRequest) -> Bool { + if lhs.isArmed != rhs.isArmed {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishRawGpsRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "raw_gps"), + 2: .standard(proto: "gps_info"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._rawGps) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._gpsInfo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._rawGps { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if let v = self._gpsInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishRawGpsRequest) -> Bool { + if lhs._rawGps != rhs._rawGps {return false} + if lhs._gpsInfo != rhs._gpsInfo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishBatteryRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "battery"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._battery) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._battery { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishBatteryRequest) -> Bool { + if lhs._battery != rhs._battery {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishFlightModeRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "flight_mode"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.flightMode) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.flightMode != .unknown { + try visitor.visitSingularEnumField(value: self.flightMode, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishFlightModeRequest) -> Bool { + if lhs.flightMode != rhs.flightMode {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHealthRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHealthRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "health"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._health) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._health { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHealthRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishHealthRequest) -> Bool { + if lhs._health != rhs._health {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishRcStatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishRcStatusRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "rc_status"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._rcStatus) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._rcStatus { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishRcStatusRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishRcStatusRequest) -> Bool { + if lhs._rcStatus != rhs._rcStatus {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishStatusTextRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "status_text"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._statusText) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._statusText { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishStatusTextRequest) -> Bool { + if lhs._statusText != rhs._statusText {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishOdometryRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "odometry"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._odometry) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._odometry { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishOdometryRequest) -> Bool { + if lhs._odometry != rhs._odometry {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishPositionVelocityNedRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "position_velocity_ned"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._positionVelocityNed) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._positionVelocityNed { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedRequest) -> Bool { + if lhs._positionVelocityNed != rhs._positionVelocityNed {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishGroundTruthRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "ground_truth"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._groundTruth) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._groundTruth { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthRequest) -> Bool { + if lhs._groundTruth != rhs._groundTruth {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishImuRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishImuRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "imu"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._imu) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._imu { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishImuRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishImuRequest) -> Bool { + if lhs._imu != rhs._imu {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishScaledImuRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "imu"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._imu) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._imu { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishScaledImuRequest) -> Bool { + if lhs._imu != rhs._imu {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishRawImuRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "imu"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._imu) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._imu { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishRawImuRequest) -> Bool { + if lhs._imu != rhs._imu {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHealthAllOkRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "is_health_all_ok"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isHealthAllOk) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.isHealthAllOk != false { + try visitor.visitSingularBoolField(value: self.isHealthAllOk, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkRequest) -> Bool { + if lhs.isHealthAllOk != rhs.isHealthAllOk {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishUnixEpochTimeRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "time_us"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.timeUs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.timeUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timeUs, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest, rhs: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeRequest) -> Bool { + if lhs.timeUs != rhs.timeUs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishPositionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishPositionResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishPositionResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishPositionResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHomeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHomeResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHomeResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishHomeResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishArmedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishArmedResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishArmedResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishArmedResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishRawGpsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishRawGpsResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishRawGpsResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishRawGpsResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishBatteryResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishBatteryResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishBatteryResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishBatteryResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishFlightModeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishFlightModeResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishFlightModeResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishFlightModeResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHealthResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHealthResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHealthResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishHealthResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishStatusTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishStatusTextResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishStatusTextResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishStatusTextResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishOdometryResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishOdometryResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishOdometryResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishOdometryResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishPositionVelocityNedResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishPositionVelocityNedResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishGroundTruthResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishGroundTruthResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishGroundTruthResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishImuResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishImuResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishImuResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishImuResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishScaledImuResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishScaledImuResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishScaledImuResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishScaledImuResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishRawImuResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishRawImuResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishRawImuResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishRawImuResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishHealthAllOkResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishHealthAllOkResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublishUnixEpochTimeResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "telemetry_server_result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._telemetryServerResult) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._telemetryServerResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeResponse, rhs: Mavsdk_Rpc_TelemetryServer_PublishUnixEpochTimeResponse) -> Bool { + if lhs._telemetryServerResult != rhs._telemetryServerResult {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Position: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Position" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "latitude_deg"), + 2: .standard(proto: "longitude_deg"), + 3: .standard(proto: "absolute_altitude_m"), + 4: .standard(proto: "relative_altitude_m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularDoubleField(value: &self.latitudeDeg) }() + case 2: try { try decoder.decodeSingularDoubleField(value: &self.longitudeDeg) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.absoluteAltitudeM) }() + case 4: try { try decoder.decodeSingularFloatField(value: &self.relativeAltitudeM) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.latitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.latitudeDeg, fieldNumber: 1) + } + if self.longitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.longitudeDeg, fieldNumber: 2) + } + if self.absoluteAltitudeM != 0 { + try visitor.visitSingularFloatField(value: self.absoluteAltitudeM, fieldNumber: 3) + } + if self.relativeAltitudeM != 0 { + try visitor.visitSingularFloatField(value: self.relativeAltitudeM, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Position, rhs: Mavsdk_Rpc_TelemetryServer_Position) -> Bool { + if lhs.latitudeDeg != rhs.latitudeDeg {return false} + if lhs.longitudeDeg != rhs.longitudeDeg {return false} + if lhs.absoluteAltitudeM != rhs.absoluteAltitudeM {return false} + if lhs.relativeAltitudeM != rhs.relativeAltitudeM {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Quaternion: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Quaternion" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "w"), + 2: .same(proto: "x"), + 3: .same(proto: "y"), + 4: .same(proto: "z"), + 5: .standard(proto: "timestamp_us"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.w) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.x) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.y) }() + case 4: try { try decoder.decodeSingularFloatField(value: &self.z) }() + case 5: try { try decoder.decodeSingularUInt64Field(value: &self.timestampUs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.w != 0 { + try visitor.visitSingularFloatField(value: self.w, fieldNumber: 1) + } + if self.x != 0 { + try visitor.visitSingularFloatField(value: self.x, fieldNumber: 2) + } + if self.y != 0 { + try visitor.visitSingularFloatField(value: self.y, fieldNumber: 3) + } + if self.z != 0 { + try visitor.visitSingularFloatField(value: self.z, fieldNumber: 4) + } + if self.timestampUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timestampUs, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Quaternion, rhs: Mavsdk_Rpc_TelemetryServer_Quaternion) -> Bool { + if lhs.w != rhs.w {return false} + if lhs.x != rhs.x {return false} + if lhs.y != rhs.y {return false} + if lhs.z != rhs.z {return false} + if lhs.timestampUs != rhs.timestampUs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_EulerAngle: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EulerAngle" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "roll_deg"), + 2: .standard(proto: "pitch_deg"), + 3: .standard(proto: "yaw_deg"), + 4: .standard(proto: "timestamp_us"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.rollDeg) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.pitchDeg) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.yawDeg) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.timestampUs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.rollDeg != 0 { + try visitor.visitSingularFloatField(value: self.rollDeg, fieldNumber: 1) + } + if self.pitchDeg != 0 { + try visitor.visitSingularFloatField(value: self.pitchDeg, fieldNumber: 2) + } + if self.yawDeg != 0 { + try visitor.visitSingularFloatField(value: self.yawDeg, fieldNumber: 3) + } + if self.timestampUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timestampUs, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_EulerAngle, rhs: Mavsdk_Rpc_TelemetryServer_EulerAngle) -> Bool { + if lhs.rollDeg != rhs.rollDeg {return false} + if lhs.pitchDeg != rhs.pitchDeg {return false} + if lhs.yawDeg != rhs.yawDeg {return false} + if lhs.timestampUs != rhs.timestampUs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_AngularVelocityBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AngularVelocityBody" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "roll_rad_s"), + 2: .standard(proto: "pitch_rad_s"), + 3: .standard(proto: "yaw_rad_s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.rollRadS) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.pitchRadS) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.yawRadS) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.rollRadS != 0 { + try visitor.visitSingularFloatField(value: self.rollRadS, fieldNumber: 1) + } + if self.pitchRadS != 0 { + try visitor.visitSingularFloatField(value: self.pitchRadS, fieldNumber: 2) + } + if self.yawRadS != 0 { + try visitor.visitSingularFloatField(value: self.yawRadS, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody, rhs: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody) -> Bool { + if lhs.rollRadS != rhs.rollRadS {return false} + if lhs.pitchRadS != rhs.pitchRadS {return false} + if lhs.yawRadS != rhs.yawRadS {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_GpsInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GpsInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "num_satellites"), + 2: .standard(proto: "fix_type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.numSatellites) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.fixType) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.numSatellites != 0 { + try visitor.visitSingularInt32Field(value: self.numSatellites, fieldNumber: 1) + } + if self.fixType != .noGps { + try visitor.visitSingularEnumField(value: self.fixType, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_GpsInfo, rhs: Mavsdk_Rpc_TelemetryServer_GpsInfo) -> Bool { + if lhs.numSatellites != rhs.numSatellites {return false} + if lhs.fixType != rhs.fixType {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_RawGps: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RawGps" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "timestamp_us"), + 2: .standard(proto: "latitude_deg"), + 3: .standard(proto: "longitude_deg"), + 4: .standard(proto: "absolute_altitude_m"), + 5: .same(proto: "hdop"), + 6: .same(proto: "vdop"), + 7: .standard(proto: "velocity_m_s"), + 8: .standard(proto: "cog_deg"), + 9: .standard(proto: "altitude_ellipsoid_m"), + 10: .standard(proto: "horizontal_uncertainty_m"), + 11: .standard(proto: "vertical_uncertainty_m"), + 12: .standard(proto: "velocity_uncertainty_m_s"), + 13: .standard(proto: "heading_uncertainty_deg"), + 14: .standard(proto: "yaw_deg"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.timestampUs) }() + case 2: try { try decoder.decodeSingularDoubleField(value: &self.latitudeDeg) }() + case 3: try { try decoder.decodeSingularDoubleField(value: &self.longitudeDeg) }() + case 4: try { try decoder.decodeSingularFloatField(value: &self.absoluteAltitudeM) }() + case 5: try { try decoder.decodeSingularFloatField(value: &self.hdop) }() + case 6: try { try decoder.decodeSingularFloatField(value: &self.vdop) }() + case 7: try { try decoder.decodeSingularFloatField(value: &self.velocityMS) }() + case 8: try { try decoder.decodeSingularFloatField(value: &self.cogDeg) }() + case 9: try { try decoder.decodeSingularFloatField(value: &self.altitudeEllipsoidM) }() + case 10: try { try decoder.decodeSingularFloatField(value: &self.horizontalUncertaintyM) }() + case 11: try { try decoder.decodeSingularFloatField(value: &self.verticalUncertaintyM) }() + case 12: try { try decoder.decodeSingularFloatField(value: &self.velocityUncertaintyMS) }() + case 13: try { try decoder.decodeSingularFloatField(value: &self.headingUncertaintyDeg) }() + case 14: try { try decoder.decodeSingularFloatField(value: &self.yawDeg) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.timestampUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timestampUs, fieldNumber: 1) + } + if self.latitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.latitudeDeg, fieldNumber: 2) + } + if self.longitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.longitudeDeg, fieldNumber: 3) + } + if self.absoluteAltitudeM != 0 { + try visitor.visitSingularFloatField(value: self.absoluteAltitudeM, fieldNumber: 4) + } + if self.hdop != 0 { + try visitor.visitSingularFloatField(value: self.hdop, fieldNumber: 5) + } + if self.vdop != 0 { + try visitor.visitSingularFloatField(value: self.vdop, fieldNumber: 6) + } + if self.velocityMS != 0 { + try visitor.visitSingularFloatField(value: self.velocityMS, fieldNumber: 7) + } + if self.cogDeg != 0 { + try visitor.visitSingularFloatField(value: self.cogDeg, fieldNumber: 8) + } + if self.altitudeEllipsoidM != 0 { + try visitor.visitSingularFloatField(value: self.altitudeEllipsoidM, fieldNumber: 9) + } + if self.horizontalUncertaintyM != 0 { + try visitor.visitSingularFloatField(value: self.horizontalUncertaintyM, fieldNumber: 10) + } + if self.verticalUncertaintyM != 0 { + try visitor.visitSingularFloatField(value: self.verticalUncertaintyM, fieldNumber: 11) + } + if self.velocityUncertaintyMS != 0 { + try visitor.visitSingularFloatField(value: self.velocityUncertaintyMS, fieldNumber: 12) + } + if self.headingUncertaintyDeg != 0 { + try visitor.visitSingularFloatField(value: self.headingUncertaintyDeg, fieldNumber: 13) + } + if self.yawDeg != 0 { + try visitor.visitSingularFloatField(value: self.yawDeg, fieldNumber: 14) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_RawGps, rhs: Mavsdk_Rpc_TelemetryServer_RawGps) -> Bool { + if lhs.timestampUs != rhs.timestampUs {return false} + if lhs.latitudeDeg != rhs.latitudeDeg {return false} + if lhs.longitudeDeg != rhs.longitudeDeg {return false} + if lhs.absoluteAltitudeM != rhs.absoluteAltitudeM {return false} + if lhs.hdop != rhs.hdop {return false} + if lhs.vdop != rhs.vdop {return false} + if lhs.velocityMS != rhs.velocityMS {return false} + if lhs.cogDeg != rhs.cogDeg {return false} + if lhs.altitudeEllipsoidM != rhs.altitudeEllipsoidM {return false} + if lhs.horizontalUncertaintyM != rhs.horizontalUncertaintyM {return false} + if lhs.verticalUncertaintyM != rhs.verticalUncertaintyM {return false} + if lhs.velocityUncertaintyMS != rhs.velocityUncertaintyMS {return false} + if lhs.headingUncertaintyDeg != rhs.headingUncertaintyDeg {return false} + if lhs.yawDeg != rhs.yawDeg {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Battery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Battery" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "voltage_v"), + 2: .standard(proto: "remaining_percent"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.voltageV) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.remainingPercent) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.voltageV != 0 { + try visitor.visitSingularFloatField(value: self.voltageV, fieldNumber: 1) + } + if self.remainingPercent != 0 { + try visitor.visitSingularFloatField(value: self.remainingPercent, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Battery, rhs: Mavsdk_Rpc_TelemetryServer_Battery) -> Bool { + if lhs.voltageV != rhs.voltageV {return false} + if lhs.remainingPercent != rhs.remainingPercent {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Health: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Health" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "is_gyrometer_calibration_ok"), + 2: .standard(proto: "is_accelerometer_calibration_ok"), + 3: .standard(proto: "is_magnetometer_calibration_ok"), + 5: .standard(proto: "is_local_position_ok"), + 6: .standard(proto: "is_global_position_ok"), + 7: .standard(proto: "is_home_position_ok"), + 8: .standard(proto: "is_armable"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isGyrometerCalibrationOk) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.isAccelerometerCalibrationOk) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.isMagnetometerCalibrationOk) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self.isLocalPositionOk) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self.isGlobalPositionOk) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self.isHomePositionOk) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self.isArmable) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.isGyrometerCalibrationOk != false { + try visitor.visitSingularBoolField(value: self.isGyrometerCalibrationOk, fieldNumber: 1) + } + if self.isAccelerometerCalibrationOk != false { + try visitor.visitSingularBoolField(value: self.isAccelerometerCalibrationOk, fieldNumber: 2) + } + if self.isMagnetometerCalibrationOk != false { + try visitor.visitSingularBoolField(value: self.isMagnetometerCalibrationOk, fieldNumber: 3) + } + if self.isLocalPositionOk != false { + try visitor.visitSingularBoolField(value: self.isLocalPositionOk, fieldNumber: 5) + } + if self.isGlobalPositionOk != false { + try visitor.visitSingularBoolField(value: self.isGlobalPositionOk, fieldNumber: 6) + } + if self.isHomePositionOk != false { + try visitor.visitSingularBoolField(value: self.isHomePositionOk, fieldNumber: 7) + } + if self.isArmable != false { + try visitor.visitSingularBoolField(value: self.isArmable, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Health, rhs: Mavsdk_Rpc_TelemetryServer_Health) -> Bool { + if lhs.isGyrometerCalibrationOk != rhs.isGyrometerCalibrationOk {return false} + if lhs.isAccelerometerCalibrationOk != rhs.isAccelerometerCalibrationOk {return false} + if lhs.isMagnetometerCalibrationOk != rhs.isMagnetometerCalibrationOk {return false} + if lhs.isLocalPositionOk != rhs.isLocalPositionOk {return false} + if lhs.isGlobalPositionOk != rhs.isGlobalPositionOk {return false} + if lhs.isHomePositionOk != rhs.isHomePositionOk {return false} + if lhs.isArmable != rhs.isArmable {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_RcStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RcStatus" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "was_available_once"), + 2: .standard(proto: "is_available"), + 3: .standard(proto: "signal_strength_percent"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.wasAvailableOnce) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.isAvailable) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.signalStrengthPercent) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.wasAvailableOnce != false { + try visitor.visitSingularBoolField(value: self.wasAvailableOnce, fieldNumber: 1) + } + if self.isAvailable != false { + try visitor.visitSingularBoolField(value: self.isAvailable, fieldNumber: 2) + } + if self.signalStrengthPercent != 0 { + try visitor.visitSingularFloatField(value: self.signalStrengthPercent, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_RcStatus, rhs: Mavsdk_Rpc_TelemetryServer_RcStatus) -> Bool { + if lhs.wasAvailableOnce != rhs.wasAvailableOnce {return false} + if lhs.isAvailable != rhs.isAvailable {return false} + if lhs.signalStrengthPercent != rhs.signalStrengthPercent {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_StatusText: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".StatusText" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "text"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.text) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .debug { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if !self.text.isEmpty { + try visitor.visitSingularStringField(value: self.text, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_StatusText, rhs: Mavsdk_Rpc_TelemetryServer_StatusText) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.text != rhs.text {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ActuatorControlTarget" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "group"), + 2: .same(proto: "controls"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.group) }() + case 2: try { try decoder.decodeRepeatedFloatField(value: &self.controls) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.group != 0 { + try visitor.visitSingularInt32Field(value: self.group, fieldNumber: 1) + } + if !self.controls.isEmpty { + try visitor.visitPackedFloatField(value: self.controls, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget, rhs: Mavsdk_Rpc_TelemetryServer_ActuatorControlTarget) -> Bool { + if lhs.group != rhs.group {return false} + if lhs.controls != rhs.controls {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ActuatorOutputStatus" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "active"), + 2: .same(proto: "actuator"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.active) }() + case 2: try { try decoder.decodeRepeatedFloatField(value: &self.actuator) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.active != 0 { + try visitor.visitSingularUInt32Field(value: self.active, fieldNumber: 1) + } + if !self.actuator.isEmpty { + try visitor.visitPackedFloatField(value: self.actuator, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus, rhs: Mavsdk_Rpc_TelemetryServer_ActuatorOutputStatus) -> Bool { + if lhs.active != rhs.active {return false} + if lhs.actuator != rhs.actuator {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Covariance: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Covariance" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "covariance_matrix"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedFloatField(value: &self.covarianceMatrix) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.covarianceMatrix.isEmpty { + try visitor.visitPackedFloatField(value: self.covarianceMatrix, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Covariance, rhs: Mavsdk_Rpc_TelemetryServer_Covariance) -> Bool { + if lhs.covarianceMatrix != rhs.covarianceMatrix {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_VelocityBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".VelocityBody" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "x_m_s"), + 2: .standard(proto: "y_m_s"), + 3: .standard(proto: "z_m_s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.xMS) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.yMS) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.zMS) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.xMS != 0 { + try visitor.visitSingularFloatField(value: self.xMS, fieldNumber: 1) + } + if self.yMS != 0 { + try visitor.visitSingularFloatField(value: self.yMS, fieldNumber: 2) + } + if self.zMS != 0 { + try visitor.visitSingularFloatField(value: self.zMS, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_VelocityBody, rhs: Mavsdk_Rpc_TelemetryServer_VelocityBody) -> Bool { + if lhs.xMS != rhs.xMS {return false} + if lhs.yMS != rhs.yMS {return false} + if lhs.zMS != rhs.zMS {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PositionBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PositionBody" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "x_m"), + 2: .standard(proto: "y_m"), + 3: .standard(proto: "z_m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.xM) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.yM) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.zM) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.xM != 0 { + try visitor.visitSingularFloatField(value: self.xM, fieldNumber: 1) + } + if self.yM != 0 { + try visitor.visitSingularFloatField(value: self.yM, fieldNumber: 2) + } + if self.zM != 0 { + try visitor.visitSingularFloatField(value: self.zM, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PositionBody, rhs: Mavsdk_Rpc_TelemetryServer_PositionBody) -> Bool { + if lhs.xM != rhs.xM {return false} + if lhs.yM != rhs.yM {return false} + if lhs.zM != rhs.zM {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Odometry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Odometry" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "time_usec"), + 2: .standard(proto: "frame_id"), + 3: .standard(proto: "child_frame_id"), + 4: .standard(proto: "position_body"), + 5: .same(proto: "q"), + 6: .standard(proto: "velocity_body"), + 7: .standard(proto: "angular_velocity_body"), + 8: .standard(proto: "pose_covariance"), + 9: .standard(proto: "velocity_covariance"), + ] + + fileprivate class _StorageClass { + var _timeUsec: UInt64 = 0 + var _frameID: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame = .undef + var _childFrameID: Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame = .undef + var _positionBody: Mavsdk_Rpc_TelemetryServer_PositionBody? = nil + var _q: Mavsdk_Rpc_TelemetryServer_Quaternion? = nil + var _velocityBody: Mavsdk_Rpc_TelemetryServer_VelocityBody? = nil + var _angularVelocityBody: Mavsdk_Rpc_TelemetryServer_AngularVelocityBody? = nil + var _poseCovariance: Mavsdk_Rpc_TelemetryServer_Covariance? = nil + var _velocityCovariance: Mavsdk_Rpc_TelemetryServer_Covariance? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _timeUsec = source._timeUsec + _frameID = source._frameID + _childFrameID = source._childFrameID + _positionBody = source._positionBody + _q = source._q + _velocityBody = source._velocityBody + _angularVelocityBody = source._angularVelocityBody + _poseCovariance = source._poseCovariance + _velocityCovariance = source._velocityCovariance + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &_storage._timeUsec) }() + case 2: try { try decoder.decodeSingularEnumField(value: &_storage._frameID) }() + case 3: try { try decoder.decodeSingularEnumField(value: &_storage._childFrameID) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._positionBody) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._q) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._velocityBody) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._angularVelocityBody) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._poseCovariance) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._velocityCovariance) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._timeUsec != 0 { + try visitor.visitSingularUInt64Field(value: _storage._timeUsec, fieldNumber: 1) + } + if _storage._frameID != .undef { + try visitor.visitSingularEnumField(value: _storage._frameID, fieldNumber: 2) + } + if _storage._childFrameID != .undef { + try visitor.visitSingularEnumField(value: _storage._childFrameID, fieldNumber: 3) + } + if let v = _storage._positionBody { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } + if let v = _storage._q { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } + if let v = _storage._velocityBody { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } + if let v = _storage._angularVelocityBody { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } + if let v = _storage._poseCovariance { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } + if let v = _storage._velocityCovariance { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Odometry, rhs: Mavsdk_Rpc_TelemetryServer_Odometry) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._timeUsec != rhs_storage._timeUsec {return false} + if _storage._frameID != rhs_storage._frameID {return false} + if _storage._childFrameID != rhs_storage._childFrameID {return false} + if _storage._positionBody != rhs_storage._positionBody {return false} + if _storage._q != rhs_storage._q {return false} + if _storage._velocityBody != rhs_storage._velocityBody {return false} + if _storage._angularVelocityBody != rhs_storage._angularVelocityBody {return false} + if _storage._poseCovariance != rhs_storage._poseCovariance {return false} + if _storage._velocityCovariance != rhs_storage._velocityCovariance {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Odometry.MavFrame: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "MAV_FRAME_UNDEF"), + 8: .same(proto: "MAV_FRAME_BODY_NED"), + 16: .same(proto: "MAV_FRAME_VISION_NED"), + 18: .same(proto: "MAV_FRAME_ESTIM_NED"), + ] +} + +extension Mavsdk_Rpc_TelemetryServer_DistanceSensor: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DistanceSensor" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "minimum_distance_m"), + 2: .standard(proto: "maximum_distance_m"), + 3: .standard(proto: "current_distance_m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.minimumDistanceM) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.maximumDistanceM) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.currentDistanceM) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.minimumDistanceM != 0 { + try visitor.visitSingularFloatField(value: self.minimumDistanceM, fieldNumber: 1) + } + if self.maximumDistanceM != 0 { + try visitor.visitSingularFloatField(value: self.maximumDistanceM, fieldNumber: 2) + } + if self.currentDistanceM != 0 { + try visitor.visitSingularFloatField(value: self.currentDistanceM, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_DistanceSensor, rhs: Mavsdk_Rpc_TelemetryServer_DistanceSensor) -> Bool { + if lhs.minimumDistanceM != rhs.minimumDistanceM {return false} + if lhs.maximumDistanceM != rhs.maximumDistanceM {return false} + if lhs.currentDistanceM != rhs.currentDistanceM {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_ScaledPressure: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ScaledPressure" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "timestamp_us"), + 2: .standard(proto: "absolute_pressure_hpa"), + 3: .standard(proto: "differential_pressure_hpa"), + 4: .standard(proto: "temperature_deg"), + 5: .standard(proto: "differential_pressure_temperature_deg"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.timestampUs) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.absolutePressureHpa) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.differentialPressureHpa) }() + case 4: try { try decoder.decodeSingularFloatField(value: &self.temperatureDeg) }() + case 5: try { try decoder.decodeSingularFloatField(value: &self.differentialPressureTemperatureDeg) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.timestampUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timestampUs, fieldNumber: 1) + } + if self.absolutePressureHpa != 0 { + try visitor.visitSingularFloatField(value: self.absolutePressureHpa, fieldNumber: 2) + } + if self.differentialPressureHpa != 0 { + try visitor.visitSingularFloatField(value: self.differentialPressureHpa, fieldNumber: 3) + } + if self.temperatureDeg != 0 { + try visitor.visitSingularFloatField(value: self.temperatureDeg, fieldNumber: 4) + } + if self.differentialPressureTemperatureDeg != 0 { + try visitor.visitSingularFloatField(value: self.differentialPressureTemperatureDeg, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_ScaledPressure, rhs: Mavsdk_Rpc_TelemetryServer_ScaledPressure) -> Bool { + if lhs.timestampUs != rhs.timestampUs {return false} + if lhs.absolutePressureHpa != rhs.absolutePressureHpa {return false} + if lhs.differentialPressureHpa != rhs.differentialPressureHpa {return false} + if lhs.temperatureDeg != rhs.temperatureDeg {return false} + if lhs.differentialPressureTemperatureDeg != rhs.differentialPressureTemperatureDeg {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PositionNed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PositionNed" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "north_m"), + 2: .standard(proto: "east_m"), + 3: .standard(proto: "down_m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.northM) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.eastM) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.downM) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.northM != 0 { + try visitor.visitSingularFloatField(value: self.northM, fieldNumber: 1) + } + if self.eastM != 0 { + try visitor.visitSingularFloatField(value: self.eastM, fieldNumber: 2) + } + if self.downM != 0 { + try visitor.visitSingularFloatField(value: self.downM, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PositionNed, rhs: Mavsdk_Rpc_TelemetryServer_PositionNed) -> Bool { + if lhs.northM != rhs.northM {return false} + if lhs.eastM != rhs.eastM {return false} + if lhs.downM != rhs.downM {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_VelocityNed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".VelocityNed" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "north_m_s"), + 2: .standard(proto: "east_m_s"), + 3: .standard(proto: "down_m_s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.northMS) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.eastMS) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.downMS) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.northMS != 0 { + try visitor.visitSingularFloatField(value: self.northMS, fieldNumber: 1) + } + if self.eastMS != 0 { + try visitor.visitSingularFloatField(value: self.eastMS, fieldNumber: 2) + } + if self.downMS != 0 { + try visitor.visitSingularFloatField(value: self.downMS, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_VelocityNed, rhs: Mavsdk_Rpc_TelemetryServer_VelocityNed) -> Bool { + if lhs.northMS != rhs.northMS {return false} + if lhs.eastMS != rhs.eastMS {return false} + if lhs.downMS != rhs.downMS {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_PositionVelocityNed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PositionVelocityNed" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "position"), + 2: .same(proto: "velocity"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._position) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._velocity) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._position { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if let v = self._velocity { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed, rhs: Mavsdk_Rpc_TelemetryServer_PositionVelocityNed) -> Bool { + if lhs._position != rhs._position {return false} + if lhs._velocity != rhs._velocity {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_GroundTruth: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GroundTruth" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "latitude_deg"), + 2: .standard(proto: "longitude_deg"), + 3: .standard(proto: "absolute_altitude_m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularDoubleField(value: &self.latitudeDeg) }() + case 2: try { try decoder.decodeSingularDoubleField(value: &self.longitudeDeg) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.absoluteAltitudeM) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.latitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.latitudeDeg, fieldNumber: 1) + } + if self.longitudeDeg != 0 { + try visitor.visitSingularDoubleField(value: self.longitudeDeg, fieldNumber: 2) + } + if self.absoluteAltitudeM != 0 { + try visitor.visitSingularFloatField(value: self.absoluteAltitudeM, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_GroundTruth, rhs: Mavsdk_Rpc_TelemetryServer_GroundTruth) -> Bool { + if lhs.latitudeDeg != rhs.latitudeDeg {return false} + if lhs.longitudeDeg != rhs.longitudeDeg {return false} + if lhs.absoluteAltitudeM != rhs.absoluteAltitudeM {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_FixedwingMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FixedwingMetrics" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "airspeed_m_s"), + 2: .standard(proto: "throttle_percentage"), + 3: .standard(proto: "climb_rate_m_s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.airspeedMS) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.throttlePercentage) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.climbRateMS) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.airspeedMS != 0 { + try visitor.visitSingularFloatField(value: self.airspeedMS, fieldNumber: 1) + } + if self.throttlePercentage != 0 { + try visitor.visitSingularFloatField(value: self.throttlePercentage, fieldNumber: 2) + } + if self.climbRateMS != 0 { + try visitor.visitSingularFloatField(value: self.climbRateMS, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_FixedwingMetrics, rhs: Mavsdk_Rpc_TelemetryServer_FixedwingMetrics) -> Bool { + if lhs.airspeedMS != rhs.airspeedMS {return false} + if lhs.throttlePercentage != rhs.throttlePercentage {return false} + if lhs.climbRateMS != rhs.climbRateMS {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_AccelerationFrd: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccelerationFrd" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "forward_m_s2"), + 2: .standard(proto: "right_m_s2"), + 3: .standard(proto: "down_m_s2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.forwardMS2) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.rightMS2) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.downMS2) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.forwardMS2 != 0 { + try visitor.visitSingularFloatField(value: self.forwardMS2, fieldNumber: 1) + } + if self.rightMS2 != 0 { + try visitor.visitSingularFloatField(value: self.rightMS2, fieldNumber: 2) + } + if self.downMS2 != 0 { + try visitor.visitSingularFloatField(value: self.downMS2, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_AccelerationFrd, rhs: Mavsdk_Rpc_TelemetryServer_AccelerationFrd) -> Bool { + if lhs.forwardMS2 != rhs.forwardMS2 {return false} + if lhs.rightMS2 != rhs.rightMS2 {return false} + if lhs.downMS2 != rhs.downMS2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AngularVelocityFrd" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "forward_rad_s"), + 2: .standard(proto: "right_rad_s"), + 3: .standard(proto: "down_rad_s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.forwardRadS) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.rightRadS) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.downRadS) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.forwardRadS != 0 { + try visitor.visitSingularFloatField(value: self.forwardRadS, fieldNumber: 1) + } + if self.rightRadS != 0 { + try visitor.visitSingularFloatField(value: self.rightRadS, fieldNumber: 2) + } + if self.downRadS != 0 { + try visitor.visitSingularFloatField(value: self.downRadS, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd, rhs: Mavsdk_Rpc_TelemetryServer_AngularVelocityFrd) -> Bool { + if lhs.forwardRadS != rhs.forwardRadS {return false} + if lhs.rightRadS != rhs.rightRadS {return false} + if lhs.downRadS != rhs.downRadS {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MagneticFieldFrd" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "forward_gauss"), + 2: .standard(proto: "right_gauss"), + 3: .standard(proto: "down_gauss"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.forwardGauss) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.rightGauss) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.downGauss) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.forwardGauss != 0 { + try visitor.visitSingularFloatField(value: self.forwardGauss, fieldNumber: 1) + } + if self.rightGauss != 0 { + try visitor.visitSingularFloatField(value: self.rightGauss, fieldNumber: 2) + } + if self.downGauss != 0 { + try visitor.visitSingularFloatField(value: self.downGauss, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd, rhs: Mavsdk_Rpc_TelemetryServer_MagneticFieldFrd) -> Bool { + if lhs.forwardGauss != rhs.forwardGauss {return false} + if lhs.rightGauss != rhs.rightGauss {return false} + if lhs.downGauss != rhs.downGauss {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_Imu: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Imu" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "acceleration_frd"), + 2: .standard(proto: "angular_velocity_frd"), + 3: .standard(proto: "magnetic_field_frd"), + 4: .standard(proto: "temperature_degc"), + 5: .standard(proto: "timestamp_us"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._accelerationFrd) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._angularVelocityFrd) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._magneticFieldFrd) }() + case 4: try { try decoder.decodeSingularFloatField(value: &self.temperatureDegc) }() + case 5: try { try decoder.decodeSingularUInt64Field(value: &self.timestampUs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if let v = self._accelerationFrd { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if let v = self._angularVelocityFrd { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } + if let v = self._magneticFieldFrd { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } + if self.temperatureDegc != 0 { + try visitor.visitSingularFloatField(value: self.temperatureDegc, fieldNumber: 4) + } + if self.timestampUs != 0 { + try visitor.visitSingularUInt64Field(value: self.timestampUs, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_Imu, rhs: Mavsdk_Rpc_TelemetryServer_Imu) -> Bool { + if lhs._accelerationFrd != rhs._accelerationFrd {return false} + if lhs._angularVelocityFrd != rhs._angularVelocityFrd {return false} + if lhs._magneticFieldFrd != rhs._magneticFieldFrd {return false} + if lhs.temperatureDegc != rhs.temperatureDegc {return false} + if lhs.timestampUs != rhs.timestampUs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_TelemetryServerResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TelemetryServerResult" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "result"), + 2: .standard(proto: "result_str"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.resultStr) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.result != .unknown { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) + } + if !self.resultStr.isEmpty { + try visitor.visitSingularStringField(value: self.resultStr, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult, rhs: Mavsdk_Rpc_TelemetryServer_TelemetryServerResult) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.resultStr != rhs.resultStr {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Mavsdk_Rpc_TelemetryServer_TelemetryServerResult.Result: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "RESULT_UNKNOWN"), + 1: .same(proto: "RESULT_SUCCESS"), + 2: .same(proto: "RESULT_NO_SYSTEM"), + 3: .same(proto: "RESULT_CONNECTION_ERROR"), + 4: .same(proto: "RESULT_BUSY"), + 5: .same(proto: "RESULT_COMMAND_DENIED"), + 6: .same(proto: "RESULT_TIMEOUT"), + 7: .same(proto: "RESULT_UNSUPPORTED"), + ] +} diff --git a/Sources/Mavsdk/Generated/tune.pb.swift b/Sources/Mavsdk/Generated/tune.pb.swift index d57616d..97c754c 100644 --- a/Sources/Mavsdk/Generated/tune.pb.swift +++ b/Sources/Mavsdk/Generated/tune.pb.swift @@ -270,6 +270,9 @@ struct Mavsdk_Rpc_Tune_TuneResult { /// Failed to send the request case error // = 4 + + /// No system connected + case noSystem // = 5 case UNRECOGNIZED(Int) init() { @@ -283,6 +286,7 @@ struct Mavsdk_Rpc_Tune_TuneResult { case 2: self = .invalidTempo case 3: self = .tuneTooLong case 4: self = .error + case 5: self = .noSystem default: self = .UNRECOGNIZED(rawValue) } } @@ -294,6 +298,7 @@ struct Mavsdk_Rpc_Tune_TuneResult { case .invalidTempo: return 2 case .tuneTooLong: return 3 case .error: return 4 + case .noSystem: return 5 case .UNRECOGNIZED(let i): return i } } @@ -313,6 +318,7 @@ extension Mavsdk_Rpc_Tune_TuneResult.Result: CaseIterable { .invalidTempo, .tuneTooLong, .error, + .noSystem, ] } @@ -495,5 +501,6 @@ extension Mavsdk_Rpc_Tune_TuneResult.Result: SwiftProtobuf._ProtoNameProviding { 2: .same(proto: "RESULT_INVALID_TEMPO"), 3: .same(proto: "RESULT_TUNE_TOO_LONG"), 4: .same(proto: "RESULT_ERROR"), + 5: .same(proto: "RESULT_NO_SYSTEM"), ] } diff --git a/Sources/Mavsdk/proto b/Sources/Mavsdk/proto index a968c01..a84ff0f 160000 --- a/Sources/Mavsdk/proto +++ b/Sources/Mavsdk/proto @@ -1 +1 @@ -Subproject commit a968c018dd0216425d79307aa382192ed62e2362 +Subproject commit a84ff0f67a73a28564142767227720e04250ad38 From 0bf9b8f8b993bc44f3df6d9f2e75c2cd23cf1e42 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 22 Jul 2021 18:39:18 +0200 Subject: [PATCH 2/3] Remove tracking_server and param_erver for now They don't build currently. --- Sources/Mavsdk/Generated/ParamServer.swift | 513 -------- Sources/Mavsdk/Generated/TrackingServer.swift | 636 ---------- .../Mavsdk/Generated/param_server.grpc.swift | 327 ----- .../Mavsdk/Generated/param_server.pb.swift | 832 ------------ .../Generated/tracking_server.grpc.swift | 481 ------- .../Mavsdk/Generated/tracking_server.pb.swift | 1117 ----------------- .../Mavsdk/tools/generate_from_protos.bash | 14 + 7 files changed, 14 insertions(+), 3906 deletions(-) delete mode 100644 Sources/Mavsdk/Generated/ParamServer.swift delete mode 100644 Sources/Mavsdk/Generated/TrackingServer.swift delete mode 100644 Sources/Mavsdk/Generated/param_server.grpc.swift delete mode 100644 Sources/Mavsdk/Generated/param_server.pb.swift delete mode 100644 Sources/Mavsdk/Generated/tracking_server.grpc.swift delete mode 100644 Sources/Mavsdk/Generated/tracking_server.pb.swift diff --git a/Sources/Mavsdk/Generated/ParamServer.swift b/Sources/Mavsdk/Generated/ParamServer.swift deleted file mode 100644 index 1c87f4e..0000000 --- a/Sources/Mavsdk/Generated/ParamServer.swift +++ /dev/null @@ -1,513 +0,0 @@ -import Foundation -import RxSwift -import GRPC -import NIO - -/** - Provide raw access to retrieve and provide server parameters. - */ -public class ParamServer { - private let service: Mavsdk_Rpc_ParamServer_ParamServerServiceClient - private let scheduler: SchedulerType - private let clientEventLoopGroup: EventLoopGroup - - /** - Initializes a new `ParamServer` plugin. - - Normally never created manually, but used from the `Drone` helper class instead. - - - Parameters: - - address: The address of the `MavsdkServer` instance to connect to - - port: The port of the `MavsdkServer` instance to connect to - - scheduler: The scheduler to be used by `Observable`s - */ - public convenience init(address: String = "localhost", - port: Int32 = 50051, - scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background)) { - let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 2) - let channel = ClientConnection.insecure(group: eventLoopGroup).connect(host: address, port: Int(port)) - let service = Mavsdk_Rpc_ParamServer_ParamServerServiceClient(channel: channel) - - self.init(service: service, scheduler: scheduler, eventLoopGroup: eventLoopGroup) - } - - init(service: Mavsdk_Rpc_ParamServer_ParamServerServiceClient, scheduler: SchedulerType, eventLoopGroup: EventLoopGroup) { - self.service = service - self.scheduler = scheduler - self.clientEventLoopGroup = eventLoopGroup - } - - public struct RuntimeParamServerError: Error { - public let description: String - - init(_ description: String) { - self.description = description - } - } - - - public struct ParamServerError: Error { - public let code: ParamServer.ParamServerResult.Result - public let description: String - } - - - - /** - Type for integer parameters. - */ - public struct IntParam: Equatable { - public let name: String - public let value: Int32 - - - - /** - Initializes a new `IntParam`. - - - - Parameters: - - - name: Name of the parameter - - - value: Value of the parameter - - - */ - public init(name: String, value: Int32) { - self.name = name - self.value = value - } - - internal var rpcIntParam: Mavsdk_Rpc_ParamServer_IntParam { - var rpcIntParam = Mavsdk_Rpc_ParamServer_IntParam() - - - rpcIntParam.name = name - - - - - rpcIntParam.value = value - - - - return rpcIntParam - } - - internal static func translateFromRpc(_ rpcIntParam: Mavsdk_Rpc_ParamServer_IntParam) -> IntParam { - return IntParam(name: rpcIntParam.name, value: rpcIntParam.value) - } - - public static func == (lhs: IntParam, rhs: IntParam) -> Bool { - return lhs.name == rhs.name - && lhs.value == rhs.value - } - } - - /** - Type for float parameters. - */ - public struct FloatParam: Equatable { - public let name: String - public let value: Float - - - - /** - Initializes a new `FloatParam`. - - - - Parameters: - - - name: Name of the parameter - - - value: Value of the parameter - - - */ - public init(name: String, value: Float) { - self.name = name - self.value = value - } - - internal var rpcFloatParam: Mavsdk_Rpc_ParamServer_FloatParam { - var rpcFloatParam = Mavsdk_Rpc_ParamServer_FloatParam() - - - rpcFloatParam.name = name - - - - - rpcFloatParam.value = value - - - - return rpcFloatParam - } - - internal static func translateFromRpc(_ rpcFloatParam: Mavsdk_Rpc_ParamServer_FloatParam) -> FloatParam { - return FloatParam(name: rpcFloatParam.name, value: rpcFloatParam.value) - } - - public static func == (lhs: FloatParam, rhs: FloatParam) -> Bool { - return lhs.name == rhs.name - && lhs.value == rhs.value - } - } - - /** - Type collecting all integer and float parameters. - */ - public struct AllParams: Equatable { - public let intParams: [IntParam] - public let floatParams: [FloatParam] - - - - /** - Initializes a new `AllParams`. - - - - Parameters: - - - intParams: Collection of all parameter names and values of type int - - - floatParams: Collection of all parameter names and values of type float - - - */ - public init(intParams: [IntParam], floatParams: [FloatParam]) { - self.intParams = intParams - self.floatParams = floatParams - } - - internal var rpcAllParams: Mavsdk_Rpc_ParamServer_AllParams { - var rpcAllParams = Mavsdk_Rpc_ParamServer_AllParams() - - - rpcAllParams.intParams = intParams.map{ $0.rpcIntParam } - - - - - rpcAllParams.floatParams = floatParams.map{ $0.rpcFloatParam } - - - - return rpcAllParams - } - - internal static func translateFromRpc(_ rpcAllParams: Mavsdk_Rpc_ParamServer_AllParams) -> AllParams { - return AllParams(intParams: rpcAllParams.intParams.map{ IntParam.translateFromRpc($0) }, floatParams: rpcAllParams.floatParams.map{ FloatParam.translateFromRpc($0) }) - } - - public static func == (lhs: AllParams, rhs: AllParams) -> Bool { - return lhs.intParams == rhs.intParams - && lhs.floatParams == rhs.floatParams - } - } - - /** - Result type. - */ - public struct ParamServerResult: Equatable { - public let result: Result - public let resultStr: String - - - - - /** - Possible results returned for param requests. - */ - public enum Result: Equatable { - /// Unknown result. - case unknown - /// Request succeeded. - case success - /// Not Found. - case notFound - /// Wrong type. - case wrongType - /// Parameter name too long (> 16). - case paramNameTooLong - case UNRECOGNIZED(Int) - - internal var rpcResult: Mavsdk_Rpc_ParamServer_ParamServerResult.Result { - switch self { - case .unknown: - return .unknown - case .success: - return .success - case .notFound: - return .notFound - case .wrongType: - return .wrongType - case .paramNameTooLong: - return .paramNameTooLong - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - - internal static func translateFromRpc(_ rpcResult: Mavsdk_Rpc_ParamServer_ParamServerResult.Result) -> Result { - switch rpcResult { - case .unknown: - return .unknown - case .success: - return .success - case .notFound: - return .notFound - case .wrongType: - return .wrongType - case .paramNameTooLong: - return .paramNameTooLong - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - } - - - /** - Initializes a new `ParamServerResult`. - - - - Parameters: - - - result: Result enum value - - - resultStr: Human-readable English string describing the result - - - */ - public init(result: Result, resultStr: String) { - self.result = result - self.resultStr = resultStr - } - - internal var rpcParamServerResult: Mavsdk_Rpc_ParamServer_ParamServerResult { - var rpcParamServerResult = Mavsdk_Rpc_ParamServer_ParamServerResult() - - - rpcParamServerResult.result = result.rpcResult - - - - - rpcParamServerResult.resultStr = resultStr - - - - return rpcParamServerResult - } - - internal static func translateFromRpc(_ rpcParamServerResult: Mavsdk_Rpc_ParamServer_ParamServerResult) -> ParamServerResult { - return ParamServerResult(result: Result.translateFromRpc(rpcParamServerResult.result), resultStr: rpcParamServerResult.resultStr) - } - - public static func == (lhs: ParamServerResult, rhs: ParamServerResult) -> Bool { - return lhs.result == rhs.result - && lhs.resultStr == rhs.resultStr - } - } - - - /** - Retrieve an int parameter. - - If the type is wrong, the result will be `WRONG_TYPE`. - - - Parameter name: Name of the parameter - - */ - public func retrieveParamInt(name: String) -> Single { - return Single.create { single in - var request = Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest() - - - - request.name = name - - - - do { - let response = self.service.retrieveParamInt(request) - - - let result = try response.response.wait().paramServerResult - if (result.result != Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { - single(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - - return Disposables.create() - } - - - let value = try response.response.wait().value - - single(.success(value)) - } catch { - single(.error(error)) - } - - return Disposables.create() - } - } - - /** - Provide an int parameter. - - If the type is wrong, the result will be `WRONG_TYPE`. - - - Parameters: - - name: Name of the parameter to provide - - value: Value the parameter should be set to - - */ - public func provideParamInt(name: String, value: Int32) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_ParamServer_ProvideParamIntRequest() - - - - request.name = name - - - - request.value = value - - - - do { - - let response = self.service.provideParamInt(request) - - let result = try response.response.wait().paramServerResult - if (result.result == Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { - completable(.completed) - } else { - completable(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - } - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Retrieve a float parameter. - - If the type is wrong, the result will be `WRONG_TYPE`. - - - Parameter name: Name of the parameter - - */ - public func retrieveParamFloat(name: String) -> Single { - return Single.create { single in - var request = Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest() - - - - request.name = name - - - - do { - let response = self.service.retrieveParamFloat(request) - - - let result = try response.response.wait().paramServerResult - if (result.result != Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { - single(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - - return Disposables.create() - } - - - let value = try response.response.wait().value - - single(.success(value)) - } catch { - single(.error(error)) - } - - return Disposables.create() - } - } - - /** - Provide a float parameter. - - If the type is wrong, the result will be `WRONG_TYPE`. - - - Parameters: - - name: Name of the parameter to provide - - value: Value the parameter should be set to - - */ - public func provideParamFloat(name: String, value: Float) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest() - - - - request.name = name - - - - request.value = value - - - - do { - - let response = self.service.provideParamFloat(request) - - let result = try response.response.wait().paramServerResult - if (result.result == Mavsdk_Rpc_ParamServer_ParamServerResult.Result.success) { - completable(.completed) - } else { - completable(.error(ParamServerError(code: ParamServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - } - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Retrieve all parameters. - - - */ - public func retrieveAllParams() -> Single { - return Single.create { single in - let request = Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest() - - - - do { - let response = self.service.retrieveAllParams(request) - - - - - let params = try AllParams.translateFromRpc(response.response.wait().params) - - single(.success(params)) - } catch { - single(.error(error)) - } - - return Disposables.create() - } - } -} \ No newline at end of file diff --git a/Sources/Mavsdk/Generated/TrackingServer.swift b/Sources/Mavsdk/Generated/TrackingServer.swift deleted file mode 100644 index 39a553f..0000000 --- a/Sources/Mavsdk/Generated/TrackingServer.swift +++ /dev/null @@ -1,636 +0,0 @@ -import Foundation -import RxSwift -import GRPC -import NIO - -/** - API for an onboard image tracking software. - */ -public class TrackingServer { - private let service: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClient - private let scheduler: SchedulerType - private let clientEventLoopGroup: EventLoopGroup - - /** - Initializes a new `TrackingServer` plugin. - - Normally never created manually, but used from the `Drone` helper class instead. - - - Parameters: - - address: The address of the `MavsdkServer` instance to connect to - - port: The port of the `MavsdkServer` instance to connect to - - scheduler: The scheduler to be used by `Observable`s - */ - public convenience init(address: String = "localhost", - port: Int32 = 50051, - scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background)) { - let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 2) - let channel = ClientConnection.insecure(group: eventLoopGroup).connect(host: address, port: Int(port)) - let service = Mavsdk_Rpc_TrackingServer_TrackingServerServiceClient(channel: channel) - - self.init(service: service, scheduler: scheduler, eventLoopGroup: eventLoopGroup) - } - - init(service: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClient, scheduler: SchedulerType, eventLoopGroup: EventLoopGroup) { - self.service = service - self.scheduler = scheduler - self.clientEventLoopGroup = eventLoopGroup - } - - public struct RuntimeTrackingServerError: Error { - public let description: String - - init(_ description: String) { - self.description = description - } - } - - - public struct TrackingServerError: Error { - public let code: TrackingServer.TrackingServerResult.Result - public let description: String - } - - - /** - Answer to respond to an incoming command - */ - public enum CommandAnswer: Equatable { - /// Command accepted. - case accepted - /// Command temporarily rejected. - case temporarilyRejected - /// Command denied. - case denied - /// Command unsupported. - case unsupported - /// Command failed. - case failed - case UNRECOGNIZED(Int) - - internal var rpcCommandAnswer: Mavsdk_Rpc_TrackingServer_CommandAnswer { - switch self { - case .accepted: - return .accepted - case .temporarilyRejected: - return .temporarilyRejected - case .denied: - return .denied - case .unsupported: - return .unsupported - case .failed: - return .failed - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - - internal static func translateFromRpc(_ rpcCommandAnswer: Mavsdk_Rpc_TrackingServer_CommandAnswer) -> CommandAnswer { - switch rpcCommandAnswer { - case .accepted: - return .accepted - case .temporarilyRejected: - return .temporarilyRejected - case .denied: - return .denied - case .unsupported: - return .unsupported - case .failed: - return .failed - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - } - - - /** - Point description type - */ - public struct TrackPoint: Equatable { - public let pointX: Float - public let pointY: Float - public let radius: Float - - - - /** - Initializes a new `TrackPoint`. - - - - Parameters: - - - pointX: Point to track x value (normalized 0..1, 0 is left, 1 is right). - - - pointY: Point to track y value (normalized 0..1, 0 is top, 1 is bottom). - - - radius: Point to track y value (normalized 0..1, 0 is top, 1 is bottom). - - - */ - public init(pointX: Float, pointY: Float, radius: Float) { - self.pointX = pointX - self.pointY = pointY - self.radius = radius - } - - internal var rpcTrackPoint: Mavsdk_Rpc_TrackingServer_TrackPoint { - var rpcTrackPoint = Mavsdk_Rpc_TrackingServer_TrackPoint() - - - rpcTrackPoint.pointX = pointX - - - - - rpcTrackPoint.pointY = pointY - - - - - rpcTrackPoint.radius = radius - - - - return rpcTrackPoint - } - - internal static func translateFromRpc(_ rpcTrackPoint: Mavsdk_Rpc_TrackingServer_TrackPoint) -> TrackPoint { - return TrackPoint(pointX: rpcTrackPoint.pointX, pointY: rpcTrackPoint.pointY, radius: rpcTrackPoint.radius) - } - - public static func == (lhs: TrackPoint, rhs: TrackPoint) -> Bool { - return lhs.pointX == rhs.pointX - && lhs.pointY == rhs.pointY - && lhs.radius == rhs.radius - } - } - - /** - Rectangle description type - */ - public struct TrackRectangle: Equatable { - public let topLeftCornerX: Float - public let topLeftCornerY: Float - public let bottomRightCornerX: Float - public let bottomRightCornerY: Float - - - - /** - Initializes a new `TrackRectangle`. - - - - Parameters: - - - topLeftCornerX: Top left corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). - - - topLeftCornerY: Top left corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). - - - bottomRightCornerX: Bottom right corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). - - - bottomRightCornerY: Bottom right corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). - - - */ - public init(topLeftCornerX: Float, topLeftCornerY: Float, bottomRightCornerX: Float, bottomRightCornerY: Float) { - self.topLeftCornerX = topLeftCornerX - self.topLeftCornerY = topLeftCornerY - self.bottomRightCornerX = bottomRightCornerX - self.bottomRightCornerY = bottomRightCornerY - } - - internal var rpcTrackRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle { - var rpcTrackRectangle = Mavsdk_Rpc_TrackingServer_TrackRectangle() - - - rpcTrackRectangle.topLeftCornerX = topLeftCornerX - - - - - rpcTrackRectangle.topLeftCornerY = topLeftCornerY - - - - - rpcTrackRectangle.bottomRightCornerX = bottomRightCornerX - - - - - rpcTrackRectangle.bottomRightCornerY = bottomRightCornerY - - - - return rpcTrackRectangle - } - - internal static func translateFromRpc(_ rpcTrackRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle) -> TrackRectangle { - return TrackRectangle(topLeftCornerX: rpcTrackRectangle.topLeftCornerX, topLeftCornerY: rpcTrackRectangle.topLeftCornerY, bottomRightCornerX: rpcTrackRectangle.bottomRightCornerX, bottomRightCornerY: rpcTrackRectangle.bottomRightCornerY) - } - - public static func == (lhs: TrackRectangle, rhs: TrackRectangle) -> Bool { - return lhs.topLeftCornerX == rhs.topLeftCornerX - && lhs.topLeftCornerY == rhs.topLeftCornerY - && lhs.bottomRightCornerX == rhs.bottomRightCornerX - && lhs.bottomRightCornerY == rhs.bottomRightCornerY - } - } - - /** - Result type - */ - public struct TrackingServerResult: Equatable { - public let result: Result - public let resultStr: String - - - - - /** - Possible results returned for tracking_server requests. - */ - public enum Result: Equatable { - /// Unknown result. - case unknown - /// Request succeeded. - case success - /// No system is connected. - case noSystem - /// Connection error. - case connectionError - case UNRECOGNIZED(Int) - - internal var rpcResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result { - switch self { - case .unknown: - return .unknown - case .success: - return .success - case .noSystem: - return .noSystem - case .connectionError: - return .connectionError - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - - internal static func translateFromRpc(_ rpcResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result) -> Result { - switch rpcResult { - case .unknown: - return .unknown - case .success: - return .success - case .noSystem: - return .noSystem - case .connectionError: - return .connectionError - case .UNRECOGNIZED(let i): - return .UNRECOGNIZED(i) - } - } - } - - - /** - Initializes a new `TrackingServerResult`. - - - - Parameters: - - - result: Result enum value - - - resultStr: Human-readable English string describing the result - - - */ - public init(result: Result, resultStr: String) { - self.result = result - self.resultStr = resultStr - } - - internal var rpcTrackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult { - var rpcTrackingServerResult = Mavsdk_Rpc_TrackingServer_TrackingServerResult() - - - rpcTrackingServerResult.result = result.rpcResult - - - - - rpcTrackingServerResult.resultStr = resultStr - - - - return rpcTrackingServerResult - } - - internal static func translateFromRpc(_ rpcTrackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult) -> TrackingServerResult { - return TrackingServerResult(result: Result.translateFromRpc(rpcTrackingServerResult.result), resultStr: rpcTrackingServerResult.resultStr) - } - - public static func == (lhs: TrackingServerResult, rhs: TrackingServerResult) -> Bool { - return lhs.result == rhs.result - && lhs.resultStr == rhs.resultStr - } - } - - - /** - Set/update the current point tracking status. - - - Parameter trackedPoint: The tracked point - - */ - public func setTrackingPointStatus(trackedPoint: TrackPoint) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest() - - - - request.trackedPoint = trackedPoint.rpcTrackPoint - - - - do { - - let _ = try self.service.setTrackingPointStatus(request) - completable(.completed) - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Set/update the current rectangle tracking status. - - - Parameter trackedRectangle: The tracked rectangle - - */ - public func setTrackingRectangleStatus(trackedRectangle: TrackRectangle) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest() - - - - request.trackedRectangle = trackedRectangle.rpcTrackRectangle - - - - do { - - let _ = try self.service.setTrackingRectangleStatus(request) - completable(.completed) - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Set the current tracking status to off. - - - */ - public func setTrackingOffStatus() -> Completable { - return Completable.create { completable in - let request = Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest() - - - - do { - - let _ = try self.service.setTrackingOffStatus(request) - completable(.completed) - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - - /** - Subscribe to incoming tracking point command. - */ - public lazy var trackingPointCommand: Observable = createTrackingPointCommandObservable() - - - - private func createTrackingPointCommandObservable() -> Observable { - return Observable.create { observer in - let request = Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest() - - - - _ = self.service.subscribeTrackingPointCommand(request, handler: { (response) in - - - - let trackingPointCommand = TrackPoint.translateFromRpc(response.trackPoint) - - - - observer.onNext(trackingPointCommand) - - }) - - return Disposables.create() - } - .retryWhen { error in - error.map { - guard $0 is RuntimeTrackingServerError else { throw $0 } - } - } - .share(replay: 1) - } - - - /** - Subscribe to incoming tracking rectangle command. - */ - public lazy var trackingRectangleCommand: Observable = createTrackingRectangleCommandObservable() - - - - private func createTrackingRectangleCommandObservable() -> Observable { - return Observable.create { observer in - let request = Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest() - - - - _ = self.service.subscribeTrackingRectangleCommand(request, handler: { (response) in - - - - let trackingRectangleCommand = TrackRectangle.translateFromRpc(response.trackRectangle) - - - - observer.onNext(trackingRectangleCommand) - - }) - - return Disposables.create() - } - .retryWhen { error in - error.map { - guard $0 is RuntimeTrackingServerError else { throw $0 } - } - } - .share(replay: 1) - } - - - /** - Subscribe to incoming tracking off command. - */ - public lazy var trackingOffCommand: Observable = createTrackingOffCommandObservable() - - - - private func createTrackingOffCommandObservable() -> Observable { - return Observable.create { observer in - let request = Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest() - - - - _ = self.service.subscribeTrackingOffCommand(request, handler: { (response) in - - - - let trackingOffCommand = response.dummy - - - - - observer.onNext(trackingOffCommand) - - }) - - return Disposables.create() - } - .retryWhen { error in - error.map { - guard $0 is RuntimeTrackingServerError else { throw $0 } - } - } - .share(replay: 1) - } - - /** - Respond to an incoming tracking point command. - - - Parameter commandAnswer: The ack to answer to the incoming command - - */ - public func respondTrackingPointCommand(commandAnswer: CommandAnswer) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest() - - - - request.commandAnswer = commandAnswer.rpcCommandAnswer - - - - do { - - let response = self.service.respondTrackingPointCommand(request) - - let result = try response.response.wait().trackingServerResult - if (result.result == Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result.success) { - completable(.completed) - } else { - completable(.error(TrackingServerError(code: TrackingServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - } - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Respond to an incoming tracking rectangle command. - - - Parameter commandAnswer: The ack to answer to the incoming command - - */ - public func respondTrackingRectangleCommand(commandAnswer: CommandAnswer) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest() - - - - request.commandAnswer = commandAnswer.rpcCommandAnswer - - - - do { - - let response = self.service.respondTrackingRectangleCommand(request) - - let result = try response.response.wait().trackingServerResult - if (result.result == Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result.success) { - completable(.completed) - } else { - completable(.error(TrackingServerError(code: TrackingServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - } - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } - - /** - Respond to an incoming tracking off command. - - - Parameter commandAnswer: The ack to answer to the incoming command - - */ - public func respondTrackingOffCommand(commandAnswer: CommandAnswer) -> Completable { - return Completable.create { completable in - var request = Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest() - - - - request.commandAnswer = commandAnswer.rpcCommandAnswer - - - - do { - - let response = self.service.respondTrackingOffCommand(request) - - let result = try response.response.wait().trackingServerResult - if (result.result == Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result.success) { - completable(.completed) - } else { - completable(.error(TrackingServerError(code: TrackingServerResult.Result.translateFromRpc(result.result), description: result.resultStr))) - } - - } catch { - completable(.error(error)) - } - - return Disposables.create() - } - } -} \ No newline at end of file diff --git a/Sources/Mavsdk/Generated/param_server.grpc.swift b/Sources/Mavsdk/Generated/param_server.grpc.swift deleted file mode 100644 index cd16438..0000000 --- a/Sources/Mavsdk/Generated/param_server.grpc.swift +++ /dev/null @@ -1,327 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: param_server.proto -// - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -import GRPC -import NIO -import SwiftProtobuf - - -/// Provide raw access to retrieve and provide server parameters. -/// -/// Usage: instantiate `Mavsdk_Rpc_ParamServer_ParamServerServiceClient`, then call methods of this protocol to make API calls. -internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? { get } - - func retrieveParamInt( - _ request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func provideParamInt( - _ request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func retrieveParamFloat( - _ request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func provideParamFloat( - _ request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func retrieveAllParams( - _ request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol { - internal var serviceName: String { - return "mavsdk.rpc.param_server.ParamServerService" - } - - /// - /// Retrieve an int parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - /// - /// - Parameters: - /// - request: Request to send to RetrieveParamInt. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func retrieveParamInt( - _ request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveParamInt", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRetrieveParamIntInterceptors() ?? [] - ) - } - - /// - /// Provide an int parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - /// - /// - Parameters: - /// - request: Request to send to ProvideParamInt. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func provideParamInt( - _ request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.param_server.ParamServerService/ProvideParamInt", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeProvideParamIntInterceptors() ?? [] - ) - } - - /// - /// Retrieve a float parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - /// - /// - Parameters: - /// - request: Request to send to RetrieveParamFloat. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func retrieveParamFloat( - _ request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveParamFloat", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRetrieveParamFloatInterceptors() ?? [] - ) - } - - /// - /// Provide a float parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - /// - /// - Parameters: - /// - request: Request to send to ProvideParamFloat. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func provideParamFloat( - _ request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.param_server.ParamServerService/ProvideParamFloat", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeProvideParamFloatInterceptors() ?? [] - ) - } - - /// - /// Retrieve all parameters. - /// - /// - Parameters: - /// - request: Request to send to RetrieveAllParams. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func retrieveAllParams( - _ request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.param_server.ParamServerService/RetrieveAllParams", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRetrieveAllParamsInterceptors() ?? [] - ) - } -} - -internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol { - - /// - Returns: Interceptors to use when invoking 'retrieveParamInt'. - func makeRetrieveParamIntInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'provideParamInt'. - func makeProvideParamIntInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'retrieveParamFloat'. - func makeRetrieveParamFloatInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'provideParamFloat'. - func makeProvideParamFloatInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'retrieveAllParams'. - func makeRetrieveAllParamsInterceptors() -> [ClientInterceptor] -} - -internal final class Mavsdk_Rpc_ParamServer_ParamServerServiceClient: Mavsdk_Rpc_ParamServer_ParamServerServiceClientProtocol { - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the mavsdk.rpc.param_server.ParamServerService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -/// Provide raw access to retrieve and provide server parameters. -/// -/// To build a server, implement a class that conforms to this protocol. -internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceProvider: CallHandlerProvider { - var interceptors: Mavsdk_Rpc_ParamServer_ParamServerServiceServerInterceptorFactoryProtocol? { get } - - /// - /// Retrieve an int parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - func retrieveParamInt(request: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// - /// Provide an int parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - func provideParamInt(request: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// - /// Retrieve a float parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - func retrieveParamFloat(request: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// - /// Provide a float parameter. - /// - /// If the type is wrong, the result will be `WRONG_TYPE`. - func provideParamFloat(request: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// - /// Retrieve all parameters. - func retrieveAllParams(request: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Mavsdk_Rpc_ParamServer_ParamServerServiceProvider { - internal var serviceName: Substring { return "mavsdk.rpc.param_server.ParamServerService" } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "RetrieveParamInt": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRetrieveParamIntInterceptors() ?? [], - userFunction: self.retrieveParamInt(request:context:) - ) - - case "ProvideParamInt": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeProvideParamIntInterceptors() ?? [], - userFunction: self.provideParamInt(request:context:) - ) - - case "RetrieveParamFloat": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRetrieveParamFloatInterceptors() ?? [], - userFunction: self.retrieveParamFloat(request:context:) - ) - - case "ProvideParamFloat": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeProvideParamFloatInterceptors() ?? [], - userFunction: self.provideParamFloat(request:context:) - ) - - case "RetrieveAllParams": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRetrieveAllParamsInterceptors() ?? [], - userFunction: self.retrieveAllParams(request:context:) - ) - - default: - return nil - } - } -} - -internal protocol Mavsdk_Rpc_ParamServer_ParamServerServiceServerInterceptorFactoryProtocol { - - /// - Returns: Interceptors to use when handling 'retrieveParamInt'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRetrieveParamIntInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'provideParamInt'. - /// Defaults to calling `self.makeInterceptors()`. - func makeProvideParamIntInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'retrieveParamFloat'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRetrieveParamFloatInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'provideParamFloat'. - /// Defaults to calling `self.makeInterceptors()`. - func makeProvideParamFloatInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'retrieveAllParams'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRetrieveAllParamsInterceptors() -> [ServerInterceptor] -} diff --git a/Sources/Mavsdk/Generated/param_server.pb.swift b/Sources/Mavsdk/Generated/param_server.pb.swift deleted file mode 100644 index ac32802..0000000 --- a/Sources/Mavsdk/Generated/param_server.pb.swift +++ /dev/null @@ -1,832 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: param_server.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -struct Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter - var name: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { - get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} - set {_paramResult = newValue} - } - /// Returns true if `paramResult` has been explicitly set. - var hasParamResult: Bool {return self._paramResult != nil} - /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. - mutating func clearParamResult() {self._paramResult = nil} - - /// Value of the requested parameter - var value: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil -} - -struct Mavsdk_Rpc_ParamServer_ProvideParamIntRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter to provide - var name: String = String() - - /// Value the parameter should be set to - var value: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_ParamServer_ProvideParamIntResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { - get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} - set {_paramResult = newValue} - } - /// Returns true if `paramResult` has been explicitly set. - var hasParamResult: Bool {return self._paramResult != nil} - /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. - mutating func clearParamResult() {self._paramResult = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil -} - -struct Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter - var name: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { - get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} - set {_paramResult = newValue} - } - /// Returns true if `paramResult` has been explicitly set. - var hasParamResult: Bool {return self._paramResult != nil} - /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. - mutating func clearParamResult() {self._paramResult = nil} - - /// Value of the requested parameter - var value: Float = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil -} - -struct Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter to provide - var name: String = String() - - /// Value the parameter should be set to - var value: Float = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult { - get {return _paramResult ?? Mavsdk_Rpc_ParamServer_ParamServerResult()} - set {_paramResult = newValue} - } - /// Returns true if `paramResult` has been explicitly set. - var hasParamResult: Bool {return self._paramResult != nil} - /// Clears the value of `paramResult`. Subsequent reads from it will return its default value. - mutating func clearParamResult() {self._paramResult = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _paramResult: Mavsdk_Rpc_ParamServer_ParamServerResult? = nil -} - -struct Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Collection of all parameters - var params: Mavsdk_Rpc_ParamServer_AllParams { - get {return _params ?? Mavsdk_Rpc_ParamServer_AllParams()} - set {_params = newValue} - } - /// Returns true if `params` has been explicitly set. - var hasParams: Bool {return self._params != nil} - /// Clears the value of `params`. Subsequent reads from it will return its default value. - mutating func clearParams() {self._params = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _params: Mavsdk_Rpc_ParamServer_AllParams? = nil -} - -/// -/// Type for integer parameters. -struct Mavsdk_Rpc_ParamServer_IntParam { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter - var name: String = String() - - /// Value of the parameter - var value: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// -/// Type for float parameters. -struct Mavsdk_Rpc_ParamServer_FloatParam { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Name of the parameter - var name: String = String() - - /// Value of the parameter - var value: Float = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// -/// Type collecting all integer and float parameters. -struct Mavsdk_Rpc_ParamServer_AllParams { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Collection of all parameter names and values of type int - var intParams: [Mavsdk_Rpc_ParamServer_IntParam] = [] - - /// Collection of all parameter names and values of type float - var floatParams: [Mavsdk_Rpc_ParamServer_FloatParam] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// Result type. -struct Mavsdk_Rpc_ParamServer_ParamServerResult { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Result enum value - var result: Mavsdk_Rpc_ParamServer_ParamServerResult.Result = .unknown - - /// Human-readable English string describing the result - var resultStr: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Possible results returned for param requests. - enum Result: SwiftProtobuf.Enum { - typealias RawValue = Int - - /// Unknown result - case unknown // = 0 - - /// Request succeeded - case success // = 1 - - /// Not Found - case notFound // = 2 - - /// Wrong type - case wrongType // = 3 - - /// Parameter name too long (> 16) - case paramNameTooLong // = 4 - case UNRECOGNIZED(Int) - - init() { - self = .unknown - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .success - case 2: self = .notFound - case 3: self = .wrongType - case 4: self = .paramNameTooLong - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .success: return 1 - case .notFound: return 2 - case .wrongType: return 3 - case .paramNameTooLong: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - } - - init() {} -} - -#if swift(>=4.2) - -extension Mavsdk_Rpc_ParamServer_ParamServerResult.Result: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Mavsdk_Rpc_ParamServer_ParamServerResult.Result] = [ - .unknown, - .success, - .notFound, - .wrongType, - .paramNameTooLong, - ] -} - -#endif // swift(>=4.2) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "mavsdk.rpc.param_server" - -extension Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveParamIntRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveParamIntResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "param_result"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._paramResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamIntResponse) -> Bool { - if lhs._paramResult != rhs._paramResult {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ProvideParamIntRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvideParamIntRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest, rhs: Mavsdk_Rpc_ParamServer_ProvideParamIntRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ProvideParamIntResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvideParamIntResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "param_result"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._paramResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamIntResponse, rhs: Mavsdk_Rpc_ParamServer_ProvideParamIntResponse) -> Bool { - if lhs._paramResult != rhs._paramResult {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveParamFloatRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveParamFloatResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "param_result"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._paramResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveParamFloatResponse) -> Bool { - if lhs._paramResult != rhs._paramResult {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvideParamFloatRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest, rhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvideParamFloatResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "param_result"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._paramResult) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._paramResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse, rhs: Mavsdk_Rpc_ParamServer_ProvideParamFloatResponse) -> Bool { - if lhs._paramResult != rhs._paramResult {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveAllParamsRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest, rhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RetrieveAllParamsResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "params"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._params) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._params { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse, rhs: Mavsdk_Rpc_ParamServer_RetrieveAllParamsResponse) -> Bool { - if lhs._params != rhs._params {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_IntParam: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".IntParam" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_IntParam, rhs: Mavsdk_Rpc_ParamServer_IntParam) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_FloatParam: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".FloatParam" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if self.value != 0 { - try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_FloatParam, rhs: Mavsdk_Rpc_ParamServer_FloatParam) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_AllParams: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".AllParams" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "int_params"), - 2: .standard(proto: "float_params"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.intParams) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.floatParams) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.intParams.isEmpty { - try visitor.visitRepeatedMessageField(value: self.intParams, fieldNumber: 1) - } - if !self.floatParams.isEmpty { - try visitor.visitRepeatedMessageField(value: self.floatParams, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_AllParams, rhs: Mavsdk_Rpc_ParamServer_AllParams) -> Bool { - if lhs.intParams != rhs.intParams {return false} - if lhs.floatParams != rhs.floatParams {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ParamServerResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ParamServerResult" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .standard(proto: "result_str"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.resultStr) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.result != .unknown { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.resultStr.isEmpty { - try visitor.visitSingularStringField(value: self.resultStr, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_ParamServer_ParamServerResult, rhs: Mavsdk_Rpc_ParamServer_ParamServerResult) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.resultStr != rhs.resultStr {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_ParamServer_ParamServerResult.Result: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "RESULT_UNKNOWN"), - 1: .same(proto: "RESULT_SUCCESS"), - 2: .same(proto: "RESULT_NOT_FOUND"), - 3: .same(proto: "RESULT_WRONG_TYPE"), - 4: .same(proto: "RESULT_PARAM_NAME_TOO_LONG"), - ] -} diff --git a/Sources/Mavsdk/Generated/tracking_server.grpc.swift b/Sources/Mavsdk/Generated/tracking_server.grpc.swift deleted file mode 100644 index f498156..0000000 --- a/Sources/Mavsdk/Generated/tracking_server.grpc.swift +++ /dev/null @@ -1,481 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: tracking_server.proto -// - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -import GRPC -import NIO -import SwiftProtobuf - - -/// API for an onboard image tracking software. -/// -/// Usage: instantiate `Mavsdk_Rpc_TrackingServer_TrackingServerServiceClient`, then call methods of this protocol to make API calls. -internal protocol Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientInterceptorFactoryProtocol? { get } - - func setTrackingPointStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func setTrackingRectangleStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func setTrackingOffStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func subscribeTrackingPointCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest, - callOptions: CallOptions?, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse) -> Void - ) -> ServerStreamingCall - - func subscribeTrackingRectangleCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest, - callOptions: CallOptions?, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse) -> Void - ) -> ServerStreamingCall - - func subscribeTrackingOffCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest, - callOptions: CallOptions?, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse) -> Void - ) -> ServerStreamingCall - - func respondTrackingPointCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func respondTrackingRectangleCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func respondTrackingOffCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientProtocol { - internal var serviceName: String { - return "mavsdk.rpc.tracking_server.TrackingServerService" - } - - /// Set/update the current point tracking status. - /// - /// - Parameters: - /// - request: Request to send to SetTrackingPointStatus. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func setTrackingPointStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SetTrackingPointStatus", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSetTrackingPointStatusInterceptors() ?? [] - ) - } - - /// Set/update the current rectangle tracking status. - /// - /// - Parameters: - /// - request: Request to send to SetTrackingRectangleStatus. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func setTrackingRectangleStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SetTrackingRectangleStatus", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSetTrackingRectangleStatusInterceptors() ?? [] - ) - } - - /// Set the current tracking status to off. - /// - /// - Parameters: - /// - request: Request to send to SetTrackingOffStatus. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func setTrackingOffStatus( - _ request: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SetTrackingOffStatus", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSetTrackingOffStatusInterceptors() ?? [] - ) - } - - /// Subscribe to incoming tracking point command. - /// - /// - Parameters: - /// - request: Request to send to SubscribeTrackingPointCommand. - /// - callOptions: Call options. - /// - handler: A closure called when each response is received from the server. - /// - Returns: A `ServerStreamingCall` with futures for the metadata and status. - internal func subscribeTrackingPointCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest, - callOptions: CallOptions? = nil, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse) -> Void - ) -> ServerStreamingCall { - return self.makeServerStreamingCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SubscribeTrackingPointCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSubscribeTrackingPointCommandInterceptors() ?? [], - handler: handler - ) - } - - /// Subscribe to incoming tracking rectangle command. - /// - /// - Parameters: - /// - request: Request to send to SubscribeTrackingRectangleCommand. - /// - callOptions: Call options. - /// - handler: A closure called when each response is received from the server. - /// - Returns: A `ServerStreamingCall` with futures for the metadata and status. - internal func subscribeTrackingRectangleCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest, - callOptions: CallOptions? = nil, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse) -> Void - ) -> ServerStreamingCall { - return self.makeServerStreamingCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SubscribeTrackingRectangleCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSubscribeTrackingRectangleCommandInterceptors() ?? [], - handler: handler - ) - } - - /// Subscribe to incoming tracking off command. - /// - /// - Parameters: - /// - request: Request to send to SubscribeTrackingOffCommand. - /// - callOptions: Call options. - /// - handler: A closure called when each response is received from the server. - /// - Returns: A `ServerStreamingCall` with futures for the metadata and status. - internal func subscribeTrackingOffCommand( - _ request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest, - callOptions: CallOptions? = nil, - handler: @escaping (Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse) -> Void - ) -> ServerStreamingCall { - return self.makeServerStreamingCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/SubscribeTrackingOffCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeSubscribeTrackingOffCommandInterceptors() ?? [], - handler: handler - ) - } - - /// Respond to an incoming tracking point command. - /// - /// - Parameters: - /// - request: Request to send to RespondTrackingPointCommand. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func respondTrackingPointCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/RespondTrackingPointCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRespondTrackingPointCommandInterceptors() ?? [] - ) - } - - /// Respond to an incoming tracking rectangle command. - /// - /// - Parameters: - /// - request: Request to send to RespondTrackingRectangleCommand. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func respondTrackingRectangleCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/RespondTrackingRectangleCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRespondTrackingRectangleCommandInterceptors() ?? [] - ) - } - - /// Respond to an incoming tracking off command. - /// - /// - Parameters: - /// - request: Request to send to RespondTrackingOffCommand. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func respondTrackingOffCommand( - _ request: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: "/mavsdk.rpc.tracking_server.TrackingServerService/RespondTrackingOffCommand", - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeRespondTrackingOffCommandInterceptors() ?? [] - ) - } -} - -internal protocol Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientInterceptorFactoryProtocol { - - /// - Returns: Interceptors to use when invoking 'setTrackingPointStatus'. - func makeSetTrackingPointStatusInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'setTrackingRectangleStatus'. - func makeSetTrackingRectangleStatusInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'setTrackingOffStatus'. - func makeSetTrackingOffStatusInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'subscribeTrackingPointCommand'. - func makeSubscribeTrackingPointCommandInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'subscribeTrackingRectangleCommand'. - func makeSubscribeTrackingRectangleCommandInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'subscribeTrackingOffCommand'. - func makeSubscribeTrackingOffCommandInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'respondTrackingPointCommand'. - func makeRespondTrackingPointCommandInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'respondTrackingRectangleCommand'. - func makeRespondTrackingRectangleCommandInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'respondTrackingOffCommand'. - func makeRespondTrackingOffCommandInterceptors() -> [ClientInterceptor] -} - -internal final class Mavsdk_Rpc_TrackingServer_TrackingServerServiceClient: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientProtocol { - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the mavsdk.rpc.tracking_server.TrackingServerService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Mavsdk_Rpc_TrackingServer_TrackingServerServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -/// API for an onboard image tracking software. -/// -/// To build a server, implement a class that conforms to this protocol. -internal protocol Mavsdk_Rpc_TrackingServer_TrackingServerServiceProvider: CallHandlerProvider { - var interceptors: Mavsdk_Rpc_TrackingServer_TrackingServerServiceServerInterceptorFactoryProtocol? { get } - - /// Set/update the current point tracking status. - func setTrackingPointStatus(request: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Set/update the current rectangle tracking status. - func setTrackingRectangleStatus(request: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Set the current tracking status to off. - func setTrackingOffStatus(request: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Subscribe to incoming tracking point command. - func subscribeTrackingPointCommand(request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest, context: StreamingResponseCallContext) -> EventLoopFuture - - /// Subscribe to incoming tracking rectangle command. - func subscribeTrackingRectangleCommand(request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest, context: StreamingResponseCallContext) -> EventLoopFuture - - /// Subscribe to incoming tracking off command. - func subscribeTrackingOffCommand(request: Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest, context: StreamingResponseCallContext) -> EventLoopFuture - - /// Respond to an incoming tracking point command. - func respondTrackingPointCommand(request: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Respond to an incoming tracking rectangle command. - func respondTrackingRectangleCommand(request: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Respond to an incoming tracking off command. - func respondTrackingOffCommand(request: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Mavsdk_Rpc_TrackingServer_TrackingServerServiceProvider { - internal var serviceName: Substring { return "mavsdk.rpc.tracking_server.TrackingServerService" } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "SetTrackingPointStatus": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSetTrackingPointStatusInterceptors() ?? [], - userFunction: self.setTrackingPointStatus(request:context:) - ) - - case "SetTrackingRectangleStatus": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSetTrackingRectangleStatusInterceptors() ?? [], - userFunction: self.setTrackingRectangleStatus(request:context:) - ) - - case "SetTrackingOffStatus": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSetTrackingOffStatusInterceptors() ?? [], - userFunction: self.setTrackingOffStatus(request:context:) - ) - - case "SubscribeTrackingPointCommand": - return ServerStreamingServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSubscribeTrackingPointCommandInterceptors() ?? [], - userFunction: self.subscribeTrackingPointCommand(request:context:) - ) - - case "SubscribeTrackingRectangleCommand": - return ServerStreamingServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSubscribeTrackingRectangleCommandInterceptors() ?? [], - userFunction: self.subscribeTrackingRectangleCommand(request:context:) - ) - - case "SubscribeTrackingOffCommand": - return ServerStreamingServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeSubscribeTrackingOffCommandInterceptors() ?? [], - userFunction: self.subscribeTrackingOffCommand(request:context:) - ) - - case "RespondTrackingPointCommand": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRespondTrackingPointCommandInterceptors() ?? [], - userFunction: self.respondTrackingPointCommand(request:context:) - ) - - case "RespondTrackingRectangleCommand": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRespondTrackingRectangleCommandInterceptors() ?? [], - userFunction: self.respondTrackingRectangleCommand(request:context:) - ) - - case "RespondTrackingOffCommand": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeRespondTrackingOffCommandInterceptors() ?? [], - userFunction: self.respondTrackingOffCommand(request:context:) - ) - - default: - return nil - } - } -} - -internal protocol Mavsdk_Rpc_TrackingServer_TrackingServerServiceServerInterceptorFactoryProtocol { - - /// - Returns: Interceptors to use when handling 'setTrackingPointStatus'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSetTrackingPointStatusInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'setTrackingRectangleStatus'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSetTrackingRectangleStatusInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'setTrackingOffStatus'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSetTrackingOffStatusInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'subscribeTrackingPointCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSubscribeTrackingPointCommandInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'subscribeTrackingRectangleCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSubscribeTrackingRectangleCommandInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'subscribeTrackingOffCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeSubscribeTrackingOffCommandInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'respondTrackingPointCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRespondTrackingPointCommandInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'respondTrackingRectangleCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRespondTrackingRectangleCommandInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'respondTrackingOffCommand'. - /// Defaults to calling `self.makeInterceptors()`. - func makeRespondTrackingOffCommandInterceptors() -> [ServerInterceptor] -} diff --git a/Sources/Mavsdk/Generated/tracking_server.pb.swift b/Sources/Mavsdk/Generated/tracking_server.pb.swift deleted file mode 100644 index a5157ca..0000000 --- a/Sources/Mavsdk/Generated/tracking_server.pb.swift +++ /dev/null @@ -1,1117 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: tracking_server.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Answer to respond to an incoming command -enum Mavsdk_Rpc_TrackingServer_CommandAnswer: SwiftProtobuf.Enum { - typealias RawValue = Int - - /// Command accepted - case accepted // = 0 - - /// Command temporarily rejected - case temporarilyRejected // = 1 - - /// Command denied - case denied // = 2 - - /// Command unsupported - case unsupported // = 3 - - /// Command failed - case failed // = 4 - case UNRECOGNIZED(Int) - - init() { - self = .accepted - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .accepted - case 1: self = .temporarilyRejected - case 2: self = .denied - case 3: self = .unsupported - case 4: self = .failed - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .accepted: return 0 - case .temporarilyRejected: return 1 - case .denied: return 2 - case .unsupported: return 3 - case .failed: return 4 - case .UNRECOGNIZED(let i): return i - } - } - -} - -#if swift(>=4.2) - -extension Mavsdk_Rpc_TrackingServer_CommandAnswer: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Mavsdk_Rpc_TrackingServer_CommandAnswer] = [ - .accepted, - .temporarilyRejected, - .denied, - .unsupported, - .failed, - ] -} - -#endif // swift(>=4.2) - -struct Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The tracked point - var trackedPoint: Mavsdk_Rpc_TrackingServer_TrackPoint { - get {return _trackedPoint ?? Mavsdk_Rpc_TrackingServer_TrackPoint()} - set {_trackedPoint = newValue} - } - /// Returns true if `trackedPoint` has been explicitly set. - var hasTrackedPoint: Bool {return self._trackedPoint != nil} - /// Clears the value of `trackedPoint`. Subsequent reads from it will return its default value. - mutating func clearTrackedPoint() {self._trackedPoint = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackedPoint: Mavsdk_Rpc_TrackingServer_TrackPoint? = nil -} - -struct Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The tracked rectangle - var trackedRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle { - get {return _trackedRectangle ?? Mavsdk_Rpc_TrackingServer_TrackRectangle()} - set {_trackedRectangle = newValue} - } - /// Returns true if `trackedRectangle` has been explicitly set. - var hasTrackedRectangle: Bool {return self._trackedRectangle != nil} - /// Clears the value of `trackedRectangle`. Subsequent reads from it will return its default value. - mutating func clearTrackedRectangle() {self._trackedRectangle = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackedRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle? = nil -} - -struct Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The point to track if a point is to be tracked - var trackPoint: Mavsdk_Rpc_TrackingServer_TrackPoint { - get {return _trackPoint ?? Mavsdk_Rpc_TrackingServer_TrackPoint()} - set {_trackPoint = newValue} - } - /// Returns true if `trackPoint` has been explicitly set. - var hasTrackPoint: Bool {return self._trackPoint != nil} - /// Clears the value of `trackPoint`. Subsequent reads from it will return its default value. - mutating func clearTrackPoint() {self._trackPoint = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackPoint: Mavsdk_Rpc_TrackingServer_TrackPoint? = nil -} - -struct Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The point to track if a point is to be tracked - var trackRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle { - get {return _trackRectangle ?? Mavsdk_Rpc_TrackingServer_TrackRectangle()} - set {_trackRectangle = newValue} - } - /// Returns true if `trackRectangle` has been explicitly set. - var hasTrackRectangle: Bool {return self._trackRectangle != nil} - /// Clears the value of `trackRectangle`. Subsequent reads from it will return its default value. - mutating func clearTrackRectangle() {self._trackRectangle = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackRectangle: Mavsdk_Rpc_TrackingServer_TrackRectangle? = nil -} - -struct Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Unused - var dummy: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ack to answer to the incoming command - var commandAnswer: Mavsdk_Rpc_TrackingServer_CommandAnswer = .accepted - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The result of sending the response. - var trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult { - get {return _trackingServerResult ?? Mavsdk_Rpc_TrackingServer_TrackingServerResult()} - set {_trackingServerResult = newValue} - } - /// Returns true if `trackingServerResult` has been explicitly set. - var hasTrackingServerResult: Bool {return self._trackingServerResult != nil} - /// Clears the value of `trackingServerResult`. Subsequent reads from it will return its default value. - mutating func clearTrackingServerResult() {self._trackingServerResult = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult? = nil -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ack to answer to the incoming command - var commandAnswer: Mavsdk_Rpc_TrackingServer_CommandAnswer = .accepted - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The result of sending the response. - var trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult { - get {return _trackingServerResult ?? Mavsdk_Rpc_TrackingServer_TrackingServerResult()} - set {_trackingServerResult = newValue} - } - /// Returns true if `trackingServerResult` has been explicitly set. - var hasTrackingServerResult: Bool {return self._trackingServerResult != nil} - /// Clears the value of `trackingServerResult`. Subsequent reads from it will return its default value. - mutating func clearTrackingServerResult() {self._trackingServerResult = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult? = nil -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ack to answer to the incoming command - var commandAnswer: Mavsdk_Rpc_TrackingServer_CommandAnswer = .accepted - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The result of sending the response. - var trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult { - get {return _trackingServerResult ?? Mavsdk_Rpc_TrackingServer_TrackingServerResult()} - set {_trackingServerResult = newValue} - } - /// Returns true if `trackingServerResult` has been explicitly set. - var hasTrackingServerResult: Bool {return self._trackingServerResult != nil} - /// Clears the value of `trackingServerResult`. Subsequent reads from it will return its default value. - mutating func clearTrackingServerResult() {self._trackingServerResult = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _trackingServerResult: Mavsdk_Rpc_TrackingServer_TrackingServerResult? = nil -} - -/// Point description type -struct Mavsdk_Rpc_TrackingServer_TrackPoint { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Point to track x value (normalized 0..1, 0 is left, 1 is right). - var pointX: Float = 0 - - /// Point to track y value (normalized 0..1, 0 is top, 1 is bottom). - var pointY: Float = 0 - - /// Point to track y value (normalized 0..1, 0 is top, 1 is bottom). - var radius: Float = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// Rectangle description type -struct Mavsdk_Rpc_TrackingServer_TrackRectangle { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Top left corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). - var topLeftCornerX: Float = 0 - - /// Top left corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). - var topLeftCornerY: Float = 0 - - /// Bottom right corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). - var bottomRightCornerX: Float = 0 - - /// Bottom right corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). - var bottomRightCornerY: Float = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// Result type -struct Mavsdk_Rpc_TrackingServer_TrackingServerResult { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Result enum value - var result: Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result = .unknown - - /// Human-readable English string describing the result - var resultStr: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Possible results returned for tracking_server requests. - enum Result: SwiftProtobuf.Enum { - typealias RawValue = Int - - /// Unknown result - case unknown // = 0 - - /// Request succeeded - case success // = 1 - - /// No system is connected - case noSystem // = 2 - - /// Connection error - case connectionError // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .unknown - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .success - case 2: self = .noSystem - case 3: self = .connectionError - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .success: return 1 - case .noSystem: return 2 - case .connectionError: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - } - - init() {} -} - -#if swift(>=4.2) - -extension Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result] = [ - .unknown, - .success, - .noSystem, - .connectionError, - ] -} - -#endif // swift(>=4.2) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "mavsdk.rpc.tracking_server" - -extension Mavsdk_Rpc_TrackingServer_CommandAnswer: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "COMMAND_ANSWER_ACCEPTED"), - 1: .same(proto: "COMMAND_ANSWER_TEMPORARILY_REJECTED"), - 2: .same(proto: "COMMAND_ANSWER_DENIED"), - 3: .same(proto: "COMMAND_ANSWER_UNSUPPORTED"), - 4: .same(proto: "COMMAND_ANSWER_FAILED"), - ] -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingPointStatusRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tracked_point"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackedPoint) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackedPoint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusRequest) -> Bool { - if lhs._trackedPoint != rhs._trackedPoint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingPointStatusResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusResponse, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingPointStatusResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingRectangleStatusRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tracked_rectangle"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackedRectangle) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackedRectangle { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusRequest) -> Bool { - if lhs._trackedRectangle != rhs._trackedRectangle {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingRectangleStatusResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusResponse, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingRectangleStatusResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingOffStatusRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SetTrackingOffStatusResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusResponse, rhs: Mavsdk_Rpc_TrackingServer_SetTrackingOffStatusResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SubscribeTrackingPointCommandRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingPointCommandRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackingPointCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "track_point"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackPoint) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackPoint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_TrackingPointCommandResponse) -> Bool { - if lhs._trackPoint != rhs._trackPoint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SubscribeTrackingRectangleCommandRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingRectangleCommandRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackingRectangleCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "track_rectangle"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackRectangle) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackRectangle { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_TrackingRectangleCommandResponse) -> Bool { - if lhs._trackRectangle != rhs._trackRectangle {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SubscribeTrackingOffCommandRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_SubscribeTrackingOffCommandRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackingOffCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "dummy"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.dummy) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.dummy != 0 { - try visitor.visitSingularInt32Field(value: self.dummy, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_TrackingOffCommandResponse) -> Bool { - if lhs.dummy != rhs.dummy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingPointCommandRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "command_answer"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.commandAnswer) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.commandAnswer != .accepted { - try visitor.visitSingularEnumField(value: self.commandAnswer, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandRequest) -> Bool { - if lhs.commandAnswer != rhs.commandAnswer {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingPointCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tracking_server_result"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackingServerResult) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackingServerResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingPointCommandResponse) -> Bool { - if lhs._trackingServerResult != rhs._trackingServerResult {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingRectangleCommandRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "command_answer"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.commandAnswer) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.commandAnswer != .accepted { - try visitor.visitSingularEnumField(value: self.commandAnswer, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandRequest) -> Bool { - if lhs.commandAnswer != rhs.commandAnswer {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingRectangleCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tracking_server_result"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackingServerResult) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackingServerResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingRectangleCommandResponse) -> Bool { - if lhs._trackingServerResult != rhs._trackingServerResult {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingOffCommandRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "command_answer"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.commandAnswer) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.commandAnswer != .accepted { - try visitor.visitSingularEnumField(value: self.commandAnswer, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandRequest) -> Bool { - if lhs.commandAnswer != rhs.commandAnswer {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".RespondTrackingOffCommandResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tracking_server_result"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._trackingServerResult) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._trackingServerResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandResponse, rhs: Mavsdk_Rpc_TrackingServer_RespondTrackingOffCommandResponse) -> Bool { - if lhs._trackingServerResult != rhs._trackingServerResult {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackPoint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackPoint" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "point_x"), - 2: .standard(proto: "point_y"), - 3: .same(proto: "radius"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularFloatField(value: &self.pointX) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.pointY) }() - case 3: try { try decoder.decodeSingularFloatField(value: &self.radius) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.pointX != 0 { - try visitor.visitSingularFloatField(value: self.pointX, fieldNumber: 1) - } - if self.pointY != 0 { - try visitor.visitSingularFloatField(value: self.pointY, fieldNumber: 2) - } - if self.radius != 0 { - try visitor.visitSingularFloatField(value: self.radius, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackPoint, rhs: Mavsdk_Rpc_TrackingServer_TrackPoint) -> Bool { - if lhs.pointX != rhs.pointX {return false} - if lhs.pointY != rhs.pointY {return false} - if lhs.radius != rhs.radius {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackRectangle: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackRectangle" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "top_left_corner_x"), - 2: .standard(proto: "top_left_corner_y"), - 3: .standard(proto: "bottom_right_corner_x"), - 4: .standard(proto: "bottom_right_corner_y"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularFloatField(value: &self.topLeftCornerX) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.topLeftCornerY) }() - case 3: try { try decoder.decodeSingularFloatField(value: &self.bottomRightCornerX) }() - case 4: try { try decoder.decodeSingularFloatField(value: &self.bottomRightCornerY) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.topLeftCornerX != 0 { - try visitor.visitSingularFloatField(value: self.topLeftCornerX, fieldNumber: 1) - } - if self.topLeftCornerY != 0 { - try visitor.visitSingularFloatField(value: self.topLeftCornerY, fieldNumber: 2) - } - if self.bottomRightCornerX != 0 { - try visitor.visitSingularFloatField(value: self.bottomRightCornerX, fieldNumber: 3) - } - if self.bottomRightCornerY != 0 { - try visitor.visitSingularFloatField(value: self.bottomRightCornerY, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackRectangle, rhs: Mavsdk_Rpc_TrackingServer_TrackRectangle) -> Bool { - if lhs.topLeftCornerX != rhs.topLeftCornerX {return false} - if lhs.topLeftCornerY != rhs.topLeftCornerY {return false} - if lhs.bottomRightCornerX != rhs.bottomRightCornerX {return false} - if lhs.bottomRightCornerY != rhs.bottomRightCornerY {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackingServerResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TrackingServerResult" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .standard(proto: "result_str"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.resultStr) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.result != .unknown { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.resultStr.isEmpty { - try visitor.visitSingularStringField(value: self.resultStr, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Mavsdk_Rpc_TrackingServer_TrackingServerResult, rhs: Mavsdk_Rpc_TrackingServer_TrackingServerResult) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.resultStr != rhs.resultStr {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Mavsdk_Rpc_TrackingServer_TrackingServerResult.Result: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "RESULT_UNKNOWN"), - 1: .same(proto: "RESULT_SUCCESS"), - 2: .same(proto: "RESULT_NO_SYSTEM"), - 3: .same(proto: "RESULT_CONNECTION_ERROR"), - ] -} diff --git a/Sources/Mavsdk/tools/generate_from_protos.bash b/Sources/Mavsdk/tools/generate_from_protos.bash index 857b1e1..08b0989 100755 --- a/Sources/Mavsdk/tools/generate_from_protos.bash +++ b/Sources/Mavsdk/tools/generate_from_protos.bash @@ -57,6 +57,13 @@ PROTOC_GEN_SWIFT=${TMP_DIR}/grpc-swift/.build/release/protoc-gen-swift PROTOC_GEN_GRPC_SWIFT=${TMP_DIR}/grpc-swift/.build/release/protoc-gen-grpc-swift for plugin in ${PLUGIN_LIST}; do + if [ "$plugin" = "tracking_server" ]; then + continue + fi + + if [ "$plugin" = "param_server" ]; then + continue + fi protoc ${plugin}.proto -I${PROTO_DIR} -I${PROTO_DIR}/${plugin} --swift_out=${OUTPUT_DIR} --swiftgrpc_out=${OUTPUT_DIR} --plugin=protoc-gen-swift=${PROTOC_GEN_SWIFT} --plugin=protoc-gen-swiftgrpc=${PROTOC_GEN_GRPC_SWIFT} done @@ -69,5 +76,12 @@ echo "" export TEMPLATE_PATH=${TEMPLATE_PATH:-"${SCRIPT_DIR}/../templates"} for plugin in ${PLUGIN_LIST}; do + if [ "$plugin" = "tracking_server" ]; then + continue + fi + + if [ "$plugin" = "param_server" ]; then + continue + fi protoc ${plugin}.proto --plugin=protoc-gen-custom=$(which protoc-gen-mavsdk) -I${PROTO_DIR} -I${PROTO_DIR}/${plugin} --custom_out=${OUTPUT_DIR} --custom_opt=file_ext=swift done From e919db5d0d63f325989f21f83425c185ed210174 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 22 Jul 2021 18:58:17 +0200 Subject: [PATCH 3/3] workflows: protobuf troubles --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20b02f3..fb642f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: with: submodules: recursive - name: install tools - run: pip3 install protoc-gen-mavsdk && brew install protobuf + run: pip3 install protoc-gen-mavsdk && brew install protobuf || brew link --overwrite protobuf - name: generate from protos run: bash Sources/Mavsdk/tools/generate_from_protos.bash - name: check for diff