mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Proto updates, assorted fixes
This commit is contained in:
parent
674a458b8e
commit
25380b4140
5 changed files with 26 additions and 26 deletions
|
|
@ -29,7 +29,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
@Published var connectedPeripheral: Peripheral!
|
||||
@Published var lastConnectionError: String
|
||||
@Published var connectedVersion: String
|
||||
@State var connectedVersion: String
|
||||
|
||||
@Published var isSwitchedOn: Bool = false
|
||||
@Published var isScanning: Bool = false
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,6 @@ func routingPacket (packet: MeshPacket, meshLogging: Bool, context: NSManagedObj
|
|||
let nsError = error as NSError
|
||||
print("💥 Error Saving ACK for message MessageID \(packet.id) Error: \(nsError)")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ struct ModuleConfig {
|
|||
case `default` // = 0
|
||||
case simple // = 1
|
||||
case proto // = 2
|
||||
case textmsg // = 3
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
init() {
|
||||
|
|
@ -341,6 +342,7 @@ struct ModuleConfig {
|
|||
case 0: self = .default
|
||||
case 1: self = .simple
|
||||
case 2: self = .proto
|
||||
case 3: self = .textmsg
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -350,6 +352,7 @@ struct ModuleConfig {
|
|||
case .default: return 0
|
||||
case .simple: return 1
|
||||
case .proto: return 2
|
||||
case .textmsg: return 3
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
}
|
||||
|
|
@ -649,6 +652,7 @@ extension ModuleConfig.SerialConfig.Serial_Mode: CaseIterable {
|
|||
.default,
|
||||
.simple,
|
||||
.proto,
|
||||
.textmsg,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -1001,6 +1005,7 @@ extension ModuleConfig.SerialConfig.Serial_Mode: SwiftProtobuf._ProtoNameProvidi
|
|||
0: .same(proto: "DEFAULT"),
|
||||
1: .same(proto: "SIMPLE"),
|
||||
2: .same(proto: "PROTO"),
|
||||
3: .same(proto: "TEXTMSG"),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,12 @@ struct NodeDetail: View {
|
|||
@Environment(\.managedObjectContext) var context
|
||||
@EnvironmentObject var bleManager: BLEManager
|
||||
|
||||
@State private var showingDetailsPopover = false
|
||||
|
||||
@State var initialLoad: Bool = true
|
||||
@State var satsInView = 0
|
||||
@State private var isPresentingShutdownConfirm: Bool = false
|
||||
@State private var isPresentingRebootConfirm: Bool = false
|
||||
@State private var showingShutdownConfirm: Bool = false
|
||||
@State private var showingRebootConfirm: Bool = false
|
||||
|
||||
var node: NodeInfoEntity
|
||||
|
||||
|
|
@ -79,15 +81,14 @@ struct NodeDetail: View {
|
|||
ScrollView {
|
||||
|
||||
if self.bleManager.connectedPeripheral != nil && self.bleManager.connectedPeripheral.num == node.num && self.bleManager.connectedPeripheral.num == node.num {
|
||||
|
||||
Divider()
|
||||
|
||||
HStack {
|
||||
|
||||
if hwModelString == "TBEAM" || hwModelString == "TECHO" || hwModelString.contains("4631") {
|
||||
|
||||
Button(action: {
|
||||
|
||||
isPresentingShutdownConfirm = true
|
||||
showingShutdownConfirm = true
|
||||
}) {
|
||||
|
||||
Label("Power Off", systemImage: "power")
|
||||
|
|
@ -98,7 +99,7 @@ struct NodeDetail: View {
|
|||
.padding()
|
||||
.confirmationDialog(
|
||||
"Are you sure?",
|
||||
isPresented: $isPresentingShutdownConfirm
|
||||
isPresented: $showingShutdownConfirm
|
||||
) {
|
||||
Button("Shutdown Node?", role: .destructive) {
|
||||
|
||||
|
|
@ -112,7 +113,7 @@ struct NodeDetail: View {
|
|||
|
||||
Button(action: {
|
||||
|
||||
isPresentingRebootConfirm = true
|
||||
showingRebootConfirm = true
|
||||
|
||||
}) {
|
||||
|
||||
|
|
@ -125,7 +126,7 @@ struct NodeDetail: View {
|
|||
.confirmationDialog(
|
||||
|
||||
"Are you sure?",
|
||||
isPresented: $isPresentingRebootConfirm
|
||||
isPresented: $showingRebootConfirm
|
||||
) {
|
||||
|
||||
Button("Reboot Node?", role: .destructive) {
|
||||
|
|
@ -140,18 +141,10 @@ struct NodeDetail: View {
|
|||
.padding(5)
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
|
||||
|
||||
// Add a divider if there is no map
|
||||
if (node.positions?.count ?? 0) == 0 {
|
||||
|
||||
Divider()
|
||||
}
|
||||
Image(hwModelString)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.frame(width: 200, height: 200)
|
||||
.cornerRadius(5)
|
||||
|
||||
|
||||
HStack {
|
||||
|
||||
|
|
@ -229,10 +222,15 @@ struct NodeDetail: View {
|
|||
}
|
||||
.padding()
|
||||
}
|
||||
Divider()
|
||||
|
||||
}
|
||||
.padding()
|
||||
.onLongPressGesture(minimumDuration: 2) {
|
||||
|
||||
print("Long pressed!")
|
||||
}
|
||||
|
||||
Divider()
|
||||
HStack(alignment: .center) {
|
||||
|
||||
VStack {
|
||||
|
|
@ -364,8 +362,6 @@ struct NodeDetail: View {
|
|||
}
|
||||
.padding(4)
|
||||
|
||||
Divider()
|
||||
|
||||
HStack(alignment: .center) {
|
||||
VStack {
|
||||
HStack {
|
||||
|
|
@ -406,7 +402,6 @@ struct NodeDetail: View {
|
|||
|
||||
if (node.positions?.count ?? 0) > 0 {
|
||||
|
||||
Divider()
|
||||
NavigationLink {
|
||||
PositionLog(node: node)
|
||||
} label: {
|
||||
|
|
@ -419,11 +414,11 @@ struct NodeDetail: View {
|
|||
.font(.title3)
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
Divider()
|
||||
}
|
||||
|
||||
if (node.telemetries?.count ?? 0) > 0 {
|
||||
|
||||
Divider()
|
||||
NavigationLink {
|
||||
DeviceMetricsLog(node: node)
|
||||
} label: {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ struct LoRaConfig: View {
|
|||
lc.hopLimit = UInt32(hopLimit)
|
||||
lc.region = RegionCodes(rawValue: region)!.protoEnumValue()
|
||||
lc.modemPreset = ModemPresets(rawValue: modemPreset)!.protoEnumValue()
|
||||
lc.txEnabled = true
|
||||
|
||||
let adminMessageId = bleManager.saveLoRaConfig(config: lc, fromUser: node!.user!, toUser: node!.user!)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue