From 27bd0e6b2947595c29dbde60f146f47cfa04916d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 11 Feb 2025 14:03:40 -0600 Subject: [PATCH] Update protos --- .../Sources/meshtastic/config.pb.swift | 11 +++++ .../Sources/meshtastic/mesh.pb.swift | 9 ++++ .../Sources/meshtastic/module_config.pb.swift | 2 +- .../Sources/meshtastic/telemetry.pb.swift | 46 +++++++++++++++++++ protobufs | 2 +- 5 files changed, 68 insertions(+), 2 deletions(-) diff --git a/MeshtasticProtobufs/Sources/meshtastic/config.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/config.pb.swift index 566b3ef1..da370cbc 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/config.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/config.pb.swift @@ -925,6 +925,11 @@ public struct Config: Sendable { /// Indicates how to rotate or invert the compass output to accurate display on the display. public var compassOrientation: Config.DisplayConfig.CompassOrientation = .degrees0 + /// + /// If false (default), the device will display the time in 24-hour format on screen. + /// If true, the device will display the time in 12-hour format on screen. + public var use12HClock: Bool = false + public var unknownFields = SwiftProtobuf.UnknownStorage() /// @@ -2523,6 +2528,7 @@ extension Config.DisplayConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImp 9: .standard(proto: "heading_bold"), 10: .standard(proto: "wake_on_tap_or_motion"), 11: .standard(proto: "compass_orientation"), + 12: .standard(proto: "use_12h_clock"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -2542,6 +2548,7 @@ extension Config.DisplayConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImp case 9: try { try decoder.decodeSingularBoolField(value: &self.headingBold) }() case 10: try { try decoder.decodeSingularBoolField(value: &self.wakeOnTapOrMotion) }() case 11: try { try decoder.decodeSingularEnumField(value: &self.compassOrientation) }() + case 12: try { try decoder.decodeSingularBoolField(value: &self.use12HClock) }() default: break } } @@ -2581,6 +2588,9 @@ extension Config.DisplayConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImp if self.compassOrientation != .degrees0 { try visitor.visitSingularEnumField(value: self.compassOrientation, fieldNumber: 11) } + if self.use12HClock != false { + try visitor.visitSingularBoolField(value: self.use12HClock, fieldNumber: 12) + } try unknownFields.traverse(visitor: &visitor) } @@ -2596,6 +2606,7 @@ extension Config.DisplayConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImp if lhs.headingBold != rhs.headingBold {return false} if lhs.wakeOnTapOrMotion != rhs.wakeOnTapOrMotion {return false} if lhs.compassOrientation != rhs.compassOrientation {return false} + if lhs.use12HClock != rhs.use12HClock {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift index cf3cb4ee..ac1c527a 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift @@ -398,6 +398,11 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable { /// https://github.com/valzzu/Mesh-Tab case meshTab // = 86 + /// + /// MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog + /// https://www.loraitalia.it + case meshlink // = 87 + /// /// ------------------------------------------------------------------------------------------------------------------------------------------ /// Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. @@ -498,6 +503,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable { case 84: self = .wismeshTap case 85: self = .routastic case 86: self = .meshTab + case 87: self = .meshlink case 255: self = .privateHw default: self = .UNRECOGNIZED(rawValue) } @@ -592,6 +598,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable { case .wismeshTap: return 84 case .routastic: return 85 case .meshTab: return 86 + case .meshlink: return 87 case .privateHw: return 255 case .UNRECOGNIZED(let i): return i } @@ -686,6 +693,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable { .wismeshTap, .routastic, .meshTab, + .meshlink, .privateHw, ] @@ -3316,6 +3324,7 @@ extension HardwareModel: SwiftProtobuf._ProtoNameProviding { 84: .same(proto: "WISMESH_TAP"), 85: .same(proto: "ROUTASTIC"), 86: .same(proto: "MESH_TAB"), + 87: .same(proto: "MESHLINK"), 255: .same(proto: "PRIVATE_HW"), ] } diff --git a/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift index 2cb3291b..0138ccff 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift @@ -1058,7 +1058,7 @@ public struct ModuleConfig: Sendable { } /// - /// TODO: REPLACE + /// Canned Messages Module Config public struct CannedMessageConfig: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for diff --git a/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift index 737ebf95..d8a3d143 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift @@ -164,6 +164,10 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { /// /// High accuracy current and voltage case ina226 // = 34 + + /// + /// DFRobot Gravity tipping bucket rain gauge + case dfrobotRain // = 35 case UNRECOGNIZED(Int) public init() { @@ -207,6 +211,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { case 32: self = .scd4X case 33: self = .radsens case 34: self = .ina226 + case 35: self = .dfrobotRain default: self = .UNRECOGNIZED(rawValue) } } @@ -248,6 +253,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { case .scd4X: return 32 case .radsens: return 33 case .ina226: return 34 + case .dfrobotRain: return 35 case .UNRECOGNIZED(let i): return i } } @@ -289,6 +295,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { .scd4X, .radsens, .ina226, + .dfrobotRain, ] } @@ -573,6 +580,28 @@ public struct EnvironmentMetrics: @unchecked Sendable { /// Clears the value of `radiation`. Subsequent reads from it will return its default value. public mutating func clearRadiation() {_uniqueStorage()._radiation = nil} + /// + /// Rainfall in the last hour in mm + public var rainfall1H: Float { + get {return _storage._rainfall1H ?? 0} + set {_uniqueStorage()._rainfall1H = newValue} + } + /// Returns true if `rainfall1H` has been explicitly set. + public var hasRainfall1H: Bool {return _storage._rainfall1H != nil} + /// Clears the value of `rainfall1H`. Subsequent reads from it will return its default value. + public mutating func clearRainfall1H() {_uniqueStorage()._rainfall1H = nil} + + /// + /// Rainfall in the last 24 hours in mm + public var rainfall24H: Float { + get {return _storage._rainfall24H ?? 0} + set {_uniqueStorage()._rainfall24H = newValue} + } + /// Returns true if `rainfall24H` has been explicitly set. + public var hasRainfall24H: Bool {return _storage._rainfall24H != nil} + /// Clears the value of `rainfall24H`. Subsequent reads from it will return its default value. + public mutating func clearRainfall24H() {_uniqueStorage()._rainfall24H = nil} + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} @@ -1102,6 +1131,7 @@ extension TelemetrySensorType: SwiftProtobuf._ProtoNameProviding { 32: .same(proto: "SCD4X"), 33: .same(proto: "RADSENS"), 34: .same(proto: "INA226"), + 35: .same(proto: "DFROBOT_RAIN"), ] } @@ -1186,6 +1216,8 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple 16: .standard(proto: "wind_gust"), 17: .standard(proto: "wind_lull"), 18: .same(proto: "radiation"), + 19: .standard(proto: "rainfall_1h"), + 20: .standard(proto: "rainfall_24h"), ] fileprivate class _StorageClass { @@ -1207,6 +1239,8 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple var _windGust: Float? = nil var _windLull: Float? = nil var _radiation: Float? = nil + var _rainfall1H: Float? = nil + var _rainfall24H: Float? = nil #if swift(>=5.10) // This property is used as the initial default value for new instances of the type. @@ -1239,6 +1273,8 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple _windGust = source._windGust _windLull = source._windLull _radiation = source._radiation + _rainfall1H = source._rainfall1H + _rainfall24H = source._rainfall24H } } @@ -1275,6 +1311,8 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple case 16: try { try decoder.decodeSingularFloatField(value: &_storage._windGust) }() case 17: try { try decoder.decodeSingularFloatField(value: &_storage._windLull) }() case 18: try { try decoder.decodeSingularFloatField(value: &_storage._radiation) }() + case 19: try { try decoder.decodeSingularFloatField(value: &_storage._rainfall1H) }() + case 20: try { try decoder.decodeSingularFloatField(value: &_storage._rainfall24H) }() default: break } } @@ -1341,6 +1379,12 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple try { if let v = _storage._radiation { try visitor.visitSingularFloatField(value: v, fieldNumber: 18) } }() + try { if let v = _storage._rainfall1H { + try visitor.visitSingularFloatField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._rainfall24H { + try visitor.visitSingularFloatField(value: v, fieldNumber: 20) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -1368,6 +1412,8 @@ extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImple if _storage._windGust != rhs_storage._windGust {return false} if _storage._windLull != rhs_storage._windLull {return false} if _storage._radiation != rhs_storage._radiation {return false} + if _storage._rainfall1H != rhs_storage._rainfall1H {return false} + if _storage._rainfall24H != rhs_storage._rainfall24H {return false} return true } if !storagesAreEqual {return false} diff --git a/protobufs b/protobufs index 76f806e1..06864665 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 76f806e1bb1e2a7b157a14fadd095775f63db5e4 +Subproject commit 068646653e8375fc145988026ad242a3cf70f7ab