mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Update photos to 1.03
This commit is contained in:
parent
bc1992f8d3
commit
9524405fbf
16 changed files with 2283 additions and 1759 deletions
|
|
@ -43,8 +43,8 @@
|
|||
DDAF8C6526ED0A490058C060 /* channel.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6426ED0A490058C060 /* channel.pb.swift */; };
|
||||
DDAF8C6726ED0C8C0058C060 /* remote_hardware.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6626ED0C8C0058C060 /* remote_hardware.pb.swift */; };
|
||||
DDAF8C6926ED0D070058C060 /* deviceonly.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6826ED0D070058C060 /* deviceonly.pb.swift */; };
|
||||
DDAF8C6B26ED0DD80058C060 /* environmental_measurement.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6A26ED0DD80058C060 /* environmental_measurement.pb.swift */; };
|
||||
DDAF8C6E26ED19040058C060 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6D26ED19040058C060 /* Extensions.swift */; };
|
||||
DDB2CC6E27F3EB47009C5FCC /* telemetry.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB2CC6D27F3EB47009C5FCC /* telemetry.pb.swift */; };
|
||||
DDC2E15826CE248E0042C5E4 /* MeshtasticClientApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E15726CE248E0042C5E4 /* MeshtasticClientApp.swift */; };
|
||||
DDC2E15C26CE248F0042C5E4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E15B26CE248F0042C5E4 /* Assets.xcassets */; };
|
||||
DDC2E15F26CE248F0042C5E4 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E15E26CE248F0042C5E4 /* Preview Assets.xcassets */; };
|
||||
|
|
@ -110,8 +110,8 @@
|
|||
DDAF8C6426ED0A490058C060 /* channel.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = channel.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6626ED0C8C0058C060 /* remote_hardware.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = remote_hardware.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6826ED0D070058C060 /* deviceonly.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = deviceonly.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6A26ED0DD80058C060 /* environmental_measurement.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = environmental_measurement.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6D26ED19040058C060 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
|
||||
DDB2CC6D27F3EB47009C5FCC /* telemetry.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = telemetry.pb.swift; sourceTree = "<group>"; };
|
||||
DDC2E15426CE248E0042C5E4 /* MeshtasticClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MeshtasticClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DDC2E15726CE248E0042C5E4 /* MeshtasticClientApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticClientApp.swift; sourceTree = "<group>"; };
|
||||
DDC2E15B26CE248F0042C5E4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ../Assets.xcassets; sourceTree = "<group>"; };
|
||||
|
|
@ -213,12 +213,12 @@
|
|||
DDAF8C5626ED07740058C060 /* Protobufs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DDB2CC6D27F3EB47009C5FCC /* telemetry.pb.swift */,
|
||||
DD4DED8F27AD2975004BA27E /* cannedmessages.pb.swift */,
|
||||
DDAF8C6126ED0A230058C060 /* admin.pb.swift */,
|
||||
C9A88B56278B559900BD810A /* apponly.pb.swift */,
|
||||
DDAF8C6426ED0A490058C060 /* channel.pb.swift */,
|
||||
DDAF8C6826ED0D070058C060 /* deviceonly.pb.swift */,
|
||||
DDAF8C6A26ED0DD80058C060 /* environmental_measurement.pb.swift */,
|
||||
DDAF8C5726ED07FD0058C060 /* mesh.pb.swift */,
|
||||
DDAF8C6026ED0A230058C060 /* mqtt.pb.swift */,
|
||||
DDAF8C5C26ED09490058C060 /* portnums.pb.swift */,
|
||||
|
|
@ -538,7 +538,6 @@
|
|||
DD90860E26F69BAE00DC5189 /* NodeMap.swift in Sources */,
|
||||
DD8169FF272476C700F4AB02 /* LogDocument.swift in Sources */,
|
||||
DDAF8C6926ED0D070058C060 /* deviceonly.pb.swift in Sources */,
|
||||
DDAF8C6B26ED0DD80058C060 /* environmental_measurement.pb.swift in Sources */,
|
||||
DD90860C26F684AF00DC5189 /* BatteryIcon.swift in Sources */,
|
||||
DD4A911E2708C65400501B7E /* AppSettings.swift in Sources */,
|
||||
DDAF8C6226ED0A230058C060 /* mqtt.pb.swift in Sources */,
|
||||
|
|
@ -546,6 +545,7 @@
|
|||
DDAF8C5D26ED09490058C060 /* portnums.pb.swift in Sources */,
|
||||
DD9D8F2F2764403B00080993 /* Meshtastic.xcdatamodeld in Sources */,
|
||||
DD1BF2F92776FE2E008C8D2F /* UserMessageList.swift in Sources */,
|
||||
DDB2CC6E27F3EB47009C5FCC /* telemetry.pb.swift in Sources */,
|
||||
DD23A50F26FD1B4400D9B90C /* PeripheralModel.swift in Sources */,
|
||||
C9A7BC1027759A9600760B50 /* PositionAnnotationView.swift in Sources */,
|
||||
DD882F5D2772E4640005BF05 /* Contacts.swift in Sources */,
|
||||
|
|
|
|||
|
|
@ -547,7 +547,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
position.longitudeI = decodedInfo.nodeInfo.position.longitudeI
|
||||
position.altitude = decodedInfo.nodeInfo.position.altitude
|
||||
|
||||
position.batteryLevel = decodedInfo.nodeInfo.position.batteryLevel
|
||||
if decodedInfo.nodeInfo.position.time > 0 {
|
||||
|
||||
position.time = Date(timeIntervalSince1970: TimeInterval(Int64(decodedInfo.nodeInfo.position.time)))
|
||||
|
|
@ -614,7 +613,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
position.latitudeI = decodedInfo.nodeInfo.position.latitudeI
|
||||
position.longitudeI = decodedInfo.nodeInfo.position.longitudeI
|
||||
position.altitude = decodedInfo.nodeInfo.position.altitude
|
||||
position.batteryLevel = decodedInfo.nodeInfo.position.batteryLevel
|
||||
|
||||
if decodedInfo.nodeInfo.position.time > 0 {
|
||||
|
||||
position.time = Date(timeIntervalSince1970: TimeInterval(Int64(decodedInfo.nodeInfo.position.time)))
|
||||
|
|
@ -706,7 +705,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
newMessage.receivedACK = false
|
||||
newMessage.direction = "IN"
|
||||
newMessage.isTapback = decodedInfo.packet.decoded.isTapback
|
||||
newMessage.isTapback = decodedInfo.packet.decoded.emoji == 1
|
||||
|
||||
if decodedInfo.packet.decoded.replyID > 0 {
|
||||
|
||||
|
|
@ -843,7 +842,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
position.latitudeI = positionMessage.latitudeI
|
||||
position.longitudeI = positionMessage.longitudeI
|
||||
position.altitude = positionMessage.altitude
|
||||
position.batteryLevel = positionMessage.batteryLevel
|
||||
|
||||
if positionMessage.time == 0 {
|
||||
|
||||
|
|
@ -969,10 +967,10 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
}
|
||||
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.environmentalMeasurementApp {
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.telemetryApp {
|
||||
|
||||
if meshLoggingEnabled { MeshLogger.log("ℹ️ MESH PACKET received for Environmental Measurement App UNHANDLED \(try decodedInfo.packet.jsonString())") }
|
||||
print("ℹ️ MESH PACKET received for Environmental Measurement App UNHANDLED \(try decodedInfo.packet.jsonString())")
|
||||
if meshLoggingEnabled { MeshLogger.log("ℹ️ MESH PACKET received for Telemetry App UNHANDLED \(try decodedInfo.packet.jsonString())") }
|
||||
print("ℹ️ MESH PACKET received for Telemetry App UNHANDLED \(try decodedInfo.packet.jsonString())")
|
||||
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.storeForwardApp {
|
||||
|
||||
|
|
@ -1095,7 +1093,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
meshPacket.to = UInt32(toUserNum)
|
||||
meshPacket.from = UInt32(fromUserNum)
|
||||
meshPacket.decoded = dataMessage
|
||||
meshPacket.decoded.isTapback = isTapback
|
||||
meshPacket.decoded.emoji = isTapback ? 1 : 0
|
||||
if replyID > 0 {
|
||||
meshPacket.decoded.replyID = UInt32(replyID)
|
||||
}
|
||||
|
|
@ -1162,8 +1160,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
positionPacket.longitudeI = Int32(LocationHelper.currentLocation.longitude * 1e7)
|
||||
positionPacket.time = UInt32(Date().timeIntervalSince1970)
|
||||
positionPacket.altitude = Int32(LocationHelper.currentAltitude)
|
||||
let mostRecentPosition = fetchedNode[0].positions?.lastObject as! PositionEntity
|
||||
positionPacket.batteryLevel = mostRecentPosition.batteryLevel
|
||||
|
||||
var meshPacket = MeshPacket()
|
||||
meshPacket.to = UInt32(destNum)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
}
|
||||
|
||||
///
|
||||
/// This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations.
|
||||
/// This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||
/// This message is used to do settings operations to both remote AND local nodes.
|
||||
/// (Prior to 1.2 these operations were done via special ToRadio operations)
|
||||
struct AdminMessage {
|
||||
|
|
@ -29,6 +29,8 @@ struct AdminMessage {
|
|||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
// methods supported on all messages.
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var variant: AdminMessage.OneOf_Variant? = nil
|
||||
|
||||
///
|
||||
|
|
@ -75,6 +77,8 @@ struct AdminMessage {
|
|||
set {variant = .getRadioRequest(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var getRadioResponse: RadioConfig {
|
||||
get {
|
||||
if case .getRadioResponse(let v)? = variant {return v}
|
||||
|
|
@ -94,6 +98,8 @@ struct AdminMessage {
|
|||
set {variant = .getChannelRequest(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var getChannelResponse: Channel {
|
||||
get {
|
||||
if case .getChannelResponse(let v)? = variant {return v}
|
||||
|
|
@ -112,6 +118,8 @@ struct AdminMessage {
|
|||
set {variant = .getOwnerRequest(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var getOwnerResponse: User {
|
||||
get {
|
||||
if case .getOwnerResponse(let v)? = variant {return v}
|
||||
|
|
@ -133,6 +141,8 @@ struct AdminMessage {
|
|||
set {variant = .confirmSetChannel(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var confirmSetRadio: Bool {
|
||||
get {
|
||||
if case .confirmSetRadio(let v)? = variant {return v}
|
||||
|
|
@ -163,143 +173,123 @@ struct AdminMessage {
|
|||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Plugin message part1 in the response to this message.
|
||||
var getCannedMessagePluginPart1Request: Bool {
|
||||
/// Get the Canned Message Module message part1 in the response to this message.
|
||||
var getCannedMessageModulePart1Request: Bool {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart1Request(let v)? = variant {return v}
|
||||
if case .getCannedMessageModulePart1Request(let v)? = variant {return v}
|
||||
return false
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart1Request(newValue)}
|
||||
}
|
||||
|
||||
var getCannedMessagePluginPart1Response: CannedMessagePluginMessagePart1 {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart1Response(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart1()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart1Response(newValue)}
|
||||
set {variant = .getCannedMessageModulePart1Request(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Plugin message part2 in the response to this message.
|
||||
var getCannedMessagePluginPart2Request: Bool {
|
||||
/// TODO: REPLACE
|
||||
var getCannedMessageModulePart1Response: String {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart2Request(let v)? = variant {return v}
|
||||
if case .getCannedMessageModulePart1Response(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .getCannedMessageModulePart1Response(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Module message part2 in the response to this message.
|
||||
var getCannedMessageModulePart2Request: Bool {
|
||||
get {
|
||||
if case .getCannedMessageModulePart2Request(let v)? = variant {return v}
|
||||
return false
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart2Request(newValue)}
|
||||
}
|
||||
|
||||
var getCannedMessagePluginPart2Response: CannedMessagePluginMessagePart2 {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart2Response(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart2()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart2Response(newValue)}
|
||||
set {variant = .getCannedMessageModulePart2Request(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Plugin message part3 in the response to this message.
|
||||
var getCannedMessagePluginPart3Request: Bool {
|
||||
/// TODO: REPLACE
|
||||
var getCannedMessageModulePart2Response: String {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart3Request(let v)? = variant {return v}
|
||||
if case .getCannedMessageModulePart2Response(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .getCannedMessageModulePart2Response(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Module message part3 in the response to this message.
|
||||
var getCannedMessageModulePart3Request: Bool {
|
||||
get {
|
||||
if case .getCannedMessageModulePart3Request(let v)? = variant {return v}
|
||||
return false
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart3Request(newValue)}
|
||||
}
|
||||
|
||||
var getCannedMessagePluginPart3Response: CannedMessagePluginMessagePart3 {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart3Response(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart3()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart3Response(newValue)}
|
||||
set {variant = .getCannedMessageModulePart3Request(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Plugin message part4 in the response to this message.
|
||||
var getCannedMessagePluginPart4Request: Bool {
|
||||
/// TODO: REPLACE
|
||||
var getCannedMessageModulePart3Response: String {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart4Request(let v)? = variant {return v}
|
||||
if case .getCannedMessageModulePart3Response(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .getCannedMessageModulePart3Response(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Module message part4 in the response to this message.
|
||||
var getCannedMessageModulePart4Request: Bool {
|
||||
get {
|
||||
if case .getCannedMessageModulePart4Request(let v)? = variant {return v}
|
||||
return false
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart4Request(newValue)}
|
||||
}
|
||||
|
||||
var getCannedMessagePluginPart4Response: CannedMessagePluginMessagePart4 {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart4Response(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart4()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart4Response(newValue)}
|
||||
set {variant = .getCannedMessageModulePart4Request(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the Canned Message Plugin message part5 in the response to this message.
|
||||
var getCannedMessagePluginPart5Request: Bool {
|
||||
/// TODO: REPLACE
|
||||
var getCannedMessageModulePart4Response: String {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart5Request(let v)? = variant {return v}
|
||||
return false
|
||||
if case .getCannedMessageModulePart4Response(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart5Request(newValue)}
|
||||
}
|
||||
|
||||
var getCannedMessagePluginPart5Response: CannedMessagePluginMessagePart5 {
|
||||
get {
|
||||
if case .getCannedMessagePluginPart5Response(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart5()
|
||||
}
|
||||
set {variant = .getCannedMessagePluginPart5Response(newValue)}
|
||||
set {variant = .getCannedMessageModulePart4Response(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Set the canned message plugin part 1 text.
|
||||
var setCannedMessagePluginPart1: CannedMessagePluginMessagePart1 {
|
||||
/// Set the canned message module part 1 text.
|
||||
var setCannedMessageModulePart1: String {
|
||||
get {
|
||||
if case .setCannedMessagePluginPart1(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart1()
|
||||
if case .setCannedMessageModulePart1(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .setCannedMessagePluginPart1(newValue)}
|
||||
set {variant = .setCannedMessageModulePart1(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Set the canned message plugin part 2 text.
|
||||
var setCannedMessagePluginPart2: CannedMessagePluginMessagePart2 {
|
||||
/// Set the canned message module part 2 text.
|
||||
var setCannedMessageModulePart2: String {
|
||||
get {
|
||||
if case .setCannedMessagePluginPart2(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart2()
|
||||
if case .setCannedMessageModulePart2(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .setCannedMessagePluginPart2(newValue)}
|
||||
set {variant = .setCannedMessageModulePart2(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Set the canned message plugin part 3 text.
|
||||
var setCannedMessagePluginPart3: CannedMessagePluginMessagePart3 {
|
||||
/// Set the canned message module part 3 text.
|
||||
var setCannedMessageModulePart3: String {
|
||||
get {
|
||||
if case .setCannedMessagePluginPart3(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart3()
|
||||
if case .setCannedMessageModulePart3(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .setCannedMessagePluginPart3(newValue)}
|
||||
set {variant = .setCannedMessageModulePart3(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Set the canned message plugin part 4 text.
|
||||
var setCannedMessagePluginPart4: CannedMessagePluginMessagePart4 {
|
||||
/// Set the canned message module part 4 text.
|
||||
var setCannedMessageModulePart4: String {
|
||||
get {
|
||||
if case .setCannedMessagePluginPart4(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart4()
|
||||
if case .setCannedMessageModulePart4(let v)? = variant {return v}
|
||||
return String()
|
||||
}
|
||||
set {variant = .setCannedMessagePluginPart4(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Set the canned message plugin part 5 text.
|
||||
var setCannedMessagePluginPart5: CannedMessagePluginMessagePart5 {
|
||||
get {
|
||||
if case .setCannedMessagePluginPart5(let v)? = variant {return v}
|
||||
return CannedMessagePluginMessagePart5()
|
||||
}
|
||||
set {variant = .setCannedMessagePluginPart5(newValue)}
|
||||
set {variant = .setCannedMessageModulePart4(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
|
|
@ -314,6 +304,8 @@ struct AdminMessage {
|
|||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
enum OneOf_Variant: Equatable {
|
||||
///
|
||||
/// Set the radio provisioning for this node
|
||||
|
|
@ -331,15 +323,21 @@ struct AdminMessage {
|
|||
///
|
||||
/// Send the current RadioConfig in the response to this message.
|
||||
case getRadioRequest(Bool)
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
case getRadioResponse(RadioConfig)
|
||||
///
|
||||
/// Send the specified channel in the response to this message
|
||||
/// NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
|
||||
case getChannelRequest(UInt32)
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
case getChannelResponse(Channel)
|
||||
///
|
||||
/// Send the current owner data in the response to this message.
|
||||
case getOwnerRequest(Bool)
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
case getOwnerResponse(User)
|
||||
///
|
||||
/// Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again.
|
||||
|
|
@ -347,6 +345,8 @@ struct AdminMessage {
|
|||
/// If you fail to do so, the radio will assume loss of comms and revert your changes.
|
||||
/// These messages are optional when changing the local node.
|
||||
case confirmSetChannel(Bool)
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
case confirmSetRadio(Bool)
|
||||
///
|
||||
/// This message is only supported for the simulator porduino build.
|
||||
|
|
@ -356,40 +356,41 @@ struct AdminMessage {
|
|||
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
|
||||
case rebootSeconds(Int32)
|
||||
///
|
||||
/// Get the Canned Message Plugin message part1 in the response to this message.
|
||||
case getCannedMessagePluginPart1Request(Bool)
|
||||
case getCannedMessagePluginPart1Response(CannedMessagePluginMessagePart1)
|
||||
/// Get the Canned Message Module message part1 in the response to this message.
|
||||
case getCannedMessageModulePart1Request(Bool)
|
||||
///
|
||||
/// Get the Canned Message Plugin message part2 in the response to this message.
|
||||
case getCannedMessagePluginPart2Request(Bool)
|
||||
case getCannedMessagePluginPart2Response(CannedMessagePluginMessagePart2)
|
||||
/// TODO: REPLACE
|
||||
case getCannedMessageModulePart1Response(String)
|
||||
///
|
||||
/// Get the Canned Message Plugin message part3 in the response to this message.
|
||||
case getCannedMessagePluginPart3Request(Bool)
|
||||
case getCannedMessagePluginPart3Response(CannedMessagePluginMessagePart3)
|
||||
/// Get the Canned Message Module message part2 in the response to this message.
|
||||
case getCannedMessageModulePart2Request(Bool)
|
||||
///
|
||||
/// Get the Canned Message Plugin message part4 in the response to this message.
|
||||
case getCannedMessagePluginPart4Request(Bool)
|
||||
case getCannedMessagePluginPart4Response(CannedMessagePluginMessagePart4)
|
||||
/// TODO: REPLACE
|
||||
case getCannedMessageModulePart2Response(String)
|
||||
///
|
||||
/// Get the Canned Message Plugin message part5 in the response to this message.
|
||||
case getCannedMessagePluginPart5Request(Bool)
|
||||
case getCannedMessagePluginPart5Response(CannedMessagePluginMessagePart5)
|
||||
/// Get the Canned Message Module message part3 in the response to this message.
|
||||
case getCannedMessageModulePart3Request(Bool)
|
||||
///
|
||||
/// Set the canned message plugin part 1 text.
|
||||
case setCannedMessagePluginPart1(CannedMessagePluginMessagePart1)
|
||||
/// TODO: REPLACE
|
||||
case getCannedMessageModulePart3Response(String)
|
||||
///
|
||||
/// Set the canned message plugin part 2 text.
|
||||
case setCannedMessagePluginPart2(CannedMessagePluginMessagePart2)
|
||||
/// Get the Canned Message Module message part4 in the response to this message.
|
||||
case getCannedMessageModulePart4Request(Bool)
|
||||
///
|
||||
/// Set the canned message plugin part 3 text.
|
||||
case setCannedMessagePluginPart3(CannedMessagePluginMessagePart3)
|
||||
/// TODO: REPLACE
|
||||
case getCannedMessageModulePart4Response(String)
|
||||
///
|
||||
/// Set the canned message plugin part 4 text.
|
||||
case setCannedMessagePluginPart4(CannedMessagePluginMessagePart4)
|
||||
/// Set the canned message module part 1 text.
|
||||
case setCannedMessageModulePart1(String)
|
||||
///
|
||||
/// Set the canned message plugin part 5 text.
|
||||
case setCannedMessagePluginPart5(CannedMessagePluginMessagePart5)
|
||||
/// Set the canned message module part 2 text.
|
||||
case setCannedMessageModulePart2(String)
|
||||
///
|
||||
/// Set the canned message module part 3 text.
|
||||
case setCannedMessageModulePart3(String)
|
||||
///
|
||||
/// Set the canned message module part 4 text.
|
||||
case setCannedMessageModulePart4(String)
|
||||
///
|
||||
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
|
||||
case shutdownSeconds(Int32)
|
||||
|
|
@ -452,64 +453,52 @@ struct AdminMessage {
|
|||
guard case .rebootSeconds(let l) = lhs, case .rebootSeconds(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart1Request, .getCannedMessagePluginPart1Request): return {
|
||||
guard case .getCannedMessagePluginPart1Request(let l) = lhs, case .getCannedMessagePluginPart1Request(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart1Request, .getCannedMessageModulePart1Request): return {
|
||||
guard case .getCannedMessageModulePart1Request(let l) = lhs, case .getCannedMessageModulePart1Request(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart1Response, .getCannedMessagePluginPart1Response): return {
|
||||
guard case .getCannedMessagePluginPart1Response(let l) = lhs, case .getCannedMessagePluginPart1Response(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart1Response, .getCannedMessageModulePart1Response): return {
|
||||
guard case .getCannedMessageModulePart1Response(let l) = lhs, case .getCannedMessageModulePart1Response(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart2Request, .getCannedMessagePluginPart2Request): return {
|
||||
guard case .getCannedMessagePluginPart2Request(let l) = lhs, case .getCannedMessagePluginPart2Request(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart2Request, .getCannedMessageModulePart2Request): return {
|
||||
guard case .getCannedMessageModulePart2Request(let l) = lhs, case .getCannedMessageModulePart2Request(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart2Response, .getCannedMessagePluginPart2Response): return {
|
||||
guard case .getCannedMessagePluginPart2Response(let l) = lhs, case .getCannedMessagePluginPart2Response(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart2Response, .getCannedMessageModulePart2Response): return {
|
||||
guard case .getCannedMessageModulePart2Response(let l) = lhs, case .getCannedMessageModulePart2Response(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart3Request, .getCannedMessagePluginPart3Request): return {
|
||||
guard case .getCannedMessagePluginPart3Request(let l) = lhs, case .getCannedMessagePluginPart3Request(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart3Request, .getCannedMessageModulePart3Request): return {
|
||||
guard case .getCannedMessageModulePart3Request(let l) = lhs, case .getCannedMessageModulePart3Request(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart3Response, .getCannedMessagePluginPart3Response): return {
|
||||
guard case .getCannedMessagePluginPart3Response(let l) = lhs, case .getCannedMessagePluginPart3Response(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart3Response, .getCannedMessageModulePart3Response): return {
|
||||
guard case .getCannedMessageModulePart3Response(let l) = lhs, case .getCannedMessageModulePart3Response(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart4Request, .getCannedMessagePluginPart4Request): return {
|
||||
guard case .getCannedMessagePluginPart4Request(let l) = lhs, case .getCannedMessagePluginPart4Request(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart4Request, .getCannedMessageModulePart4Request): return {
|
||||
guard case .getCannedMessageModulePart4Request(let l) = lhs, case .getCannedMessageModulePart4Request(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart4Response, .getCannedMessagePluginPart4Response): return {
|
||||
guard case .getCannedMessagePluginPart4Response(let l) = lhs, case .getCannedMessagePluginPart4Response(let r) = rhs else { preconditionFailure() }
|
||||
case (.getCannedMessageModulePart4Response, .getCannedMessageModulePart4Response): return {
|
||||
guard case .getCannedMessageModulePart4Response(let l) = lhs, case .getCannedMessageModulePart4Response(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart5Request, .getCannedMessagePluginPart5Request): return {
|
||||
guard case .getCannedMessagePluginPart5Request(let l) = lhs, case .getCannedMessagePluginPart5Request(let r) = rhs else { preconditionFailure() }
|
||||
case (.setCannedMessageModulePart1, .setCannedMessageModulePart1): return {
|
||||
guard case .setCannedMessageModulePart1(let l) = lhs, case .setCannedMessageModulePart1(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.getCannedMessagePluginPart5Response, .getCannedMessagePluginPart5Response): return {
|
||||
guard case .getCannedMessagePluginPart5Response(let l) = lhs, case .getCannedMessagePluginPart5Response(let r) = rhs else { preconditionFailure() }
|
||||
case (.setCannedMessageModulePart2, .setCannedMessageModulePart2): return {
|
||||
guard case .setCannedMessageModulePart2(let l) = lhs, case .setCannedMessageModulePart2(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.setCannedMessagePluginPart1, .setCannedMessagePluginPart1): return {
|
||||
guard case .setCannedMessagePluginPart1(let l) = lhs, case .setCannedMessagePluginPart1(let r) = rhs else { preconditionFailure() }
|
||||
case (.setCannedMessageModulePart3, .setCannedMessageModulePart3): return {
|
||||
guard case .setCannedMessageModulePart3(let l) = lhs, case .setCannedMessageModulePart3(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.setCannedMessagePluginPart2, .setCannedMessagePluginPart2): return {
|
||||
guard case .setCannedMessagePluginPart2(let l) = lhs, case .setCannedMessagePluginPart2(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.setCannedMessagePluginPart3, .setCannedMessagePluginPart3): return {
|
||||
guard case .setCannedMessagePluginPart3(let l) = lhs, case .setCannedMessagePluginPart3(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.setCannedMessagePluginPart4, .setCannedMessagePluginPart4): return {
|
||||
guard case .setCannedMessagePluginPart4(let l) = lhs, case .setCannedMessagePluginPart4(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.setCannedMessagePluginPart5, .setCannedMessagePluginPart5): return {
|
||||
guard case .setCannedMessagePluginPart5(let l) = lhs, case .setCannedMessagePluginPart5(let r) = rhs else { preconditionFailure() }
|
||||
case (.setCannedMessageModulePart4, .setCannedMessageModulePart4): return {
|
||||
guard case .setCannedMessageModulePart4(let l) = lhs, case .setCannedMessageModulePart4(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.shutdownSeconds, .shutdownSeconds): return {
|
||||
|
|
@ -525,6 +514,11 @@ struct AdminMessage {
|
|||
init() {}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension AdminMessage: @unchecked Sendable {}
|
||||
extension AdminMessage.OneOf_Variant: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
@ -543,21 +537,18 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
33: .standard(proto: "confirm_set_radio"),
|
||||
34: .standard(proto: "exit_simulator"),
|
||||
35: .standard(proto: "reboot_seconds"),
|
||||
36: .standard(proto: "get_canned_message_plugin_part1_request"),
|
||||
37: .standard(proto: "get_canned_message_plugin_part1_response"),
|
||||
38: .standard(proto: "get_canned_message_plugin_part2_request"),
|
||||
39: .standard(proto: "get_canned_message_plugin_part2_response"),
|
||||
40: .standard(proto: "get_canned_message_plugin_part3_request"),
|
||||
41: .standard(proto: "get_canned_message_plugin_part3_response"),
|
||||
42: .standard(proto: "get_canned_message_plugin_part4_request"),
|
||||
43: .standard(proto: "get_canned_message_plugin_part4_response"),
|
||||
44: .standard(proto: "get_canned_message_plugin_part5_request"),
|
||||
45: .standard(proto: "get_canned_message_plugin_part5_response"),
|
||||
46: .standard(proto: "set_canned_message_plugin_part1"),
|
||||
47: .standard(proto: "set_canned_message_plugin_part2"),
|
||||
48: .standard(proto: "set_canned_message_plugin_part3"),
|
||||
49: .standard(proto: "set_canned_message_plugin_part4"),
|
||||
50: .standard(proto: "set_canned_message_plugin_part5"),
|
||||
36: .standard(proto: "get_canned_message_module_part1_request"),
|
||||
37: .standard(proto: "get_canned_message_module_part1_response"),
|
||||
38: .standard(proto: "get_canned_message_module_part2_request"),
|
||||
39: .standard(proto: "get_canned_message_module_part2_response"),
|
||||
40: .standard(proto: "get_canned_message_module_part3_request"),
|
||||
41: .standard(proto: "get_canned_message_module_part3_response"),
|
||||
42: .standard(proto: "get_canned_message_module_part4_request"),
|
||||
43: .standard(proto: "get_canned_message_module_part4_response"),
|
||||
44: .standard(proto: "set_canned_message_module_part1"),
|
||||
45: .standard(proto: "set_canned_message_module_part2"),
|
||||
46: .standard(proto: "set_canned_message_module_part3"),
|
||||
47: .standard(proto: "set_canned_message_module_part4"),
|
||||
51: .standard(proto: "shutdown_seconds"),
|
||||
]
|
||||
|
||||
|
|
@ -706,20 +697,15 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
try decoder.decodeSingularBoolField(value: &v)
|
||||
if let v = v {
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart1Request(v)
|
||||
self.variant = .getCannedMessageModulePart1Request(v)
|
||||
}
|
||||
}()
|
||||
case 37: try {
|
||||
var v: CannedMessagePluginMessagePart1?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .getCannedMessagePluginPart1Response(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart1Response(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessageModulePart1Response(v)
|
||||
}
|
||||
}()
|
||||
case 38: try {
|
||||
|
|
@ -727,20 +713,15 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
try decoder.decodeSingularBoolField(value: &v)
|
||||
if let v = v {
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart2Request(v)
|
||||
self.variant = .getCannedMessageModulePart2Request(v)
|
||||
}
|
||||
}()
|
||||
case 39: try {
|
||||
var v: CannedMessagePluginMessagePart2?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .getCannedMessagePluginPart2Response(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart2Response(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessageModulePart2Response(v)
|
||||
}
|
||||
}()
|
||||
case 40: try {
|
||||
|
|
@ -748,20 +729,15 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
try decoder.decodeSingularBoolField(value: &v)
|
||||
if let v = v {
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart3Request(v)
|
||||
self.variant = .getCannedMessageModulePart3Request(v)
|
||||
}
|
||||
}()
|
||||
case 41: try {
|
||||
var v: CannedMessagePluginMessagePart3?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .getCannedMessagePluginPart3Response(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart3Response(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessageModulePart3Response(v)
|
||||
}
|
||||
}()
|
||||
case 42: try {
|
||||
|
|
@ -769,106 +745,47 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
try decoder.decodeSingularBoolField(value: &v)
|
||||
if let v = v {
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart4Request(v)
|
||||
self.variant = .getCannedMessageModulePart4Request(v)
|
||||
}
|
||||
}()
|
||||
case 43: try {
|
||||
var v: CannedMessagePluginMessagePart4?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .getCannedMessagePluginPart4Response(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart4Response(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessageModulePart4Response(v)
|
||||
}
|
||||
}()
|
||||
case 44: try {
|
||||
var v: Bool?
|
||||
try decoder.decodeSingularBoolField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart5Request(v)
|
||||
self.variant = .setCannedMessageModulePart1(v)
|
||||
}
|
||||
}()
|
||||
case 45: try {
|
||||
var v: CannedMessagePluginMessagePart5?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .getCannedMessagePluginPart5Response(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .getCannedMessagePluginPart5Response(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessageModulePart2(v)
|
||||
}
|
||||
}()
|
||||
case 46: try {
|
||||
var v: CannedMessagePluginMessagePart1?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .setCannedMessagePluginPart1(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessagePluginPart1(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessageModulePart3(v)
|
||||
}
|
||||
}()
|
||||
case 47: try {
|
||||
var v: CannedMessagePluginMessagePart2?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .setCannedMessagePluginPart2(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
var v: String?
|
||||
try decoder.decodeSingularStringField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessagePluginPart2(v)
|
||||
}
|
||||
}()
|
||||
case 48: try {
|
||||
var v: CannedMessagePluginMessagePart3?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .setCannedMessagePluginPart3(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessagePluginPart3(v)
|
||||
}
|
||||
}()
|
||||
case 49: try {
|
||||
var v: CannedMessagePluginMessagePart4?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .setCannedMessagePluginPart4(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessagePluginPart4(v)
|
||||
}
|
||||
}()
|
||||
case 50: try {
|
||||
var v: CannedMessagePluginMessagePart5?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .setCannedMessagePluginPart5(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessagePluginPart5(v)
|
||||
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .setCannedMessageModulePart4(v)
|
||||
}
|
||||
}()
|
||||
case 51: try {
|
||||
|
|
@ -886,8 +803,9 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
|
||||
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 case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
// 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
|
||||
switch self.variant {
|
||||
case .setRadio?: try {
|
||||
guard case .setRadio(let v)? = self.variant else { preconditionFailure() }
|
||||
|
|
@ -941,65 +859,53 @@ extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat
|
|||
guard case .rebootSeconds(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 35)
|
||||
}()
|
||||
case .getCannedMessagePluginPart1Request?: try {
|
||||
guard case .getCannedMessagePluginPart1Request(let v)? = self.variant else { preconditionFailure() }
|
||||
case .getCannedMessageModulePart1Request?: try {
|
||||
guard case .getCannedMessageModulePart1Request(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 36)
|
||||
}()
|
||||
case .getCannedMessagePluginPart1Response?: try {
|
||||
guard case .getCannedMessagePluginPart1Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 37)
|
||||
case .getCannedMessageModulePart1Response?: try {
|
||||
guard case .getCannedMessageModulePart1Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 37)
|
||||
}()
|
||||
case .getCannedMessagePluginPart2Request?: try {
|
||||
guard case .getCannedMessagePluginPart2Request(let v)? = self.variant else { preconditionFailure() }
|
||||
case .getCannedMessageModulePart2Request?: try {
|
||||
guard case .getCannedMessageModulePart2Request(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 38)
|
||||
}()
|
||||
case .getCannedMessagePluginPart2Response?: try {
|
||||
guard case .getCannedMessagePluginPart2Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 39)
|
||||
case .getCannedMessageModulePart2Response?: try {
|
||||
guard case .getCannedMessageModulePart2Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 39)
|
||||
}()
|
||||
case .getCannedMessagePluginPart3Request?: try {
|
||||
guard case .getCannedMessagePluginPart3Request(let v)? = self.variant else { preconditionFailure() }
|
||||
case .getCannedMessageModulePart3Request?: try {
|
||||
guard case .getCannedMessageModulePart3Request(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 40)
|
||||
}()
|
||||
case .getCannedMessagePluginPart3Response?: try {
|
||||
guard case .getCannedMessagePluginPart3Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 41)
|
||||
case .getCannedMessageModulePart3Response?: try {
|
||||
guard case .getCannedMessageModulePart3Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 41)
|
||||
}()
|
||||
case .getCannedMessagePluginPart4Request?: try {
|
||||
guard case .getCannedMessagePluginPart4Request(let v)? = self.variant else { preconditionFailure() }
|
||||
case .getCannedMessageModulePart4Request?: try {
|
||||
guard case .getCannedMessageModulePart4Request(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 42)
|
||||
}()
|
||||
case .getCannedMessagePluginPart4Response?: try {
|
||||
guard case .getCannedMessagePluginPart4Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 43)
|
||||
case .getCannedMessageModulePart4Response?: try {
|
||||
guard case .getCannedMessageModulePart4Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 43)
|
||||
}()
|
||||
case .getCannedMessagePluginPart5Request?: try {
|
||||
guard case .getCannedMessagePluginPart5Request(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 44)
|
||||
case .setCannedMessageModulePart1?: try {
|
||||
guard case .setCannedMessageModulePart1(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 44)
|
||||
}()
|
||||
case .getCannedMessagePluginPart5Response?: try {
|
||||
guard case .getCannedMessagePluginPart5Response(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 45)
|
||||
case .setCannedMessageModulePart2?: try {
|
||||
guard case .setCannedMessageModulePart2(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 45)
|
||||
}()
|
||||
case .setCannedMessagePluginPart1?: try {
|
||||
guard case .setCannedMessagePluginPart1(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 46)
|
||||
case .setCannedMessageModulePart3?: try {
|
||||
guard case .setCannedMessageModulePart3(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 46)
|
||||
}()
|
||||
case .setCannedMessagePluginPart2?: try {
|
||||
guard case .setCannedMessagePluginPart2(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 47)
|
||||
}()
|
||||
case .setCannedMessagePluginPart3?: try {
|
||||
guard case .setCannedMessagePluginPart3(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 48)
|
||||
}()
|
||||
case .setCannedMessagePluginPart4?: try {
|
||||
guard case .setCannedMessagePluginPart4(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 49)
|
||||
}()
|
||||
case .setCannedMessagePluginPart5?: try {
|
||||
guard case .setCannedMessagePluginPart5(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 50)
|
||||
case .setCannedMessageModulePart4?: try {
|
||||
guard case .setCannedMessageModulePart4(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 47)
|
||||
}()
|
||||
case .shutdownSeconds?: try {
|
||||
guard case .shutdownSeconds(let v)? = self.variant else { preconditionFailure() }
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ struct ChannelSet {
|
|||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
// methods supported on all messages.
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var settings: [ChannelSettings] = []
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
|
@ -38,6 +40,10 @@ struct ChannelSet {
|
|||
init() {}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension ChannelSet: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension ChannelSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
|
|||
|
|
@ -40,96 +40,46 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
}
|
||||
|
||||
///
|
||||
/// Canned message plugin part 1
|
||||
struct CannedMessagePluginMessagePart1 {
|
||||
/// Canned message module configuration.
|
||||
struct CannedMessageModuleConfig {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Predefined messages for canned message plugin separated by '|' characters.
|
||||
/// This is part 1.
|
||||
var text: String = String()
|
||||
/// Predefined messages for canned message module separated by '|' characters.
|
||||
var messagesPart1: String = String()
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var messagesPart2: String = String()
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var messagesPart3: String = String()
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var messagesPart4: String = String()
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned message plugin part 2
|
||||
struct CannedMessagePluginMessagePart2 {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Predefined messages for canned message plugin separated by '|' characters.
|
||||
/// This is part 2.
|
||||
var text: String = String()
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned message plugin part 3
|
||||
struct CannedMessagePluginMessagePart3 {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Predefined messages for canned message plugin separated by '|' characters.
|
||||
/// This is part 3.
|
||||
var text: String = String()
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned message plugin part 4
|
||||
struct CannedMessagePluginMessagePart4 {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Predefined messages for canned message plugin separated by '|' characters.
|
||||
/// This is part 4.
|
||||
var text: String = String()
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned message plugin part 5
|
||||
struct CannedMessagePluginMessagePart5 {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Predefined messages for canned message plugin separated by '|' characters.
|
||||
/// This is part 5.
|
||||
var text: String = String()
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension CannedMessageModuleConfig: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension CannedMessagePluginMessagePart1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessagePluginMessagePart1"
|
||||
extension CannedMessageModuleConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessageModuleConfig"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "text"),
|
||||
11: .same(proto: "messagesPart1"),
|
||||
12: .same(proto: "messagesPart2"),
|
||||
13: .same(proto: "messagesPart3"),
|
||||
14: .same(proto: "messagesPart4"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
|
|
@ -138,149 +88,36 @@ extension CannedMessagePluginMessagePart1: SwiftProtobuf.Message, SwiftProtobuf.
|
|||
// 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.text) }()
|
||||
case 11: try { try decoder.decodeSingularStringField(value: &self.messagesPart1) }()
|
||||
case 12: try { try decoder.decodeSingularStringField(value: &self.messagesPart2) }()
|
||||
case 13: try { try decoder.decodeSingularStringField(value: &self.messagesPart3) }()
|
||||
case 14: try { try decoder.decodeSingularStringField(value: &self.messagesPart4) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if !self.text.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
|
||||
if !self.messagesPart1.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.messagesPart1, fieldNumber: 11)
|
||||
}
|
||||
if !self.messagesPart2.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.messagesPart2, fieldNumber: 12)
|
||||
}
|
||||
if !self.messagesPart3.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.messagesPart3, fieldNumber: 13)
|
||||
}
|
||||
if !self.messagesPart4.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.messagesPart4, fieldNumber: 14)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: CannedMessagePluginMessagePart1, rhs: CannedMessagePluginMessagePart1) -> Bool {
|
||||
if lhs.text != rhs.text {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension CannedMessagePluginMessagePart2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessagePluginMessagePart2"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "text"),
|
||||
]
|
||||
|
||||
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.decodeSingularStringField(value: &self.text) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if !self.text.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: CannedMessagePluginMessagePart2, rhs: CannedMessagePluginMessagePart2) -> Bool {
|
||||
if lhs.text != rhs.text {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension CannedMessagePluginMessagePart3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessagePluginMessagePart3"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "text"),
|
||||
]
|
||||
|
||||
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.decodeSingularStringField(value: &self.text) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if !self.text.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: CannedMessagePluginMessagePart3, rhs: CannedMessagePluginMessagePart3) -> Bool {
|
||||
if lhs.text != rhs.text {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension CannedMessagePluginMessagePart4: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessagePluginMessagePart4"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "text"),
|
||||
]
|
||||
|
||||
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.decodeSingularStringField(value: &self.text) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if !self.text.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: CannedMessagePluginMessagePart4, rhs: CannedMessagePluginMessagePart4) -> Bool {
|
||||
if lhs.text != rhs.text {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension CannedMessagePluginMessagePart5: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "CannedMessagePluginMessagePart5"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "text"),
|
||||
]
|
||||
|
||||
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.decodeSingularStringField(value: &self.text) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if !self.text.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: CannedMessagePluginMessagePart5, rhs: CannedMessagePluginMessagePart5) -> Bool {
|
||||
if lhs.text != rhs.text {return false}
|
||||
static func ==(lhs: CannedMessageModuleConfig, rhs: CannedMessageModuleConfig) -> Bool {
|
||||
if lhs.messagesPart1 != rhs.messagesPart1 {return false}
|
||||
if lhs.messagesPart2 != rhs.messagesPart2 {return false}
|
||||
if lhs.messagesPart3 != rhs.messagesPart3 {return false}
|
||||
if lhs.messagesPart4 != rhs.messagesPart4 {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct ChannelSettings {
|
|||
/// Because protobufs take ZERO space when the value is zero this works out nicely.
|
||||
/// This value is replaced by bandwidth/spread_factor/coding_rate.
|
||||
/// If you'd like to experiment with other options add them to MeshRadio.cpp in the device code.
|
||||
var modemConfig: ChannelSettings.ModemConfig = .bw125Cr45Sf128
|
||||
var modemConfig: ChannelSettings.ModemConfig = .vlongSlow
|
||||
|
||||
///
|
||||
/// Bandwidth in MHz
|
||||
|
|
@ -173,60 +173,60 @@ struct ChannelSettings {
|
|||
typealias RawValue = Int
|
||||
|
||||
///
|
||||
/// < Bw = 125 kHz, Cr = 4/5, Sf(7) = 128chips/symbol, CRC
|
||||
/// < on. ShortSlow | Short Range / Slow (5.469 kbps)
|
||||
case bw125Cr45Sf128 // = 0
|
||||
/// TODO: REPLACE
|
||||
case vlongSlow // = 0
|
||||
|
||||
///
|
||||
/// < Bw = 500 kHz, Cr = 4/5, Sf(7) = 128chips/symbol, CRC
|
||||
/// < on. ShortFast | Short Range / Fast (21.875 kbps)
|
||||
case bw500Cr45Sf128 // = 1
|
||||
/// TODO: REPLACE
|
||||
case longSlow // = 1
|
||||
|
||||
///
|
||||
/// < Bw = 31.25 kHz, Cr = 4/8, Sf(9) = 512chips/symbol,
|
||||
/// < CRC on. LongFast | Long Range / Fast (275 bps)
|
||||
case bw3125Cr48Sf512 // = 2
|
||||
/// TODO: REPLACE
|
||||
case longFast // = 2
|
||||
|
||||
///
|
||||
/// < Bw = 125 kHz, Cr = 4/8, Sf(12) = 4096chips/symbol, CRC
|
||||
/// < on. LongSlow | Long Range / Slow (183 bps)
|
||||
case bw125Cr48Sf4096 // = 3
|
||||
/// TODO: REPLACE
|
||||
case midSlow // = 3
|
||||
|
||||
///
|
||||
/// < Bw = 250 kHz, Cr = 4/6, Sf(11) = 2048chips/symbol, CRC
|
||||
/// < on. MediumSlow | Medium Range / Slow (895 bps)
|
||||
case bw250Cr46Sf2048 // = 4
|
||||
/// TODO: REPLACE
|
||||
case midFast // = 4
|
||||
|
||||
///
|
||||
/// < Bw = 250 kHz, Cr = 4/7, Sf(10) = 1024chips/symbol, CRC
|
||||
/// < on. MediumFast | Medium Range / Fast (1400 bps)
|
||||
case bw250Cr47Sf1024 // = 5
|
||||
/// TODO: REPLACE
|
||||
case shortSlow // = 5
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
case shortFast // = 6
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
init() {
|
||||
self = .bw125Cr45Sf128
|
||||
self = .vlongSlow
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 0: self = .bw125Cr45Sf128
|
||||
case 1: self = .bw500Cr45Sf128
|
||||
case 2: self = .bw3125Cr48Sf512
|
||||
case 3: self = .bw125Cr48Sf4096
|
||||
case 4: self = .bw250Cr46Sf2048
|
||||
case 5: self = .bw250Cr47Sf1024
|
||||
case 0: self = .vlongSlow
|
||||
case 1: self = .longSlow
|
||||
case 2: self = .longFast
|
||||
case 3: self = .midSlow
|
||||
case 4: self = .midFast
|
||||
case 5: self = .shortSlow
|
||||
case 6: self = .shortFast
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .bw125Cr45Sf128: return 0
|
||||
case .bw500Cr45Sf128: return 1
|
||||
case .bw3125Cr48Sf512: return 2
|
||||
case .bw125Cr48Sf4096: return 3
|
||||
case .bw250Cr46Sf2048: return 4
|
||||
case .bw250Cr47Sf1024: return 5
|
||||
case .vlongSlow: return 0
|
||||
case .longSlow: return 1
|
||||
case .longFast: return 2
|
||||
case .midSlow: return 3
|
||||
case .midFast: return 4
|
||||
case .shortSlow: return 5
|
||||
case .shortFast: return 6
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
}
|
||||
|
|
@ -241,12 +241,13 @@ struct ChannelSettings {
|
|||
extension ChannelSettings.ModemConfig: CaseIterable {
|
||||
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
||||
static var allCases: [ChannelSettings.ModemConfig] = [
|
||||
.bw125Cr45Sf128,
|
||||
.bw500Cr45Sf128,
|
||||
.bw3125Cr48Sf512,
|
||||
.bw125Cr48Sf4096,
|
||||
.bw250Cr46Sf2048,
|
||||
.bw250Cr47Sf1024,
|
||||
.vlongSlow,
|
||||
.longSlow,
|
||||
.longFast,
|
||||
.midSlow,
|
||||
.midFast,
|
||||
.shortSlow,
|
||||
.shortFast,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -276,6 +277,8 @@ struct Channel {
|
|||
/// Clears the value of `settings`. Subsequent reads from it will return its default value.
|
||||
mutating func clearSettings() {self._settings = nil}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var role: Channel.Role = .disabled
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
|
@ -351,6 +354,13 @@ extension Channel.Role: CaseIterable {
|
|||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension ChannelSettings: @unchecked Sendable {}
|
||||
extension ChannelSettings.ModemConfig: @unchecked Sendable {}
|
||||
extension Channel: @unchecked Sendable {}
|
||||
extension Channel.Role: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension ChannelSettings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
@ -395,7 +405,7 @@ extension ChannelSettings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
|
|||
if self.txPower != 0 {
|
||||
try visitor.visitSingularInt32Field(value: self.txPower, fieldNumber: 1)
|
||||
}
|
||||
if self.modemConfig != .bw125Cr45Sf128 {
|
||||
if self.modemConfig != .vlongSlow {
|
||||
try visitor.visitSingularEnumField(value: self.modemConfig, fieldNumber: 3)
|
||||
}
|
||||
if !self.psk.isEmpty {
|
||||
|
|
@ -447,12 +457,13 @@ extension ChannelSettings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
|
|||
|
||||
extension ChannelSettings.ModemConfig: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
0: .same(proto: "Bw125Cr45Sf128"),
|
||||
1: .same(proto: "Bw500Cr45Sf128"),
|
||||
2: .same(proto: "Bw31_25Cr48Sf512"),
|
||||
3: .same(proto: "Bw125Cr48Sf4096"),
|
||||
4: .same(proto: "Bw250Cr46Sf2048"),
|
||||
5: .same(proto: "Bw250Cr47Sf1024"),
|
||||
0: .same(proto: "VLongSlow"),
|
||||
1: .same(proto: "LongSlow"),
|
||||
2: .same(proto: "LongFast"),
|
||||
3: .same(proto: "MidSlow"),
|
||||
4: .same(proto: "MidFast"),
|
||||
5: .same(proto: "ShortSlow"),
|
||||
6: .same(proto: "ShortFast"),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -479,12 +490,16 @@ extension Channel: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBa
|
|||
}
|
||||
|
||||
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.index != 0 {
|
||||
try visitor.visitSingularInt32Field(value: self.index, fieldNumber: 1)
|
||||
}
|
||||
if let v = self._settings {
|
||||
try { if let v = self._settings {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
}
|
||||
} }()
|
||||
if self.role != .disabled {
|
||||
try visitor.visitSingularEnumField(value: self.role, fieldNumber: 3)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,45 +20,6 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
typealias Version = _2
|
||||
}
|
||||
|
||||
///
|
||||
/// This is a stub version of the old 1.1 representation of RadioConfig.
|
||||
/// But only keeping the region info.
|
||||
/// The device firmware uses this stub while migrating old nodes to the new preferences system.
|
||||
struct LegacyRadioConfig {
|
||||
// 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 preferences: LegacyRadioConfig.LegacyPreferences {
|
||||
get {return _preferences ?? LegacyRadioConfig.LegacyPreferences()}
|
||||
set {_preferences = newValue}
|
||||
}
|
||||
/// Returns true if `preferences` has been explicitly set.
|
||||
var hasPreferences: Bool {return self._preferences != nil}
|
||||
/// Clears the value of `preferences`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPreferences() {self._preferences = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
struct LegacyPreferences {
|
||||
// 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 region code for my radio (US, CN, EU433, etc...)
|
||||
var region: RegionCode = .unset
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _preferences: LegacyRadioConfig.LegacyPreferences? = nil
|
||||
}
|
||||
|
||||
///
|
||||
/// This message is never sent over the wire, but it is used for serializing DB
|
||||
/// state to flash in the device code
|
||||
|
|
@ -70,17 +31,6 @@ struct DeviceState {
|
|||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
// methods supported on all messages.
|
||||
|
||||
///
|
||||
/// Moved to its own file, but we keep this here so we can automatically migrate old radio.region settings
|
||||
var legacyRadio: LegacyRadioConfig {
|
||||
get {return _storage._legacyRadio ?? LegacyRadioConfig()}
|
||||
set {_uniqueStorage()._legacyRadio = newValue}
|
||||
}
|
||||
/// Returns true if `legacyRadio` has been explicitly set.
|
||||
var hasLegacyRadio: Bool {return _storage._legacyRadio != nil}
|
||||
/// Clears the value of `legacyRadio`. Subsequent reads from it will return its default value.
|
||||
mutating func clearLegacyRadio() {_uniqueStorage()._legacyRadio = nil}
|
||||
|
||||
///
|
||||
/// Read only settings/info about this node
|
||||
var myNode: MyNodeInfo {
|
||||
|
|
@ -103,6 +53,8 @@ struct DeviceState {
|
|||
/// Clears the value of `owner`. Subsequent reads from it will return its default value.
|
||||
mutating func clearOwner() {_uniqueStorage()._owner = nil}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var nodeDb: [NodeInfo] {
|
||||
get {return _storage._nodeDb}
|
||||
set {_uniqueStorage()._nodeDb = newValue}
|
||||
|
|
@ -152,41 +104,6 @@ struct DeviceState {
|
|||
set {_uniqueStorage()._didGpsReset = newValue}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned Message Plugin message part1.
|
||||
var cannedMessagePluginMessagePart1: String {
|
||||
get {return _storage._cannedMessagePluginMessagePart1}
|
||||
set {_uniqueStorage()._cannedMessagePluginMessagePart1 = newValue}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned Message Plugin message part2.
|
||||
var cannedMessagePluginMessagePart2: String {
|
||||
get {return _storage._cannedMessagePluginMessagePart2}
|
||||
set {_uniqueStorage()._cannedMessagePluginMessagePart2 = newValue}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned Message Plugin message part3.
|
||||
var cannedMessagePluginMessagePart3: String {
|
||||
get {return _storage._cannedMessagePluginMessagePart3}
|
||||
set {_uniqueStorage()._cannedMessagePluginMessagePart3 = newValue}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned Message Plugin message part4.
|
||||
var cannedMessagePluginMessagePart4: String {
|
||||
get {return _storage._cannedMessagePluginMessagePart4}
|
||||
set {_uniqueStorage()._cannedMessagePluginMessagePart4 = newValue}
|
||||
}
|
||||
|
||||
///
|
||||
/// Canned Message Plugin message part5.
|
||||
var cannedMessagePluginMessagePart5: String {
|
||||
get {return _storage._cannedMessagePluginMessagePart5}
|
||||
set {_uniqueStorage()._cannedMessagePluginMessagePart5 = newValue}
|
||||
}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
|
@ -210,76 +127,16 @@ struct ChannelFile {
|
|||
init() {}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension DeviceState: @unchecked Sendable {}
|
||||
extension ChannelFile: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension LegacyRadioConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "LegacyRadioConfig"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "preferences"),
|
||||
]
|
||||
|
||||
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.decodeSingularMessageField(value: &self._preferences) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if let v = self._preferences {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: LegacyRadioConfig, rhs: LegacyRadioConfig) -> Bool {
|
||||
if lhs._preferences != rhs._preferences {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension LegacyRadioConfig.LegacyPreferences: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = LegacyRadioConfig.protoMessageName + ".LegacyPreferences"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
15: .same(proto: "region"),
|
||||
]
|
||||
|
||||
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 15: try { try decoder.decodeSingularEnumField(value: &self.region) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if self.region != .unset {
|
||||
try visitor.visitSingularEnumField(value: self.region, fieldNumber: 15)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: LegacyRadioConfig.LegacyPreferences, rhs: LegacyRadioConfig.LegacyPreferences) -> Bool {
|
||||
if lhs.region != rhs.region {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "DeviceState"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "legacyRadio"),
|
||||
2: .standard(proto: "my_node"),
|
||||
3: .same(proto: "owner"),
|
||||
4: .standard(proto: "node_db"),
|
||||
|
|
@ -288,15 +145,9 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
7: .standard(proto: "rx_text_message"),
|
||||
9: .standard(proto: "no_save"),
|
||||
11: .standard(proto: "did_gps_reset"),
|
||||
13: .standard(proto: "canned_message_plugin_message_part1"),
|
||||
14: .standard(proto: "canned_message_plugin_message_part2"),
|
||||
15: .standard(proto: "canned_message_plugin_message_part3"),
|
||||
16: .standard(proto: "canned_message_plugin_message_part4"),
|
||||
17: .standard(proto: "canned_message_plugin_message_part5"),
|
||||
]
|
||||
|
||||
fileprivate class _StorageClass {
|
||||
var _legacyRadio: LegacyRadioConfig? = nil
|
||||
var _myNode: MyNodeInfo? = nil
|
||||
var _owner: User? = nil
|
||||
var _nodeDb: [NodeInfo] = []
|
||||
|
|
@ -305,18 +156,12 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
var _rxTextMessage: MeshPacket? = nil
|
||||
var _noSave: Bool = false
|
||||
var _didGpsReset: Bool = false
|
||||
var _cannedMessagePluginMessagePart1: String = String()
|
||||
var _cannedMessagePluginMessagePart2: String = String()
|
||||
var _cannedMessagePluginMessagePart3: String = String()
|
||||
var _cannedMessagePluginMessagePart4: String = String()
|
||||
var _cannedMessagePluginMessagePart5: String = String()
|
||||
|
||||
static let defaultInstance = _StorageClass()
|
||||
|
||||
private init() {}
|
||||
|
||||
init(copying source: _StorageClass) {
|
||||
_legacyRadio = source._legacyRadio
|
||||
_myNode = source._myNode
|
||||
_owner = source._owner
|
||||
_nodeDb = source._nodeDb
|
||||
|
|
@ -325,11 +170,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
_rxTextMessage = source._rxTextMessage
|
||||
_noSave = source._noSave
|
||||
_didGpsReset = source._didGpsReset
|
||||
_cannedMessagePluginMessagePart1 = source._cannedMessagePluginMessagePart1
|
||||
_cannedMessagePluginMessagePart2 = source._cannedMessagePluginMessagePart2
|
||||
_cannedMessagePluginMessagePart3 = source._cannedMessagePluginMessagePart3
|
||||
_cannedMessagePluginMessagePart4 = source._cannedMessagePluginMessagePart4
|
||||
_cannedMessagePluginMessagePart5 = source._cannedMessagePluginMessagePart5
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -348,7 +188,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
// 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: &_storage._legacyRadio) }()
|
||||
case 2: try { try decoder.decodeSingularMessageField(value: &_storage._myNode) }()
|
||||
case 3: try { try decoder.decodeSingularMessageField(value: &_storage._owner) }()
|
||||
case 4: try { try decoder.decodeRepeatedMessageField(value: &_storage._nodeDb) }()
|
||||
|
|
@ -357,11 +196,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
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 13: try { try decoder.decodeSingularStringField(value: &_storage._cannedMessagePluginMessagePart1) }()
|
||||
case 14: try { try decoder.decodeSingularStringField(value: &_storage._cannedMessagePluginMessagePart2) }()
|
||||
case 15: try { try decoder.decodeSingularStringField(value: &_storage._cannedMessagePluginMessagePart3) }()
|
||||
case 16: try { try decoder.decodeSingularStringField(value: &_storage._cannedMessagePluginMessagePart4) }()
|
||||
case 17: try { try decoder.decodeSingularStringField(value: &_storage._cannedMessagePluginMessagePart5) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
|
@ -370,24 +204,25 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
|
||||
if let v = _storage._legacyRadio {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
}
|
||||
if let v = _storage._myNode {
|
||||
// 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)
|
||||
}
|
||||
if let v = _storage._owner {
|
||||
} }()
|
||||
try { if let v = _storage._owner {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||
}
|
||||
} }()
|
||||
if !_storage._nodeDb.isEmpty {
|
||||
try visitor.visitRepeatedMessageField(value: _storage._nodeDb, fieldNumber: 4)
|
||||
}
|
||||
if !_storage._receiveQueue.isEmpty {
|
||||
try visitor.visitRepeatedMessageField(value: _storage._receiveQueue, fieldNumber: 5)
|
||||
}
|
||||
if let v = _storage._rxTextMessage {
|
||||
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)
|
||||
}
|
||||
|
|
@ -397,21 +232,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
if _storage._didGpsReset != false {
|
||||
try visitor.visitSingularBoolField(value: _storage._didGpsReset, fieldNumber: 11)
|
||||
}
|
||||
if !_storage._cannedMessagePluginMessagePart1.isEmpty {
|
||||
try visitor.visitSingularStringField(value: _storage._cannedMessagePluginMessagePart1, fieldNumber: 13)
|
||||
}
|
||||
if !_storage._cannedMessagePluginMessagePart2.isEmpty {
|
||||
try visitor.visitSingularStringField(value: _storage._cannedMessagePluginMessagePart2, fieldNumber: 14)
|
||||
}
|
||||
if !_storage._cannedMessagePluginMessagePart3.isEmpty {
|
||||
try visitor.visitSingularStringField(value: _storage._cannedMessagePluginMessagePart3, fieldNumber: 15)
|
||||
}
|
||||
if !_storage._cannedMessagePluginMessagePart4.isEmpty {
|
||||
try visitor.visitSingularStringField(value: _storage._cannedMessagePluginMessagePart4, fieldNumber: 16)
|
||||
}
|
||||
if !_storage._cannedMessagePluginMessagePart5.isEmpty {
|
||||
try visitor.visitSingularStringField(value: _storage._cannedMessagePluginMessagePart5, fieldNumber: 17)
|
||||
}
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
|
@ -421,7 +241,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
|
||||
let _storage = _args.0
|
||||
let rhs_storage = _args.1
|
||||
if _storage._legacyRadio != rhs_storage._legacyRadio {return false}
|
||||
if _storage._myNode != rhs_storage._myNode {return false}
|
||||
if _storage._owner != rhs_storage._owner {return false}
|
||||
if _storage._nodeDb != rhs_storage._nodeDb {return false}
|
||||
|
|
@ -430,11 +249,6 @@ extension DeviceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati
|
|||
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._cannedMessagePluginMessagePart1 != rhs_storage._cannedMessagePluginMessagePart1 {return false}
|
||||
if _storage._cannedMessagePluginMessagePart2 != rhs_storage._cannedMessagePluginMessagePart2 {return false}
|
||||
if _storage._cannedMessagePluginMessagePart3 != rhs_storage._cannedMessagePluginMessagePart3 {return false}
|
||||
if _storage._cannedMessagePluginMessagePart4 != rhs_storage._cannedMessagePluginMessagePart4 {return false}
|
||||
if _storage._cannedMessagePluginMessagePart5 != rhs_storage._cannedMessagePluginMessagePart5 {return false}
|
||||
return true
|
||||
}
|
||||
if !storagesAreEqual {return false}
|
||||
|
|
|
|||
|
|
@ -1,107 +0,0 @@
|
|||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||
// Source: environmental_measurement.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 EnvironmentalMeasurement {
|
||||
// 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 temperature: Float = 0
|
||||
|
||||
var relativeHumidity: Float = 0
|
||||
|
||||
var barometricPressure: Float = 0
|
||||
|
||||
var gasResistance: Float = 0
|
||||
|
||||
var voltage: Float = 0
|
||||
|
||||
var current: Float = 0
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension EnvironmentalMeasurement: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "EnvironmentalMeasurement"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "temperature"),
|
||||
2: .standard(proto: "relative_humidity"),
|
||||
3: .standard(proto: "barometric_pressure"),
|
||||
4: .standard(proto: "gas_resistance"),
|
||||
5: .same(proto: "voltage"),
|
||||
6: .same(proto: "current"),
|
||||
]
|
||||
|
||||
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.decodeSingularFloatField(value: &self.temperature) }()
|
||||
case 2: try { try decoder.decodeSingularFloatField(value: &self.relativeHumidity) }()
|
||||
case 3: try { try decoder.decodeSingularFloatField(value: &self.barometricPressure) }()
|
||||
case 4: try { try decoder.decodeSingularFloatField(value: &self.gasResistance) }()
|
||||
case 5: try { try decoder.decodeSingularFloatField(value: &self.voltage) }()
|
||||
case 6: try { try decoder.decodeSingularFloatField(value: &self.current) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if self.temperature != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.temperature, fieldNumber: 1)
|
||||
}
|
||||
if self.relativeHumidity != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.relativeHumidity, fieldNumber: 2)
|
||||
}
|
||||
if self.barometricPressure != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.barometricPressure, fieldNumber: 3)
|
||||
}
|
||||
if self.gasResistance != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.gasResistance, fieldNumber: 4)
|
||||
}
|
||||
if self.voltage != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.voltage, fieldNumber: 5)
|
||||
}
|
||||
if self.current != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.current, fieldNumber: 6)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: EnvironmentalMeasurement, rhs: EnvironmentalMeasurement) -> Bool {
|
||||
if lhs.temperature != rhs.temperature {return false}
|
||||
if lhs.relativeHumidity != rhs.relativeHumidity {return false}
|
||||
if lhs.barometricPressure != rhs.barometricPressure {return false}
|
||||
if lhs.gasResistance != rhs.gasResistance {return false}
|
||||
if lhs.voltage != rhs.voltage {return false}
|
||||
if lhs.current != rhs.current {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -55,6 +55,10 @@ struct ServiceEnvelope {
|
|||
fileprivate var _packet: MeshPacket? = nil
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension ServiceEnvelope: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension ServiceEnvelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
@ -80,9 +84,13 @@ extension ServiceEnvelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
|
|||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if let v = self._packet {
|
||||
// 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 = self._packet {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
}
|
||||
} }()
|
||||
if !self.channelID.isEmpty {
|
||||
try visitor.visitSingularStringField(value: self.channelID, fieldNumber: 2)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,27 +61,27 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
|
||||
///
|
||||
/// The built-in position messaging app.
|
||||
/// Payload is a [Position](/developers/protobufs/api.md#position) message
|
||||
/// Payload is a [Position](/docs/developers/protobufs/api#position) message
|
||||
case positionApp // = 3
|
||||
|
||||
///
|
||||
/// The built-in user info app.
|
||||
/// Payload is a [User](/developers/protobufs/api.md#user) message
|
||||
/// Payload is a [User](/docs/developers/protobufs/api#user) message
|
||||
case nodeinfoApp // = 4
|
||||
|
||||
///
|
||||
/// Protocol control packets for mesh protocol use.
|
||||
/// Payload is a [Routing](/developers/protobufs/api.md#routing) message
|
||||
/// Payload is a [Routing](/docs/developers/protobufs/api#routing) message
|
||||
case routingApp // = 5
|
||||
|
||||
///
|
||||
/// Admin control packets.
|
||||
/// Payload is a [AdminMessage](/developers/protobufs/api.md#adminmessage) message
|
||||
/// Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message
|
||||
case adminApp // = 6
|
||||
|
||||
///
|
||||
/// Provides a 'ping' service that replies to any packet it receives.
|
||||
/// Also serves as a small example plugin.
|
||||
/// Also serves as a small example module.
|
||||
case replyApp // = 32
|
||||
|
||||
///
|
||||
|
|
@ -93,8 +93,7 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
/// Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
|
||||
/// network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network.
|
||||
/// Maximum packet size of 240 bytes.
|
||||
/// Plugin is disabled by default can be turned on by setting SERIALPLUGIN_ENABLED = 1 in SerialPlugh.cpp.
|
||||
/// Maintained by Jm Casler (MC Hamster) : jm@casler.org
|
||||
/// Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp.
|
||||
case serialApp // = 64
|
||||
|
||||
///
|
||||
|
|
@ -103,14 +102,13 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
case storeForwardApp // = 65
|
||||
|
||||
///
|
||||
/// STORE_FORWARD_APP (Work in Progress)
|
||||
/// Maintained by Jm Casler (MC Hamster) : jm@casler.org
|
||||
/// Optional port for messages for the range test module.
|
||||
case rangeTestApp // = 66
|
||||
|
||||
///
|
||||
/// Provides a format to send and receive environmental data from the Meshtastic network.
|
||||
/// Provides a format to send and receive telemetry data from the Meshtastic network.
|
||||
/// Maintained by Charles Crossan (crossan007) : crossan007@gmail.com
|
||||
case environmentalMeasurementApp // = 67
|
||||
case telemetryApp // = 67
|
||||
|
||||
///
|
||||
/// Experimental tools for estimating node position without a GPS
|
||||
|
|
@ -125,7 +123,7 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
case privateApp // = 256
|
||||
|
||||
///
|
||||
/// ATAK Forwarder Plugin https://github.com/paulmandal/atak-forwarder
|
||||
/// ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder
|
||||
case atakForwarder // = 257
|
||||
|
||||
///
|
||||
|
|
@ -151,7 +149,7 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
case 64: self = .serialApp
|
||||
case 65: self = .storeForwardApp
|
||||
case 66: self = .rangeTestApp
|
||||
case 67: self = .environmentalMeasurementApp
|
||||
case 67: self = .telemetryApp
|
||||
case 68: self = .zpsApp
|
||||
case 256: self = .privateApp
|
||||
case 257: self = .atakForwarder
|
||||
|
|
@ -174,7 +172,7 @@ enum PortNum: SwiftProtobuf.Enum {
|
|||
case .serialApp: return 64
|
||||
case .storeForwardApp: return 65
|
||||
case .rangeTestApp: return 66
|
||||
case .environmentalMeasurementApp: return 67
|
||||
case .telemetryApp: return 67
|
||||
case .zpsApp: return 68
|
||||
case .privateApp: return 256
|
||||
case .atakForwarder: return 257
|
||||
|
|
@ -202,7 +200,7 @@ extension PortNum: CaseIterable {
|
|||
.serialApp,
|
||||
.storeForwardApp,
|
||||
.rangeTestApp,
|
||||
.environmentalMeasurementApp,
|
||||
.telemetryApp,
|
||||
.zpsApp,
|
||||
.privateApp,
|
||||
.atakForwarder,
|
||||
|
|
@ -212,6 +210,10 @@ extension PortNum: CaseIterable {
|
|||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension PortNum: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension PortNum: SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
@ -228,7 +230,7 @@ extension PortNum: SwiftProtobuf._ProtoNameProviding {
|
|||
64: .same(proto: "SERIAL_APP"),
|
||||
65: .same(proto: "STORE_FORWARD_APP"),
|
||||
66: .same(proto: "RANGE_TEST_APP"),
|
||||
67: .same(proto: "ENVIRONMENTAL_MEASUREMENT_APP"),
|
||||
67: .same(proto: "TELEMETRY_APP"),
|
||||
68: .same(proto: "ZPS_APP"),
|
||||
256: .same(proto: "PRIVATE_APP"),
|
||||
257: .same(proto: "ATAK_FORWARDER"),
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -21,7 +21,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
}
|
||||
|
||||
///
|
||||
/// An example app to show off the plugin system. This message is used for
|
||||
/// An example app to show off the module system. This message is used for
|
||||
/// REMOTE_HARDWARE_APP PortNums.
|
||||
///
|
||||
/// Also provides easy remote access to any GPIO.
|
||||
|
|
@ -53,6 +53,8 @@ struct HardwareMessage {
|
|||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
enum TypeEnum: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
|
||||
|
|
@ -132,6 +134,11 @@ extension HardwareMessage.TypeEnum: CaseIterable {
|
|||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension HardwareMessage: @unchecked Sendable {}
|
||||
extension HardwareMessage.TypeEnum: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension HardwareMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
|
|||
|
|
@ -20,13 +20,19 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
typealias Version = _2
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
struct StoreAndForward {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var rr: StoreAndForward.RequestResponse = .unset
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var stats: StoreAndForward.Statistics {
|
||||
get {return _stats ?? StoreAndForward.Statistics()}
|
||||
set {_stats = newValue}
|
||||
|
|
@ -36,6 +42,8 @@ struct StoreAndForward {
|
|||
/// Clears the value of `stats`. Subsequent reads from it will return its default value.
|
||||
mutating func clearStats() {self._stats = nil}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var history: StoreAndForward.History {
|
||||
get {return _history ?? StoreAndForward.History()}
|
||||
set {_history = newValue}
|
||||
|
|
@ -45,6 +53,8 @@ struct StoreAndForward {
|
|||
/// Clears the value of `history`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHistory() {self._history = nil}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
var heartbeat: StoreAndForward.Heartbeat {
|
||||
get {return _heartbeat ?? StoreAndForward.Heartbeat()}
|
||||
set {_heartbeat = newValue}
|
||||
|
|
@ -161,6 +171,8 @@ struct StoreAndForward {
|
|||
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
struct Statistics {
|
||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
|
|
@ -207,6 +219,8 @@ struct StoreAndForward {
|
|||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
struct History {
|
||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
|
|
@ -229,6 +243,8 @@ struct StoreAndForward {
|
|||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// TODO: REPLACE
|
||||
struct Heartbeat {
|
||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
|
|
@ -277,6 +293,14 @@ extension StoreAndForward.RequestResponse: CaseIterable {
|
|||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension StoreAndForward: @unchecked Sendable {}
|
||||
extension StoreAndForward.RequestResponse: @unchecked Sendable {}
|
||||
extension StoreAndForward.Statistics: @unchecked Sendable {}
|
||||
extension StoreAndForward.History: @unchecked Sendable {}
|
||||
extension StoreAndForward.Heartbeat: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension StoreAndForward: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
|
|
@ -304,18 +328,22 @@ extension StoreAndForward: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
|
|||
}
|
||||
|
||||
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.rr != .unset {
|
||||
try visitor.visitSingularEnumField(value: self.rr, fieldNumber: 1)
|
||||
}
|
||||
if let v = self._stats {
|
||||
try { if let v = self._stats {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
}
|
||||
if let v = self._history {
|
||||
} }()
|
||||
try { if let v = self._history {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||
}
|
||||
if let v = self._heartbeat {
|
||||
} }()
|
||||
try { if let v = self._heartbeat {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
|
||||
}
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
|
|
|
|||
352
MeshtasticClient/Protobufs/telemetry.pb.swift
Normal file
352
MeshtasticClient/Protobufs/telemetry.pb.swift
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||
// Source: telemetry.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
|
||||
}
|
||||
|
||||
///
|
||||
/// Key native device metrics such as battery level
|
||||
struct DeviceMetrics {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// 1-100 (0 means powered)
|
||||
var batteryLevel: UInt32 = 0
|
||||
|
||||
///
|
||||
/// Voltage measured
|
||||
var voltage: Float = 0
|
||||
|
||||
///
|
||||
/// Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
|
||||
var channelUtilization: Float = 0
|
||||
|
||||
///
|
||||
/// Percent of airtime for transmission used within the last hour.
|
||||
var airUtilTx: Float = 0
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Weather station or other environmental metrics
|
||||
struct EnvironmentMetrics {
|
||||
// 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.
|
||||
|
||||
///
|
||||
/// Temperature measured
|
||||
var temperature: Float = 0
|
||||
|
||||
///
|
||||
/// Relative humidity percent measured
|
||||
var relativeHumidity: Float = 0
|
||||
|
||||
///
|
||||
/// Barometric pressure in hPA measured
|
||||
var barometricPressure: Float = 0
|
||||
|
||||
///
|
||||
/// Gas resistance in mOhm measured
|
||||
var gasResistance: Float = 0
|
||||
|
||||
///
|
||||
/// Voltage measured
|
||||
var voltage: Float = 0
|
||||
|
||||
///
|
||||
/// Current measured
|
||||
var current: Float = 0
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
///
|
||||
/// Types of Measurements the telemetry module is equipped to handle
|
||||
struct Telemetry {
|
||||
// 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 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 (IE Mobile Phone).
|
||||
/// seconds since 1970
|
||||
var time: UInt32 = 0
|
||||
|
||||
var variant: Telemetry.OneOf_Variant? = nil
|
||||
|
||||
///
|
||||
/// Key native device metrics such as battery level
|
||||
var deviceMetrics: DeviceMetrics {
|
||||
get {
|
||||
if case .deviceMetrics(let v)? = variant {return v}
|
||||
return DeviceMetrics()
|
||||
}
|
||||
set {variant = .deviceMetrics(newValue)}
|
||||
}
|
||||
|
||||
///
|
||||
/// Weather station or other environmental metrics
|
||||
var environmentMetrics: EnvironmentMetrics {
|
||||
get {
|
||||
if case .environmentMetrics(let v)? = variant {return v}
|
||||
return EnvironmentMetrics()
|
||||
}
|
||||
set {variant = .environmentMetrics(newValue)}
|
||||
}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
enum OneOf_Variant: Equatable {
|
||||
///
|
||||
/// Key native device metrics such as battery level
|
||||
case deviceMetrics(DeviceMetrics)
|
||||
///
|
||||
/// Weather station or other environmental metrics
|
||||
case environmentMetrics(EnvironmentMetrics)
|
||||
|
||||
#if !swift(>=4.1)
|
||||
static func ==(lhs: Telemetry.OneOf_Variant, rhs: Telemetry.OneOf_Variant) -> Bool {
|
||||
// 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 (lhs, rhs) {
|
||||
case (.deviceMetrics, .deviceMetrics): return {
|
||||
guard case .deviceMetrics(let l) = lhs, case .deviceMetrics(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
case (.environmentMetrics, .environmentMetrics): return {
|
||||
guard case .environmentMetrics(let l) = lhs, case .environmentMetrics(let r) = rhs else { preconditionFailure() }
|
||||
return l == r
|
||||
}()
|
||||
default: return false
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
init() {}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension DeviceMetrics: @unchecked Sendable {}
|
||||
extension EnvironmentMetrics: @unchecked Sendable {}
|
||||
extension Telemetry: @unchecked Sendable {}
|
||||
extension Telemetry.OneOf_Variant: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
extension DeviceMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "DeviceMetrics"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "battery_level"),
|
||||
2: .same(proto: "voltage"),
|
||||
3: .standard(proto: "channel_utilization"),
|
||||
4: .standard(proto: "air_util_tx"),
|
||||
]
|
||||
|
||||
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.batteryLevel) }()
|
||||
case 2: try { try decoder.decodeSingularFloatField(value: &self.voltage) }()
|
||||
case 3: try { try decoder.decodeSingularFloatField(value: &self.channelUtilization) }()
|
||||
case 4: try { try decoder.decodeSingularFloatField(value: &self.airUtilTx) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if self.batteryLevel != 0 {
|
||||
try visitor.visitSingularUInt32Field(value: self.batteryLevel, fieldNumber: 1)
|
||||
}
|
||||
if self.voltage != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.voltage, fieldNumber: 2)
|
||||
}
|
||||
if self.channelUtilization != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.channelUtilization, fieldNumber: 3)
|
||||
}
|
||||
if self.airUtilTx != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.airUtilTx, fieldNumber: 4)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: DeviceMetrics, rhs: DeviceMetrics) -> Bool {
|
||||
if lhs.batteryLevel != rhs.batteryLevel {return false}
|
||||
if lhs.voltage != rhs.voltage {return false}
|
||||
if lhs.channelUtilization != rhs.channelUtilization {return false}
|
||||
if lhs.airUtilTx != rhs.airUtilTx {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension EnvironmentMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "EnvironmentMetrics"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "temperature"),
|
||||
2: .standard(proto: "relative_humidity"),
|
||||
3: .standard(proto: "barometric_pressure"),
|
||||
4: .standard(proto: "gas_resistance"),
|
||||
5: .same(proto: "voltage"),
|
||||
6: .same(proto: "current"),
|
||||
]
|
||||
|
||||
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.decodeSingularFloatField(value: &self.temperature) }()
|
||||
case 2: try { try decoder.decodeSingularFloatField(value: &self.relativeHumidity) }()
|
||||
case 3: try { try decoder.decodeSingularFloatField(value: &self.barometricPressure) }()
|
||||
case 4: try { try decoder.decodeSingularFloatField(value: &self.gasResistance) }()
|
||||
case 5: try { try decoder.decodeSingularFloatField(value: &self.voltage) }()
|
||||
case 6: try { try decoder.decodeSingularFloatField(value: &self.current) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
if self.temperature != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.temperature, fieldNumber: 1)
|
||||
}
|
||||
if self.relativeHumidity != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.relativeHumidity, fieldNumber: 2)
|
||||
}
|
||||
if self.barometricPressure != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.barometricPressure, fieldNumber: 3)
|
||||
}
|
||||
if self.gasResistance != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.gasResistance, fieldNumber: 4)
|
||||
}
|
||||
if self.voltage != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.voltage, fieldNumber: 5)
|
||||
}
|
||||
if self.current != 0 {
|
||||
try visitor.visitSingularFloatField(value: self.current, fieldNumber: 6)
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: EnvironmentMetrics, rhs: EnvironmentMetrics) -> Bool {
|
||||
if lhs.temperature != rhs.temperature {return false}
|
||||
if lhs.relativeHumidity != rhs.relativeHumidity {return false}
|
||||
if lhs.barometricPressure != rhs.barometricPressure {return false}
|
||||
if lhs.gasResistance != rhs.gasResistance {return false}
|
||||
if lhs.voltage != rhs.voltage {return false}
|
||||
if lhs.current != rhs.current {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Telemetry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = "Telemetry"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "time"),
|
||||
2: .standard(proto: "device_metrics"),
|
||||
3: .standard(proto: "environment_metrics"),
|
||||
]
|
||||
|
||||
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.decodeSingularFixed32Field(value: &self.time) }()
|
||||
case 2: try {
|
||||
var v: DeviceMetrics?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .deviceMetrics(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .deviceMetrics(v)
|
||||
}
|
||||
}()
|
||||
case 3: try {
|
||||
var v: EnvironmentMetrics?
|
||||
var hadOneofValue = false
|
||||
if let current = self.variant {
|
||||
hadOneofValue = true
|
||||
if case .environmentMetrics(let m) = current {v = m}
|
||||
}
|
||||
try decoder.decodeSingularMessageField(value: &v)
|
||||
if let v = v {
|
||||
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||
self.variant = .environmentMetrics(v)
|
||||
}
|
||||
}()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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.time != 0 {
|
||||
try visitor.visitSingularFixed32Field(value: self.time, fieldNumber: 1)
|
||||
}
|
||||
switch self.variant {
|
||||
case .deviceMetrics?: try {
|
||||
guard case .deviceMetrics(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
}()
|
||||
case .environmentMetrics?: try {
|
||||
guard case .environmentMetrics(let v)? = self.variant else { preconditionFailure() }
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||
}()
|
||||
case nil: break
|
||||
}
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Telemetry, rhs: Telemetry) -> Bool {
|
||||
if lhs.time != rhs.time {return false}
|
||||
if lhs.variant != rhs.variant {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ fi
|
|||
pdir=$(realpath "../Meshtastic-protobufs")
|
||||
sdir=$(realpath "./MeshtasticClient/Protobufs")
|
||||
echo "pdir:$pdir sdir:$sdir"
|
||||
pfiles="admin.proto apponly.proto cannedmessages.proto channel.proto deviceonly.proto environmental_measurement.proto mesh.proto mqtt.proto portnums.proto radioconfig.proto remote_hardware.proto storeforward.proto"
|
||||
pfiles="admin.proto apponly.proto cannedmessages.proto channel.proto deviceonly.proto mesh.proto mqtt.proto portnums.proto radioconfig.proto remote_hardware.proto storeforward.proto telemetry.proto"
|
||||
for pf in $pfiles
|
||||
do
|
||||
echo "Generating $pf..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue