mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Check for admin channel on settings drop down, hide catalyst map controls that don't work
This commit is contained in:
parent
b6abd92543
commit
9922e19fce
6 changed files with 39 additions and 9 deletions
|
|
@ -123,9 +123,6 @@ extension UserDefaults {
|
|||
UserDefaults.standard.set(newValue, forKey: "enableMapPointsOfInterest")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static var enableOfflineMaps: Bool {
|
||||
get {
|
||||
UserDefaults.standard.bool(forKey: "enableOfflineMaps")
|
||||
|
|
|
|||
|
|
@ -144,6 +144,9 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
func disconnectPeripheral(reconnect: Bool = true) {
|
||||
|
||||
guard let connectedPeripheral = connectedPeripheral else { return }
|
||||
if mqttProxyConnected {
|
||||
mqttManager.mqttClientProxy?.disconnect()
|
||||
}
|
||||
automaticallyReconnect = reconnect
|
||||
centralManager?.cancelPeripheralConnection(connectedPeripheral.peripheral)
|
||||
FROMRADIO_characteristic = nil
|
||||
|
|
@ -789,7 +792,14 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
meshPacket.from = fromNodeNum
|
||||
meshPacket.wantAck = true
|
||||
var dataMessage = DataMessage()
|
||||
dataMessage.payload = try! waypoint.serializedData()
|
||||
do {
|
||||
dataMessage.payload = try waypoint.serializedData()
|
||||
}
|
||||
catch {
|
||||
// Could not serialiaze the payload
|
||||
return false
|
||||
}
|
||||
|
||||
dataMessage.portnum = PortNum.waypointApp
|
||||
meshPacket.decoded = dataMessage
|
||||
var toRadio: ToRadio!
|
||||
|
|
|
|||
|
|
@ -237,6 +237,13 @@ struct Config {
|
|||
/// When used in conjunction with power.is_power_saving = true, nodes will wake up,
|
||||
/// send environment telemetry, and then sleep for telemetry.environment_update_interval seconds.
|
||||
case sensor // = 6
|
||||
|
||||
///
|
||||
/// TAK device role
|
||||
/// Used for nodes dedicated for connection to an ATAK EUD.
|
||||
/// Turns off many of the routine broadcasts to favor CoT packet stream
|
||||
/// from the Meshtastic ATAK plugin -> IMeshService -> Node
|
||||
case tak // = 7
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
init() {
|
||||
|
|
@ -252,6 +259,7 @@ struct Config {
|
|||
case 4: self = .repeater
|
||||
case 5: self = .tracker
|
||||
case 6: self = .sensor
|
||||
case 7: self = .tak
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -265,6 +273,7 @@ struct Config {
|
|||
case .repeater: return 4
|
||||
case .tracker: return 5
|
||||
case .sensor: return 6
|
||||
case .tak: return 7
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
}
|
||||
|
|
@ -1285,6 +1294,7 @@ extension Config.DeviceConfig.Role: CaseIterable {
|
|||
.repeater,
|
||||
.tracker,
|
||||
.sensor,
|
||||
.tak,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -1692,6 +1702,7 @@ extension Config.DeviceConfig.Role: SwiftProtobuf._ProtoNameProviding {
|
|||
4: .same(proto: "REPEATER"),
|
||||
5: .same(proto: "TRACKER"),
|
||||
6: .same(proto: "SENSOR"),
|
||||
7: .same(proto: "TAK"),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,6 +208,10 @@ enum HardwareModel: SwiftProtobuf.Enum {
|
|||
/// Heltec HT-CT62 with ESP32-C3 CPU and SX1262 LoRa
|
||||
case heltecHt62 // = 53
|
||||
|
||||
///
|
||||
/// EBYTE SPI LoRa module and ESP32-S3
|
||||
case ebyteEsp32S3 // = 54
|
||||
|
||||
///
|
||||
/// ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
/// Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
||||
|
|
@ -265,6 +269,7 @@ enum HardwareModel: SwiftProtobuf.Enum {
|
|||
case 51: self = .tWatchS3
|
||||
case 52: self = .picomputerS3
|
||||
case 53: self = .heltecHt62
|
||||
case 54: self = .ebyteEsp32S3
|
||||
case 255: self = .privateHw
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
|
|
@ -316,6 +321,7 @@ enum HardwareModel: SwiftProtobuf.Enum {
|
|||
case .tWatchS3: return 51
|
||||
case .picomputerS3: return 52
|
||||
case .heltecHt62: return 53
|
||||
case .ebyteEsp32S3: return 54
|
||||
case .privateHw: return 255
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
|
|
@ -372,6 +378,7 @@ extension HardwareModel: CaseIterable {
|
|||
.tWatchS3,
|
||||
.picomputerS3,
|
||||
.heltecHt62,
|
||||
.ebyteEsp32S3,
|
||||
.privateHw,
|
||||
]
|
||||
}
|
||||
|
|
@ -2534,6 +2541,7 @@ extension HardwareModel: SwiftProtobuf._ProtoNameProviding {
|
|||
51: .same(proto: "T_WATCH_S3"),
|
||||
52: .same(proto: "PICOMPUTER_S3"),
|
||||
53: .same(proto: "HELTEC_HT62"),
|
||||
54: .same(proto: "EBYTE_ESP32_S3"),
|
||||
255: .same(proto: "PRIVATE_HW"),
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,10 +353,11 @@ struct NodeMapSwiftUI: View {
|
|||
}
|
||||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
MapZoomStepper(scope: mapScope)
|
||||
.mapControlVisibility(.visible)
|
||||
MapPitchSlider(scope: mapScope)
|
||||
.mapControlVisibility(.visible)
|
||||
/// Hide non fuctional catalyst controls
|
||||
// MapZoomStepper(scope: mapScope)
|
||||
// .mapControlVisibility(.visible)
|
||||
// MapPitchSlider(scope: mapScope)
|
||||
// .mapControlVisibility(.visible)
|
||||
#endif
|
||||
}
|
||||
.controlSize(.regular)
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ struct Settings: View {
|
|||
}
|
||||
.tag(SettingsSidebar.appSettings)
|
||||
let node = nodes.first(where: { $0.num == connectedNodeNum })
|
||||
let hasAdmin = node?.myInfo?.adminIndex ?? 0 > 0 ? true : false
|
||||
|
||||
|
||||
if !(node?.deviceConfig?.isManaged ?? false) {
|
||||
Section("Configure") {
|
||||
Picker("Configuring Node", selection: $selectedNode) {
|
||||
|
|
@ -72,7 +75,7 @@ struct Settings: View {
|
|||
} else if node.metadata != nil {
|
||||
Text("Remote Config: \(node.user?.longName ?? "unknown".localized)")
|
||||
.tag(Int(node.num))
|
||||
} else {
|
||||
} else if hasAdmin {
|
||||
Text("Request Admin: \(node.user?.longName ?? "unknown".localized)")
|
||||
.tag(Int(node.num))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue