diff --git a/MeshtasticProtobufs/Sources/meshtastic/deviceonly.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/deviceonly.pb.swift index 72248719..cbcbda13 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/deviceonly.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/deviceonly.pb.swift @@ -100,9 +100,22 @@ public struct UserLite: @unchecked Sendable { /// This is sent out to other nodes on the mesh to allow them to compute a shared secret key. public var publicKey: Data = Data() + /// + /// Whether or not the node can be messaged + public var isUnmessagable: Bool { + get {return _isUnmessagable ?? false} + set {_isUnmessagable = newValue} + } + /// Returns true if `isUnmessagable` has been explicitly set. + public var hasIsUnmessagable: Bool {return self._isUnmessagable != nil} + /// Clears the value of `isUnmessagable`. Subsequent reads from it will return its default value. + public mutating func clearIsUnmessagable() {self._isUnmessagable = nil} + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} + + fileprivate var _isUnmessagable: Bool? = nil } public struct NodeInfoLite: @unchecked Sendable { @@ -512,6 +525,7 @@ extension UserLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB 5: .standard(proto: "is_licensed"), 6: .same(proto: "role"), 7: .standard(proto: "public_key"), + 9: .standard(proto: "is_unmessagable"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -527,12 +541,17 @@ extension UserLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB 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) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self._isUnmessagable) }() default: break } } } public func traverse(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.macaddr.isEmpty { try visitor.visitSingularBytesField(value: self.macaddr, fieldNumber: 1) } @@ -554,6 +573,9 @@ extension UserLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB if !self.publicKey.isEmpty { try visitor.visitSingularBytesField(value: self.publicKey, fieldNumber: 7) } + try { if let v = self._isUnmessagable { + try visitor.visitSingularBoolField(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -565,6 +587,7 @@ extension UserLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB if lhs.isLicensed != rhs.isLicensed {return false} if lhs.role != rhs.role {return false} if lhs.publicKey != rhs.publicKey {return false} + if lhs._isUnmessagable != rhs._isUnmessagable {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 14948e13..d59ec2ed 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/mesh.pb.swift @@ -1503,9 +1503,22 @@ public struct User: @unchecked Sendable { /// This is sent out to other nodes on the mesh to allow them to compute a shared secret key. public var publicKey: Data = Data() + /// + /// Whether or not the node can be messaged + public var isUnmessagable: Bool { + get {return _isUnmessagable ?? false} + set {_isUnmessagable = newValue} + } + /// Returns true if `isUnmessagable` has been explicitly set. + public var hasIsUnmessagable: Bool {return self._isUnmessagable != nil} + /// Clears the value of `isUnmessagable`. Subsequent reads from it will return its default value. + public mutating func clearIsUnmessagable() {self._isUnmessagable = nil} + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} + + fileprivate var _isUnmessagable: Bool? = nil } /// @@ -3751,6 +3764,7 @@ extension User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, 6: .standard(proto: "is_licensed"), 7: .same(proto: "role"), 8: .standard(proto: "public_key"), + 9: .standard(proto: "is_unmessagable"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -3767,12 +3781,17 @@ extension User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, case 6: try { try decoder.decodeSingularBoolField(value: &self.isLicensed) }() case 7: try { try decoder.decodeSingularEnumField(value: &self.role) }() case 8: try { try decoder.decodeSingularBytesField(value: &self.publicKey) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self._isUnmessagable) }() default: break } } } public func traverse(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.id.isEmpty { try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) } @@ -3797,6 +3816,9 @@ extension User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, if !self.publicKey.isEmpty { try visitor.visitSingularBytesField(value: self.publicKey, fieldNumber: 8) } + try { if let v = self._isUnmessagable { + try visitor.visitSingularBoolField(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -3809,6 +3831,7 @@ extension User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, if lhs.isLicensed != rhs.isLicensed {return false} if lhs.role != rhs.role {return false} if lhs.publicKey != rhs.publicKey {return false} + if lhs._isUnmessagable != rhs._isUnmessagable {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift index f717951d..c2e81366 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/module_config.pb.swift @@ -345,6 +345,10 @@ public struct ModuleConfig: Sendable { /// Bits of precision for the location sent (default of 32 is full precision). public var positionPrecision: UInt32 = 0 + /// + /// Whether we have opted-in to report our location to the map + public var shouldReportLocation: Bool = false + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} @@ -1647,6 +1651,7 @@ extension ModuleConfig.MapReportSettings: SwiftProtobuf.Message, SwiftProtobuf._ public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "publish_interval_secs"), 2: .standard(proto: "position_precision"), + 3: .standard(proto: "should_report_location"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -1657,6 +1662,7 @@ extension ModuleConfig.MapReportSettings: SwiftProtobuf.Message, SwiftProtobuf._ switch fieldNumber { case 1: try { try decoder.decodeSingularUInt32Field(value: &self.publishIntervalSecs) }() case 2: try { try decoder.decodeSingularUInt32Field(value: &self.positionPrecision) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.shouldReportLocation) }() default: break } } @@ -1669,12 +1675,16 @@ extension ModuleConfig.MapReportSettings: SwiftProtobuf.Message, SwiftProtobuf._ if self.positionPrecision != 0 { try visitor.visitSingularUInt32Field(value: self.positionPrecision, fieldNumber: 2) } + if self.shouldReportLocation != false { + try visitor.visitSingularBoolField(value: self.shouldReportLocation, fieldNumber: 3) + } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: ModuleConfig.MapReportSettings, rhs: ModuleConfig.MapReportSettings) -> Bool { if lhs.publishIntervalSecs != rhs.publishIntervalSecs {return false} if lhs.positionPrecision != rhs.positionPrecision {return false} + if lhs.shouldReportLocation != rhs.shouldReportLocation {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/MeshtasticProtobufs/Sources/meshtastic/mqtt.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/mqtt.pb.swift index 006fd9c8..80508b5d 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/mqtt.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/mqtt.pb.swift @@ -116,6 +116,11 @@ public struct MapReport: Sendable { /// Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT) public var numOnlineLocalNodes: UInt32 = 0 + /// + /// User has opted in to share their location (map report) with the mqtt server + /// Controlled by map_report.should_report_location + public var hasOptedReportLocation_p: Bool = false + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} @@ -189,6 +194,7 @@ extension MapReport: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementation 11: .same(proto: "altitude"), 12: .standard(proto: "position_precision"), 13: .standard(proto: "num_online_local_nodes"), + 14: .standard(proto: "has_opted_report_location"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -210,6 +216,7 @@ extension MapReport: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementation case 11: try { try decoder.decodeSingularInt32Field(value: &self.altitude) }() case 12: try { try decoder.decodeSingularUInt32Field(value: &self.positionPrecision) }() case 13: try { try decoder.decodeSingularUInt32Field(value: &self.numOnlineLocalNodes) }() + case 14: try { try decoder.decodeSingularBoolField(value: &self.hasOptedReportLocation_p) }() default: break } } @@ -255,6 +262,9 @@ extension MapReport: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementation if self.numOnlineLocalNodes != 0 { try visitor.visitSingularUInt32Field(value: self.numOnlineLocalNodes, fieldNumber: 13) } + if self.hasOptedReportLocation_p != false { + try visitor.visitSingularBoolField(value: self.hasOptedReportLocation_p, fieldNumber: 14) + } try unknownFields.traverse(visitor: &visitor) } @@ -272,6 +282,7 @@ extension MapReport: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementation if lhs.altitude != rhs.altitude {return false} if lhs.positionPrecision != rhs.positionPrecision {return false} if lhs.numOnlineLocalNodes != rhs.numOnlineLocalNodes {return false} + if lhs.hasOptedReportLocation_p != rhs.hasOptedReportLocation_p {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift b/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift index 90b56546..ccf4cfb4 100644 --- a/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift +++ b/MeshtasticProtobufs/Sources/meshtastic/telemetry.pb.swift @@ -176,6 +176,10 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { /// /// RAKWireless RAK12035 Soil Moisture Sensor Module case rak12035 // = 37 + + /// + /// MAX17261 lipo battery gauge + case max17261 // = 38 case UNRECOGNIZED(Int) public init() { @@ -222,6 +226,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { case 35: self = .dfrobotRain case 36: self = .dps310 case 37: self = .rak12035 + case 38: self = .max17261 default: self = .UNRECOGNIZED(rawValue) } } @@ -266,6 +271,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { case .dfrobotRain: return 35 case .dps310: return 36 case .rak12035: return 37 + case .max17261: return 38 case .UNRECOGNIZED(let i): return i } } @@ -310,6 +316,7 @@ public enum TelemetrySensorType: SwiftProtobuf.Enum, Swift.CaseIterable { .dfrobotRain, .dps310, .rak12035, + .max17261, ] } @@ -1170,6 +1177,7 @@ extension TelemetrySensorType: SwiftProtobuf._ProtoNameProviding { 35: .same(proto: "DFROBOT_RAIN"), 36: .same(proto: "DPS310"), 37: .same(proto: "RAK12035"), + 38: .same(proto: "MAX17261"), ] } diff --git a/protobufs b/protobufs index 816595c8..47ec99aa 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705 +Subproject commit 47ec99aa4c4a2e3fff71fd5170663f0848deb021