mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
1009 lines
39 KiB
Swift
1009 lines
39 KiB
Swift
// DO NOT EDIT.
|
|
// swift-format-ignore-file
|
|
//
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
// Source: meshtastic/deviceonly.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
|
|
}
|
|
|
|
///
|
|
/// Font sizes for the device screen
|
|
public enum ScreenFonts: SwiftProtobuf.Enum {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case fontSmall // = 0
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case fontMedium // = 1
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case fontLarge // = 2
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .fontSmall
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .fontSmall
|
|
case 1: self = .fontMedium
|
|
case 2: self = .fontLarge
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .fontSmall: return 0
|
|
case .fontMedium: return 1
|
|
case .fontLarge: return 2
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#if swift(>=4.2)
|
|
|
|
extension ScreenFonts: CaseIterable {
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [ScreenFonts] = [
|
|
.fontSmall,
|
|
.fontMedium,
|
|
.fontLarge,
|
|
]
|
|
}
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
///
|
|
/// Position with static location information only for NodeDBLite
|
|
public struct PositionLite {
|
|
// 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 new preferred location encoding, multiply by 1e-7 to get degrees
|
|
/// in floating point
|
|
public var latitudeI: Int32 = 0
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var longitudeI: Int32 = 0
|
|
|
|
///
|
|
/// In meters above MSL (but see issue #359)
|
|
public var altitude: Int32 = 0
|
|
|
|
///
|
|
/// This is usually not sent over the mesh (to save space), but it is sent
|
|
/// from the phone so that the local device can set its RTC If it is sent over
|
|
/// the mesh (because there are devices on the mesh without GPS), it will only
|
|
/// be sent by devices which has a hardware GPS clock.
|
|
/// seconds since 1970
|
|
public var time: UInt32 = 0
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var locationSource: Position.LocSource = .locUnset
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public struct UserLite {
|
|
// 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.
|
|
|
|
///
|
|
/// This is the addr of the radio.
|
|
public var macaddr: Data = Data()
|
|
|
|
///
|
|
/// A full name for this user, i.e. "Kevin Hester"
|
|
public var longName: String = String()
|
|
|
|
///
|
|
/// A VERY short name, ideally two characters.
|
|
/// Suitable for a tiny OLED screen
|
|
public var shortName: String = String()
|
|
|
|
///
|
|
/// TBEAM, HELTEC, etc...
|
|
/// Starting in 1.2.11 moved to hw_model enum in the NodeInfo object.
|
|
/// Apps will still need the string here for older builds
|
|
/// (so OTA update can find the right image), but if the enum is available it will be used instead.
|
|
public var hwModel: HardwareModel = .unset
|
|
|
|
///
|
|
/// In some regions Ham radio operators have different bandwidth limitations than others.
|
|
/// If this user is a licensed operator, set this flag.
|
|
/// Also, "long_name" should be their licence number.
|
|
public var isLicensed: Bool = false
|
|
|
|
///
|
|
/// Indicates that the user's role in the mesh
|
|
public var role: Config.DeviceConfig.Role = .client
|
|
|
|
///
|
|
/// The public key of the user's device.
|
|
/// This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
|
|
public var publicKey: Data = Data()
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public struct NodeInfoLite {
|
|
// 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 node number
|
|
public var num: UInt32 {
|
|
get {return _storage._num}
|
|
set {_uniqueStorage()._num = newValue}
|
|
}
|
|
|
|
///
|
|
/// The user info for this node
|
|
public var user: UserLite {
|
|
get {return _storage._user ?? UserLite()}
|
|
set {_uniqueStorage()._user = newValue}
|
|
}
|
|
/// Returns true if `user` has been explicitly set.
|
|
public var hasUser: Bool {return _storage._user != nil}
|
|
/// Clears the value of `user`. Subsequent reads from it will return its default value.
|
|
public mutating func clearUser() {_uniqueStorage()._user = nil}
|
|
|
|
///
|
|
/// This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true.
|
|
/// Position.time now indicates the last time we received a POSITION from that node.
|
|
public var position: PositionLite {
|
|
get {return _storage._position ?? PositionLite()}
|
|
set {_uniqueStorage()._position = newValue}
|
|
}
|
|
/// Returns true if `position` has been explicitly set.
|
|
public var hasPosition: Bool {return _storage._position != nil}
|
|
/// Clears the value of `position`. Subsequent reads from it will return its default value.
|
|
public mutating func clearPosition() {_uniqueStorage()._position = nil}
|
|
|
|
///
|
|
/// Returns the Signal-to-noise ratio (SNR) of the last received message,
|
|
/// as measured by the receiver. Return SNR of the last received message in dB
|
|
public var snr: Float {
|
|
get {return _storage._snr}
|
|
set {_uniqueStorage()._snr = newValue}
|
|
}
|
|
|
|
///
|
|
/// Set to indicate the last time we received a packet from this node
|
|
public var lastHeard: UInt32 {
|
|
get {return _storage._lastHeard}
|
|
set {_uniqueStorage()._lastHeard = newValue}
|
|
}
|
|
|
|
///
|
|
/// The latest device metrics for the node.
|
|
public var deviceMetrics: DeviceMetrics {
|
|
get {return _storage._deviceMetrics ?? DeviceMetrics()}
|
|
set {_uniqueStorage()._deviceMetrics = newValue}
|
|
}
|
|
/// Returns true if `deviceMetrics` has been explicitly set.
|
|
public var hasDeviceMetrics: Bool {return _storage._deviceMetrics != nil}
|
|
/// Clears the value of `deviceMetrics`. Subsequent reads from it will return its default value.
|
|
public mutating func clearDeviceMetrics() {_uniqueStorage()._deviceMetrics = nil}
|
|
|
|
///
|
|
/// local channel index we heard that node on. Only populated if its not the default channel.
|
|
public var channel: UInt32 {
|
|
get {return _storage._channel}
|
|
set {_uniqueStorage()._channel = newValue}
|
|
}
|
|
|
|
///
|
|
/// True if we witnessed the node over MQTT instead of LoRA transport
|
|
public var viaMqtt: Bool {
|
|
get {return _storage._viaMqtt}
|
|
set {_uniqueStorage()._viaMqtt = newValue}
|
|
}
|
|
|
|
///
|
|
/// Number of hops away from us this node is (0 if adjacent)
|
|
public var hopsAway: UInt32 {
|
|
get {return _storage._hopsAway}
|
|
set {_uniqueStorage()._hopsAway = newValue}
|
|
}
|
|
|
|
///
|
|
/// True if node is in our favorites list
|
|
/// Persists between NodeDB internal clean ups
|
|
public var isFavorite: Bool {
|
|
get {return _storage._isFavorite}
|
|
set {_uniqueStorage()._isFavorite = newValue}
|
|
}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
|
|
fileprivate var _storage = _StorageClass.defaultInstance
|
|
}
|
|
|
|
///
|
|
/// This message is never sent over the wire, but it is used for serializing DB
|
|
/// state to flash in the device code
|
|
/// FIXME, since we write this each time we enter deep sleep (and have infinite
|
|
/// flash) it would be better to use some sort of append only data structure for
|
|
/// the receive queue and use the preferences store for the other stuff
|
|
public struct DeviceState {
|
|
// 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.
|
|
|
|
///
|
|
/// Read only settings/info about this node
|
|
public var myNode: MyNodeInfo {
|
|
get {return _storage._myNode ?? MyNodeInfo()}
|
|
set {_uniqueStorage()._myNode = newValue}
|
|
}
|
|
/// Returns true if `myNode` has been explicitly set.
|
|
public var hasMyNode: Bool {return _storage._myNode != nil}
|
|
/// Clears the value of `myNode`. Subsequent reads from it will return its default value.
|
|
public mutating func clearMyNode() {_uniqueStorage()._myNode = nil}
|
|
|
|
///
|
|
/// My owner info
|
|
public var owner: User {
|
|
get {return _storage._owner ?? User()}
|
|
set {_uniqueStorage()._owner = newValue}
|
|
}
|
|
/// Returns true if `owner` has been explicitly set.
|
|
public var hasOwner: Bool {return _storage._owner != nil}
|
|
/// Clears the value of `owner`. Subsequent reads from it will return its default value.
|
|
public mutating func clearOwner() {_uniqueStorage()._owner = nil}
|
|
|
|
///
|
|
/// Received packets saved for delivery to the phone
|
|
public var receiveQueue: [MeshPacket] {
|
|
get {return _storage._receiveQueue}
|
|
set {_uniqueStorage()._receiveQueue = newValue}
|
|
}
|
|
|
|
///
|
|
/// A version integer used to invalidate old save files when we make
|
|
/// incompatible changes This integer is set at build time and is private to
|
|
/// NodeDB.cpp in the device code.
|
|
public var version: UInt32 {
|
|
get {return _storage._version}
|
|
set {_uniqueStorage()._version = newValue}
|
|
}
|
|
|
|
///
|
|
/// We keep the last received text message (only) stored in the device flash,
|
|
/// so we can show it on the screen.
|
|
/// Might be null
|
|
public var rxTextMessage: MeshPacket {
|
|
get {return _storage._rxTextMessage ?? MeshPacket()}
|
|
set {_uniqueStorage()._rxTextMessage = newValue}
|
|
}
|
|
/// Returns true if `rxTextMessage` has been explicitly set.
|
|
public var hasRxTextMessage: Bool {return _storage._rxTextMessage != nil}
|
|
/// Clears the value of `rxTextMessage`. Subsequent reads from it will return its default value.
|
|
public mutating func clearRxTextMessage() {_uniqueStorage()._rxTextMessage = nil}
|
|
|
|
///
|
|
/// Used only during development.
|
|
/// Indicates developer is testing and changes should never be saved to flash.
|
|
/// Deprecated in 2.3.1
|
|
public var noSave: Bool {
|
|
get {return _storage._noSave}
|
|
set {_uniqueStorage()._noSave = newValue}
|
|
}
|
|
|
|
///
|
|
/// Some GPS receivers seem to have bogus settings from the factory, so we always do one factory reset.
|
|
public var didGpsReset: Bool {
|
|
get {return _storage._didGpsReset}
|
|
set {_uniqueStorage()._didGpsReset = newValue}
|
|
}
|
|
|
|
///
|
|
/// We keep the last received waypoint stored in the device flash,
|
|
/// so we can show it on the screen.
|
|
/// Might be null
|
|
public var rxWaypoint: MeshPacket {
|
|
get {return _storage._rxWaypoint ?? MeshPacket()}
|
|
set {_uniqueStorage()._rxWaypoint = newValue}
|
|
}
|
|
/// Returns true if `rxWaypoint` has been explicitly set.
|
|
public var hasRxWaypoint: Bool {return _storage._rxWaypoint != nil}
|
|
/// Clears the value of `rxWaypoint`. Subsequent reads from it will return its default value.
|
|
public mutating func clearRxWaypoint() {_uniqueStorage()._rxWaypoint = nil}
|
|
|
|
///
|
|
/// The mesh's nodes with their available gpio pins for RemoteHardware module
|
|
public var nodeRemoteHardwarePins: [NodeRemoteHardwarePin] {
|
|
get {return _storage._nodeRemoteHardwarePins}
|
|
set {_uniqueStorage()._nodeRemoteHardwarePins = newValue}
|
|
}
|
|
|
|
///
|
|
/// New lite version of NodeDB to decrease memory footprint
|
|
public var nodeDbLite: [NodeInfoLite] {
|
|
get {return _storage._nodeDbLite}
|
|
set {_uniqueStorage()._nodeDbLite = newValue}
|
|
}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
|
|
fileprivate var _storage = _StorageClass.defaultInstance
|
|
}
|
|
|
|
///
|
|
/// The on-disk saved channels
|
|
public struct ChannelFile {
|
|
// 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 channels our node knows about
|
|
public var channels: [Channel] = []
|
|
|
|
///
|
|
/// A version integer used to invalidate old save files when we make
|
|
/// incompatible changes This integer is set at build time and is private to
|
|
/// NodeDB.cpp in the device code.
|
|
public var version: UInt32 = 0
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
///
|
|
/// This can be used for customizing the firmware distribution. If populated,
|
|
/// show a secondary bootup screen with custom logo and text for 2.5 seconds.
|
|
public struct OEMStore {
|
|
// 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 Logo width in Px
|
|
public var oemIconWidth: UInt32 = 0
|
|
|
|
///
|
|
/// The Logo height in Px
|
|
public var oemIconHeight: UInt32 = 0
|
|
|
|
///
|
|
/// The Logo in XBM bytechar format
|
|
public var oemIconBits: Data = Data()
|
|
|
|
///
|
|
/// Use this font for the OEM text.
|
|
public var oemFont: ScreenFonts = .fontSmall
|
|
|
|
///
|
|
/// Use this font for the OEM text.
|
|
public var oemText: String = String()
|
|
|
|
///
|
|
/// The default device encryption key, 16 or 32 byte
|
|
public var oemAesKey: Data = Data()
|
|
|
|
///
|
|
/// A Preset LocalConfig to apply during factory reset
|
|
public var oemLocalConfig: LocalConfig {
|
|
get {return _oemLocalConfig ?? LocalConfig()}
|
|
set {_oemLocalConfig = newValue}
|
|
}
|
|
/// Returns true if `oemLocalConfig` has been explicitly set.
|
|
public var hasOemLocalConfig: Bool {return self._oemLocalConfig != nil}
|
|
/// Clears the value of `oemLocalConfig`. Subsequent reads from it will return its default value.
|
|
public mutating func clearOemLocalConfig() {self._oemLocalConfig = nil}
|
|
|
|
///
|
|
/// A Preset LocalModuleConfig to apply during factory reset
|
|
public var oemLocalModuleConfig: LocalModuleConfig {
|
|
get {return _oemLocalModuleConfig ?? LocalModuleConfig()}
|
|
set {_oemLocalModuleConfig = newValue}
|
|
}
|
|
/// Returns true if `oemLocalModuleConfig` has been explicitly set.
|
|
public var hasOemLocalModuleConfig: Bool {return self._oemLocalModuleConfig != nil}
|
|
/// Clears the value of `oemLocalModuleConfig`. Subsequent reads from it will return its default value.
|
|
public mutating func clearOemLocalModuleConfig() {self._oemLocalModuleConfig = nil}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
|
|
fileprivate var _oemLocalConfig: LocalConfig? = nil
|
|
fileprivate var _oemLocalModuleConfig: LocalModuleConfig? = nil
|
|
}
|
|
|
|
#if swift(>=5.5) && canImport(_Concurrency)
|
|
extension ScreenFonts: @unchecked Sendable {}
|
|
extension PositionLite: @unchecked Sendable {}
|
|
extension UserLite: @unchecked Sendable {}
|
|
extension NodeInfoLite: @unchecked Sendable {}
|
|
extension DeviceState: @unchecked Sendable {}
|
|
extension ChannelFile: @unchecked Sendable {}
|
|
extension OEMStore: @unchecked Sendable {}
|
|
#endif // swift(>=5.5) && canImport(_Concurrency)
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
fileprivate let _protobuf_package = "meshtastic"
|
|
|
|
extension ScreenFonts: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
0: .same(proto: "FONT_SMALL"),
|
|
1: .same(proto: "FONT_MEDIUM"),
|
|
2: .same(proto: "FONT_LARGE"),
|
|
]
|
|
}
|
|
|
|
extension PositionLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".PositionLite"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .standard(proto: "latitude_i"),
|
|
2: .standard(proto: "longitude_i"),
|
|
3: .same(proto: "altitude"),
|
|
4: .same(proto: "time"),
|
|
5: .standard(proto: "location_source"),
|
|
]
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeSingularSFixed32Field(value: &self.latitudeI) }()
|
|
case 2: try { try decoder.decodeSingularSFixed32Field(value: &self.longitudeI) }()
|
|
case 3: try { try decoder.decodeSingularInt32Field(value: &self.altitude) }()
|
|
case 4: try { try decoder.decodeSingularFixed32Field(value: &self.time) }()
|
|
case 5: try { try decoder.decodeSingularEnumField(value: &self.locationSource) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.latitudeI != 0 {
|
|
try visitor.visitSingularSFixed32Field(value: self.latitudeI, fieldNumber: 1)
|
|
}
|
|
if self.longitudeI != 0 {
|
|
try visitor.visitSingularSFixed32Field(value: self.longitudeI, fieldNumber: 2)
|
|
}
|
|
if self.altitude != 0 {
|
|
try visitor.visitSingularInt32Field(value: self.altitude, fieldNumber: 3)
|
|
}
|
|
if self.time != 0 {
|
|
try visitor.visitSingularFixed32Field(value: self.time, fieldNumber: 4)
|
|
}
|
|
if self.locationSource != .locUnset {
|
|
try visitor.visitSingularEnumField(value: self.locationSource, fieldNumber: 5)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: PositionLite, rhs: PositionLite) -> Bool {
|
|
if lhs.latitudeI != rhs.latitudeI {return false}
|
|
if lhs.longitudeI != rhs.longitudeI {return false}
|
|
if lhs.altitude != rhs.altitude {return false}
|
|
if lhs.time != rhs.time {return false}
|
|
if lhs.locationSource != rhs.locationSource {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension UserLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".UserLite"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "macaddr"),
|
|
2: .standard(proto: "long_name"),
|
|
3: .standard(proto: "short_name"),
|
|
4: .standard(proto: "hw_model"),
|
|
5: .standard(proto: "is_licensed"),
|
|
6: .same(proto: "role"),
|
|
7: .standard(proto: "public_key"),
|
|
]
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeSingularBytesField(value: &self.macaddr) }()
|
|
case 2: try { try decoder.decodeSingularStringField(value: &self.longName) }()
|
|
case 3: try { try decoder.decodeSingularStringField(value: &self.shortName) }()
|
|
case 4: try { try decoder.decodeSingularEnumField(value: &self.hwModel) }()
|
|
case 5: try { try decoder.decodeSingularBoolField(value: &self.isLicensed) }()
|
|
case 6: try { try decoder.decodeSingularEnumField(value: &self.role) }()
|
|
case 7: try { try decoder.decodeSingularBytesField(value: &self.publicKey) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.macaddr.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.macaddr, fieldNumber: 1)
|
|
}
|
|
if !self.longName.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.longName, fieldNumber: 2)
|
|
}
|
|
if !self.shortName.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.shortName, fieldNumber: 3)
|
|
}
|
|
if self.hwModel != .unset {
|
|
try visitor.visitSingularEnumField(value: self.hwModel, fieldNumber: 4)
|
|
}
|
|
if self.isLicensed != false {
|
|
try visitor.visitSingularBoolField(value: self.isLicensed, fieldNumber: 5)
|
|
}
|
|
if self.role != .client {
|
|
try visitor.visitSingularEnumField(value: self.role, fieldNumber: 6)
|
|
}
|
|
if !self.publicKey.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.publicKey, fieldNumber: 7)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: UserLite, rhs: UserLite) -> Bool {
|
|
if lhs.macaddr != rhs.macaddr {return false}
|
|
if lhs.longName != rhs.longName {return false}
|
|
if lhs.shortName != rhs.shortName {return false}
|
|
if lhs.hwModel != rhs.hwModel {return false}
|
|
if lhs.isLicensed != rhs.isLicensed {return false}
|
|
if lhs.role != rhs.role {return false}
|
|
if lhs.publicKey != rhs.publicKey {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension NodeInfoLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".NodeInfoLite"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "num"),
|
|
2: .same(proto: "user"),
|
|
3: .same(proto: "position"),
|
|
4: .same(proto: "snr"),
|
|
5: .standard(proto: "last_heard"),
|
|
6: .standard(proto: "device_metrics"),
|
|
7: .same(proto: "channel"),
|
|
8: .standard(proto: "via_mqtt"),
|
|
9: .standard(proto: "hops_away"),
|
|
10: .standard(proto: "is_favorite"),
|
|
]
|
|
|
|
fileprivate class _StorageClass {
|
|
var _num: UInt32 = 0
|
|
var _user: UserLite? = nil
|
|
var _position: PositionLite? = nil
|
|
var _snr: Float = 0
|
|
var _lastHeard: UInt32 = 0
|
|
var _deviceMetrics: DeviceMetrics? = nil
|
|
var _channel: UInt32 = 0
|
|
var _viaMqtt: Bool = false
|
|
var _hopsAway: UInt32 = 0
|
|
var _isFavorite: Bool = false
|
|
|
|
#if swift(>=5.10)
|
|
// This property is used as the initial default value for new instances of the type.
|
|
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
#else
|
|
static let defaultInstance = _StorageClass()
|
|
#endif
|
|
|
|
private init() {}
|
|
|
|
init(copying source: _StorageClass) {
|
|
_num = source._num
|
|
_user = source._user
|
|
_position = source._position
|
|
_snr = source._snr
|
|
_lastHeard = source._lastHeard
|
|
_deviceMetrics = source._deviceMetrics
|
|
_channel = source._channel
|
|
_viaMqtt = source._viaMqtt
|
|
_hopsAway = source._hopsAway
|
|
_isFavorite = source._isFavorite
|
|
}
|
|
}
|
|
|
|
fileprivate mutating func _uniqueStorage() -> _StorageClass {
|
|
if !isKnownUniquelyReferenced(&_storage) {
|
|
_storage = _StorageClass(copying: _storage)
|
|
}
|
|
return _storage
|
|
}
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeSingularUInt32Field(value: &_storage._num) }()
|
|
case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }()
|
|
case 3: try { try decoder.decodeSingularMessageField(value: &_storage._position) }()
|
|
case 4: try { try decoder.decodeSingularFloatField(value: &_storage._snr) }()
|
|
case 5: try { try decoder.decodeSingularFixed32Field(value: &_storage._lastHeard) }()
|
|
case 6: try { try decoder.decodeSingularMessageField(value: &_storage._deviceMetrics) }()
|
|
case 7: try { try decoder.decodeSingularUInt32Field(value: &_storage._channel) }()
|
|
case 8: try { try decoder.decodeSingularBoolField(value: &_storage._viaMqtt) }()
|
|
case 9: try { try decoder.decodeSingularUInt32Field(value: &_storage._hopsAway) }()
|
|
case 10: try { try decoder.decodeSingularBoolField(value: &_storage._isFavorite) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
if _storage._num != 0 {
|
|
try visitor.visitSingularUInt32Field(value: _storage._num, fieldNumber: 1)
|
|
}
|
|
try { if let v = _storage._user {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
|
} }()
|
|
try { if let v = _storage._position {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
|
} }()
|
|
if _storage._snr != 0 {
|
|
try visitor.visitSingularFloatField(value: _storage._snr, fieldNumber: 4)
|
|
}
|
|
if _storage._lastHeard != 0 {
|
|
try visitor.visitSingularFixed32Field(value: _storage._lastHeard, fieldNumber: 5)
|
|
}
|
|
try { if let v = _storage._deviceMetrics {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
|
|
} }()
|
|
if _storage._channel != 0 {
|
|
try visitor.visitSingularUInt32Field(value: _storage._channel, fieldNumber: 7)
|
|
}
|
|
if _storage._viaMqtt != false {
|
|
try visitor.visitSingularBoolField(value: _storage._viaMqtt, fieldNumber: 8)
|
|
}
|
|
if _storage._hopsAway != 0 {
|
|
try visitor.visitSingularUInt32Field(value: _storage._hopsAway, fieldNumber: 9)
|
|
}
|
|
if _storage._isFavorite != false {
|
|
try visitor.visitSingularBoolField(value: _storage._isFavorite, fieldNumber: 10)
|
|
}
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: NodeInfoLite, rhs: NodeInfoLite) -> 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._num != rhs_storage._num {return false}
|
|
if _storage._user != rhs_storage._user {return false}
|
|
if _storage._position != rhs_storage._position {return false}
|
|
if _storage._snr != rhs_storage._snr {return false}
|
|
if _storage._lastHeard != rhs_storage._lastHeard {return false}
|
|
if _storage._deviceMetrics != rhs_storage._deviceMetrics {return false}
|
|
if _storage._channel != rhs_storage._channel {return false}
|
|
if _storage._viaMqtt != rhs_storage._viaMqtt {return false}
|
|
if _storage._hopsAway != rhs_storage._hopsAway {return false}
|
|
if _storage._isFavorite != rhs_storage._isFavorite {return false}
|
|
return true
|
|
}
|
|
if !storagesAreEqual {return false}
|
|
}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".DeviceState"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
2: .standard(proto: "my_node"),
|
|
3: .same(proto: "owner"),
|
|
5: .standard(proto: "receive_queue"),
|
|
8: .same(proto: "version"),
|
|
7: .standard(proto: "rx_text_message"),
|
|
9: .standard(proto: "no_save"),
|
|
11: .standard(proto: "did_gps_reset"),
|
|
12: .standard(proto: "rx_waypoint"),
|
|
13: .standard(proto: "node_remote_hardware_pins"),
|
|
14: .standard(proto: "node_db_lite"),
|
|
]
|
|
|
|
fileprivate class _StorageClass {
|
|
var _myNode: MyNodeInfo? = nil
|
|
var _owner: User? = nil
|
|
var _receiveQueue: [MeshPacket] = []
|
|
var _version: UInt32 = 0
|
|
var _rxTextMessage: MeshPacket? = nil
|
|
var _noSave: Bool = false
|
|
var _didGpsReset: Bool = false
|
|
var _rxWaypoint: MeshPacket? = nil
|
|
var _nodeRemoteHardwarePins: [NodeRemoteHardwarePin] = []
|
|
var _nodeDbLite: [NodeInfoLite] = []
|
|
|
|
#if swift(>=5.10)
|
|
// This property is used as the initial default value for new instances of the type.
|
|
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
#else
|
|
static let defaultInstance = _StorageClass()
|
|
#endif
|
|
|
|
private init() {}
|
|
|
|
init(copying source: _StorageClass) {
|
|
_myNode = source._myNode
|
|
_owner = source._owner
|
|
_receiveQueue = source._receiveQueue
|
|
_version = source._version
|
|
_rxTextMessage = source._rxTextMessage
|
|
_noSave = source._noSave
|
|
_didGpsReset = source._didGpsReset
|
|
_rxWaypoint = source._rxWaypoint
|
|
_nodeRemoteHardwarePins = source._nodeRemoteHardwarePins
|
|
_nodeDbLite = source._nodeDbLite
|
|
}
|
|
}
|
|
|
|
fileprivate mutating func _uniqueStorage() -> _StorageClass {
|
|
if !isKnownUniquelyReferenced(&_storage) {
|
|
_storage = _StorageClass(copying: _storage)
|
|
}
|
|
return _storage
|
|
}
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 2: try { try decoder.decodeSingularMessageField(value: &_storage._myNode) }()
|
|
case 3: try { try decoder.decodeSingularMessageField(value: &_storage._owner) }()
|
|
case 5: try { try decoder.decodeRepeatedMessageField(value: &_storage._receiveQueue) }()
|
|
case 7: try { try decoder.decodeSingularMessageField(value: &_storage._rxTextMessage) }()
|
|
case 8: try { try decoder.decodeSingularUInt32Field(value: &_storage._version) }()
|
|
case 9: try { try decoder.decodeSingularBoolField(value: &_storage._noSave) }()
|
|
case 11: try { try decoder.decodeSingularBoolField(value: &_storage._didGpsReset) }()
|
|
case 12: try { try decoder.decodeSingularMessageField(value: &_storage._rxWaypoint) }()
|
|
case 13: try { try decoder.decodeRepeatedMessageField(value: &_storage._nodeRemoteHardwarePins) }()
|
|
case 14: try { try decoder.decodeRepeatedMessageField(value: &_storage._nodeDbLite) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
try { if let v = _storage._myNode {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
|
} }()
|
|
try { if let v = _storage._owner {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
|
} }()
|
|
if !_storage._receiveQueue.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: _storage._receiveQueue, fieldNumber: 5)
|
|
}
|
|
try { if let v = _storage._rxTextMessage {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
|
|
} }()
|
|
if _storage._version != 0 {
|
|
try visitor.visitSingularUInt32Field(value: _storage._version, fieldNumber: 8)
|
|
}
|
|
if _storage._noSave != false {
|
|
try visitor.visitSingularBoolField(value: _storage._noSave, fieldNumber: 9)
|
|
}
|
|
if _storage._didGpsReset != false {
|
|
try visitor.visitSingularBoolField(value: _storage._didGpsReset, fieldNumber: 11)
|
|
}
|
|
try { if let v = _storage._rxWaypoint {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 12)
|
|
} }()
|
|
if !_storage._nodeRemoteHardwarePins.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: _storage._nodeRemoteHardwarePins, fieldNumber: 13)
|
|
}
|
|
if !_storage._nodeDbLite.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: _storage._nodeDbLite, fieldNumber: 14)
|
|
}
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: DeviceState, rhs: DeviceState) -> 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._myNode != rhs_storage._myNode {return false}
|
|
if _storage._owner != rhs_storage._owner {return false}
|
|
if _storage._receiveQueue != rhs_storage._receiveQueue {return false}
|
|
if _storage._version != rhs_storage._version {return false}
|
|
if _storage._rxTextMessage != rhs_storage._rxTextMessage {return false}
|
|
if _storage._noSave != rhs_storage._noSave {return false}
|
|
if _storage._didGpsReset != rhs_storage._didGpsReset {return false}
|
|
if _storage._rxWaypoint != rhs_storage._rxWaypoint {return false}
|
|
if _storage._nodeRemoteHardwarePins != rhs_storage._nodeRemoteHardwarePins {return false}
|
|
if _storage._nodeDbLite != rhs_storage._nodeDbLite {return false}
|
|
return true
|
|
}
|
|
if !storagesAreEqual {return false}
|
|
}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension ChannelFile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".ChannelFile"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "channels"),
|
|
2: .same(proto: "version"),
|
|
]
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.channels) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.version) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.channels.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: self.channels, fieldNumber: 1)
|
|
}
|
|
if self.version != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.version, fieldNumber: 2)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: ChannelFile, rhs: ChannelFile) -> Bool {
|
|
if lhs.channels != rhs.channels {return false}
|
|
if lhs.version != rhs.version {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension OEMStore: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".OEMStore"
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .standard(proto: "oem_icon_width"),
|
|
2: .standard(proto: "oem_icon_height"),
|
|
3: .standard(proto: "oem_icon_bits"),
|
|
4: .standard(proto: "oem_font"),
|
|
5: .standard(proto: "oem_text"),
|
|
6: .standard(proto: "oem_aes_key"),
|
|
7: .standard(proto: "oem_local_config"),
|
|
8: .standard(proto: "oem_local_module_config"),
|
|
]
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.oemIconWidth) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.oemIconHeight) }()
|
|
case 3: try { try decoder.decodeSingularBytesField(value: &self.oemIconBits) }()
|
|
case 4: try { try decoder.decodeSingularEnumField(value: &self.oemFont) }()
|
|
case 5: try { try decoder.decodeSingularStringField(value: &self.oemText) }()
|
|
case 6: try { try decoder.decodeSingularBytesField(value: &self.oemAesKey) }()
|
|
case 7: try { try decoder.decodeSingularMessageField(value: &self._oemLocalConfig) }()
|
|
case 8: try { try decoder.decodeSingularMessageField(value: &self._oemLocalModuleConfig) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
if self.oemIconWidth != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.oemIconWidth, fieldNumber: 1)
|
|
}
|
|
if self.oemIconHeight != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.oemIconHeight, fieldNumber: 2)
|
|
}
|
|
if !self.oemIconBits.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.oemIconBits, fieldNumber: 3)
|
|
}
|
|
if self.oemFont != .fontSmall {
|
|
try visitor.visitSingularEnumField(value: self.oemFont, fieldNumber: 4)
|
|
}
|
|
if !self.oemText.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.oemText, fieldNumber: 5)
|
|
}
|
|
if !self.oemAesKey.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.oemAesKey, fieldNumber: 6)
|
|
}
|
|
try { if let v = self._oemLocalConfig {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
|
|
} }()
|
|
try { if let v = self._oemLocalModuleConfig {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
|
|
} }()
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: OEMStore, rhs: OEMStore) -> Bool {
|
|
if lhs.oemIconWidth != rhs.oemIconWidth {return false}
|
|
if lhs.oemIconHeight != rhs.oemIconHeight {return false}
|
|
if lhs.oemIconBits != rhs.oemIconBits {return false}
|
|
if lhs.oemFont != rhs.oemFont {return false}
|
|
if lhs.oemText != rhs.oemText {return false}
|
|
if lhs.oemAesKey != rhs.oemAesKey {return false}
|
|
if lhs._oemLocalConfig != rhs._oemLocalConfig {return false}
|
|
if lhs._oemLocalModuleConfig != rhs._oemLocalModuleConfig {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|