mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove wifi mode
This commit is contained in:
parent
d157cc8d08
commit
8e3a438dbe
4 changed files with 1 additions and 59 deletions
|
|
@ -86,7 +86,6 @@
|
|||
DDB6ABE228B13FB500384BA1 /* PositionConfigEnums.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB6ABE128B13FB500384BA1 /* PositionConfigEnums.swift */; };
|
||||
DDB6ABE428B13FFF00384BA1 /* DisplayEnums.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB6ABE328B13FFF00384BA1 /* DisplayEnums.swift */; };
|
||||
DDB6ABE628B1406100384BA1 /* LoraConfigEnums.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB6ABE528B1406100384BA1 /* LoraConfigEnums.swift */; };
|
||||
DDB6ABE828B141AF00384BA1 /* WiFiModes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB6ABE728B141AF00384BA1 /* WiFiModes.swift */; };
|
||||
DDC2E15826CE248E0042C5E4 /* MeshtasticApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E15726CE248E0042C5E4 /* MeshtasticApp.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 */; };
|
||||
|
|
@ -199,7 +198,6 @@
|
|||
DDB6ABE128B13FB500384BA1 /* PositionConfigEnums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PositionConfigEnums.swift; sourceTree = "<group>"; };
|
||||
DDB6ABE328B13FFF00384BA1 /* DisplayEnums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayEnums.swift; sourceTree = "<group>"; };
|
||||
DDB6ABE528B1406100384BA1 /* LoraConfigEnums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoraConfigEnums.swift; sourceTree = "<group>"; };
|
||||
DDB6ABE728B141AF00384BA1 /* WiFiModes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WiFiModes.swift; sourceTree = "<group>"; };
|
||||
DDC2E15426CE248E0042C5E4 /* Meshtastic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Meshtastic.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DDC2E15726CE248E0042C5E4 /* MeshtasticApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticApp.swift; sourceTree = "<group>"; };
|
||||
DDC2E15B26CE248F0042C5E4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ../Assets.xcassets; sourceTree = "<group>"; };
|
||||
|
|
@ -352,7 +350,6 @@
|
|||
DDB6ABE128B13FB500384BA1 /* PositionConfigEnums.swift */,
|
||||
DD8ED9C7289CE4B900B3B0AB /* RoutingError.swift */,
|
||||
DDB6ABE328B13FFF00384BA1 /* DisplayEnums.swift */,
|
||||
DDB6ABE728B141AF00384BA1 /* WiFiModes.swift */,
|
||||
DD1925B628CDA5A400720036 /* CannedMessagesConfigEnums.swift */,
|
||||
DD1925B828CDA93900720036 /* SerialConfigEnums.swift */,
|
||||
DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */,
|
||||
|
|
@ -708,7 +705,6 @@
|
|||
DD5394FE276BA0EF00AD86B1 /* PositionEntityExtension.swift in Sources */,
|
||||
DD913639270DFF4C00D7ACF3 /* LocalNotificationManager.swift in Sources */,
|
||||
DD4C158C2824A91E0032668E /* module_config.pb.swift in Sources */,
|
||||
DDB6ABE828B141AF00384BA1 /* WiFiModes.swift in Sources */,
|
||||
DD4F23CD28779A3C001D37CB /* EnvironmentMetricsLog.swift in Sources */,
|
||||
DDB6ABD628AE742000384BA1 /* BluetoothConfig.swift in Sources */,
|
||||
DD769E0328D18BF1001A3F05 /* DeviceMetricsLog.swift in Sources */,
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
//
|
||||
// WiFiModes.swift
|
||||
// Meshtastic
|
||||
//
|
||||
// Copyright(c) Garth Vander Houwen 8/20/22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum WiFiModes: Int, CaseIterable, Identifiable {
|
||||
|
||||
case client = 0
|
||||
case accessPoint = 1
|
||||
case accessPointHidden = 2
|
||||
|
||||
var id: Int { self.rawValue }
|
||||
var description: String {
|
||||
get {
|
||||
switch self {
|
||||
case .client:
|
||||
return "Client"
|
||||
case .accessPoint:
|
||||
return "Software Access Point"
|
||||
case .accessPointHidden:
|
||||
return "Software Access Point (Hidden)"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
func protoEnumValue() -> Config.NetworkConfig.WiFiMode {
|
||||
|
||||
switch self {
|
||||
|
||||
case .client:
|
||||
return Config.NetworkConfig.WiFiMode.client
|
||||
case .accessPoint:
|
||||
return Config.NetworkConfig.WiFiMode.accessPoint
|
||||
case .accessPointHidden:
|
||||
return Config.NetworkConfig.WiFiMode.accessPointHidden
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -242,15 +242,12 @@ func localConfig (config: Config, context:NSManagedObjectContext, nodeNum: Int64
|
|||
|
||||
newNetworkConfig.wifiSsid = config.network.wifiSsid
|
||||
newNetworkConfig.wifiPsk = config.network.wifiPsk
|
||||
newNetworkConfig.wifiMode = Int32(config.network.wifiMode.rawValue)
|
||||
|
||||
fetchedNode[0].networkConfig = newNetworkConfig
|
||||
|
||||
} else {
|
||||
|
||||
fetchedNode[0].networkConfig?.wifiSsid = config.network.wifiSsid
|
||||
fetchedNode[0].networkConfig?.wifiPsk = config.network.wifiPsk
|
||||
fetchedNode[0].networkConfig?.wifiMode = Int32(config.network.wifiMode.rawValue)
|
||||
}
|
||||
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -34,21 +34,13 @@ struct NetworkConfig: View {
|
|||
|
||||
Text("Enabling WiFi will disable the bluetooth connection to the app.")
|
||||
.font(.title3)
|
||||
|
||||
|
||||
Toggle(isOn: $wifiEnabled) {
|
||||
|
||||
Label("Enabled", systemImage: "wifi")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
|
||||
|
||||
Picker("Mode", selection: $wifiMode ) {
|
||||
ForEach(WiFiModes.allCases) { lu in
|
||||
Text(lu.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
|
||||
HStack {
|
||||
Label("SSID", systemImage: "network")
|
||||
TextField("SSID", text: $wifiSsid)
|
||||
|
|
@ -132,7 +124,6 @@ struct NetworkConfig: View {
|
|||
network.wifiEnabled = self.wifiEnabled
|
||||
network.wifiSsid = self.wifiSsid
|
||||
network.wifiPsk = self.wifiPsk
|
||||
network.wifiMode = WiFiModes(rawValue: self.wifiMode)?.protoEnumValue() ?? WiFiModes.client.protoEnumValue()
|
||||
|
||||
let adminMessageId = bleManager.saveWiFiConfig(config: network, fromUser: node!.user!, toUser: node!.user!)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue