From 8befd33bceb0a9c489bad1eac7c136499354e4e2 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 18 Oct 2022 06:20:13 -0700 Subject: [PATCH] Proto updates --- Meshtastic/Enums/LoraConfigEnums.swift | 5 +++++ Meshtastic/Enums/SerialConfigEnums.swift | 5 +++++ Meshtastic/Protobufs/config.pb.swift | 8 ++++++++ Meshtastic/Protobufs/module_config.pb.swift | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/Meshtastic/Enums/LoraConfigEnums.swift b/Meshtastic/Enums/LoraConfigEnums.swift index 572b4570..1da71b0d 100644 --- a/Meshtastic/Enums/LoraConfigEnums.swift +++ b/Meshtastic/Enums/LoraConfigEnums.swift @@ -22,6 +22,7 @@ enum RegionCodes : Int, CaseIterable, Identifiable { case `in` = 10 case nz865 = 11 case th = 12 + case lora24 = 13 var id: Int { self.rawValue } var description: String { @@ -53,6 +54,8 @@ enum RegionCodes : Int, CaseIterable, Identifiable { return "New Zealand 865mhz" case .th: return "Thailand" + case .lora24: + return "2.4 GHZ" } } } @@ -87,6 +90,8 @@ enum RegionCodes : Int, CaseIterable, Identifiable { return Config.LoRaConfig.RegionCode.nz865 case .th: return Config.LoRaConfig.RegionCode.th + case .lora24: + return Config.LoRaConfig.RegionCode.lora24 } } } diff --git a/Meshtastic/Enums/SerialConfigEnums.swift b/Meshtastic/Enums/SerialConfigEnums.swift index 4b27c5a0..81e4d5b6 100644 --- a/Meshtastic/Enums/SerialConfigEnums.swift +++ b/Meshtastic/Enums/SerialConfigEnums.swift @@ -111,6 +111,7 @@ enum SerialModeTypes: Int, CaseIterable, Identifiable { case simple = 1 case proto = 2 case txtmsg = 3 + case nmea = 4 var id: Int { self.rawValue } var description: String { @@ -124,6 +125,8 @@ enum SerialModeTypes: Int, CaseIterable, Identifiable { return "Protobufs" case .txtmsg: return "Text Message" + case .nmea: + return "NMEA Positions" } } } @@ -139,6 +142,8 @@ enum SerialModeTypes: Int, CaseIterable, Identifiable { return ModuleConfig.SerialConfig.Serial_Mode.proto case .txtmsg: return ModuleConfig.SerialConfig.Serial_Mode.textmsg + case .nmea: + return ModuleConfig.SerialConfig.Serial_Mode.nmea } } } diff --git a/Meshtastic/Protobufs/config.pb.swift b/Meshtastic/Protobufs/config.pb.swift index 97e28992..d6942ade 100644 --- a/Meshtastic/Protobufs/config.pb.swift +++ b/Meshtastic/Protobufs/config.pb.swift @@ -777,6 +777,10 @@ struct Config { /// /// Thailand case th // = 12 + + /// + /// WLAN Band + case lora24 // = 13 case UNRECOGNIZED(Int) init() { @@ -798,6 +802,7 @@ struct Config { case 10: self = .in case 11: self = .nz865 case 12: self = .th + case 13: self = .lora24 default: self = .UNRECOGNIZED(rawValue) } } @@ -817,6 +822,7 @@ struct Config { case .in: return 10 case .nz865: return 11 case .th: return 12 + case .lora24: return 13 case .UNRECOGNIZED(let i): return i } } @@ -1032,6 +1038,7 @@ extension Config.LoRaConfig.RegionCode: CaseIterable { .in, .nz865, .th, + .lora24, ] } @@ -1709,6 +1716,7 @@ extension Config.LoRaConfig.RegionCode: SwiftProtobuf._ProtoNameProviding { 10: .same(proto: "IN"), 11: .same(proto: "NZ_865"), 12: .same(proto: "TH"), + 13: .same(proto: "LORA_24"), ] } diff --git a/Meshtastic/Protobufs/module_config.pb.swift b/Meshtastic/Protobufs/module_config.pb.swift index 832dc69a..ca381640 100644 --- a/Meshtastic/Protobufs/module_config.pb.swift +++ b/Meshtastic/Protobufs/module_config.pb.swift @@ -331,6 +331,7 @@ struct ModuleConfig { case simple // = 1 case proto // = 2 case textmsg // = 3 + case nmea // = 4 case UNRECOGNIZED(Int) init() { @@ -343,6 +344,7 @@ struct ModuleConfig { case 1: self = .simple case 2: self = .proto case 3: self = .textmsg + case 4: self = .nmea default: self = .UNRECOGNIZED(rawValue) } } @@ -353,6 +355,7 @@ struct ModuleConfig { case .simple: return 1 case .proto: return 2 case .textmsg: return 3 + case .nmea: return 4 case .UNRECOGNIZED(let i): return i } } @@ -653,6 +656,7 @@ extension ModuleConfig.SerialConfig.Serial_Mode: CaseIterable { .simple, .proto, .textmsg, + .nmea, ] } @@ -1006,6 +1010,7 @@ extension ModuleConfig.SerialConfig.Serial_Mode: SwiftProtobuf._ProtoNameProvidi 1: .same(proto: "SIMPLE"), 2: .same(proto: "PROTO"), 3: .same(proto: "TEXTMSG"), + 4: .same(proto: "NMEA"), ] }