mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove serial
This commit is contained in:
parent
d477de80c2
commit
26e917df48
4 changed files with 16 additions and 26 deletions
|
|
@ -18945,9 +18945,6 @@
|
|||
},
|
||||
"Select a Trace Route" : {
|
||||
|
||||
},
|
||||
"Select something to view" : {
|
||||
|
||||
},
|
||||
"select.contact" : {
|
||||
"extractionState" : "manual",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
<attribute name="rebroadcastMode" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="role" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="serialEnabled" optional="YES" attributeType="Boolean" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="tripleClickAsAdHocPing" optional="YES" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||
<attribute name="tzdef" optional="YES" attributeType="String"/>
|
||||
<relationship name="deviceConfigNode" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="NodeInfoEntity" inverseName="deviceConfig" inverseEntity="NodeInfoEntity"/>
|
||||
</entity>
|
||||
|
|
|
|||
|
|
@ -462,24 +462,24 @@ func upsertDeviceConfigPacket(config: Config.DeviceConfig, nodeNum: Int64, sessi
|
|||
if fetchedNode[0].deviceConfig == nil {
|
||||
let newDeviceConfig = DeviceConfigEntity(context: context)
|
||||
newDeviceConfig.role = Int32(config.role.rawValue)
|
||||
newDeviceConfig.serialEnabled = config.serialEnabled
|
||||
newDeviceConfig.buttonGpio = Int32(config.buttonGpio)
|
||||
newDeviceConfig.buzzerGpio = Int32(config.buzzerGpio)
|
||||
newDeviceConfig.rebroadcastMode = Int32(config.rebroadcastMode.rawValue)
|
||||
newDeviceConfig.nodeInfoBroadcastSecs = Int32(truncating: config.nodeInfoBroadcastSecs as NSNumber)
|
||||
newDeviceConfig.doubleTapAsButtonPress = config.doubleTapAsButtonPress
|
||||
newDeviceConfig.tripleClickAsAdHocPing = !config.disableTripleClick
|
||||
newDeviceConfig.ledHeartbeatEnabled = !config.ledHeartbeatDisabled
|
||||
newDeviceConfig.isManaged = config.isManaged
|
||||
newDeviceConfig.tzdef = config.tzdef
|
||||
fetchedNode[0].deviceConfig = newDeviceConfig
|
||||
} else {
|
||||
fetchedNode[0].deviceConfig?.role = Int32(config.role.rawValue)
|
||||
fetchedNode[0].deviceConfig?.serialEnabled = config.serialEnabled
|
||||
fetchedNode[0].deviceConfig?.buttonGpio = Int32(config.buttonGpio)
|
||||
fetchedNode[0].deviceConfig?.buzzerGpio = Int32(config.buzzerGpio)
|
||||
fetchedNode[0].deviceConfig?.rebroadcastMode = Int32(config.rebroadcastMode.rawValue)
|
||||
fetchedNode[0].deviceConfig?.nodeInfoBroadcastSecs = Int32(truncating: config.nodeInfoBroadcastSecs as NSNumber)
|
||||
fetchedNode[0].deviceConfig?.doubleTapAsButtonPress = config.doubleTapAsButtonPress
|
||||
fetchedNode[0].deviceConfig?.tripleClickAsAdHocPing = !config.disableTripleClick
|
||||
fetchedNode[0].deviceConfig?.ledHeartbeatEnabled = !config.ledHeartbeatDisabled
|
||||
fetchedNode[0].deviceConfig?.isManaged = config.isManaged
|
||||
fetchedNode[0].deviceConfig?.tzdef = config.tzdef
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ struct DeviceConfig: View {
|
|||
@State var deviceRole = 0
|
||||
@State var buzzerGPIO = 0
|
||||
@State var buttonGPIO = 0
|
||||
@State var serialEnabled = true
|
||||
@State var rebroadcastMode = 0
|
||||
@State var nodeInfoBroadcastSecs = 10800
|
||||
@State var doubleTapAsButtonPress = false
|
||||
|
|
@ -77,7 +76,7 @@ struct DeviceConfig: View {
|
|||
Text("Treat double tap on supported accelerometers as a user button press.")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
|
||||
|
||||
Toggle(isOn: $tripleClickAsAdHocPing) {
|
||||
Label("Triple Click Ad Hoc Ping", systemImage: "map.pin")
|
||||
Text("Send a position on the primary channel when the user button is triple clicked.")
|
||||
|
|
@ -91,10 +90,6 @@ struct DeviceConfig: View {
|
|||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
}
|
||||
Section(header: Text("Debug")) {
|
||||
Toggle(isOn: $serialEnabled) {
|
||||
Label("Serial Console", systemImage: "terminal")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
VStack(alignment: .leading) {
|
||||
HStack {
|
||||
Label("Time Zone", systemImage: "clock.badge.exclamationmark")
|
||||
|
|
@ -114,7 +109,7 @@ struct DeviceConfig: View {
|
|||
.disableAutocorrection(true)
|
||||
Text("Time zone for dates on the device screen and log.")
|
||||
.foregroundColor(.gray)
|
||||
.font(.callout)
|
||||
.font(.callout)
|
||||
}
|
||||
}
|
||||
Section(header: Text("GPIO")) {
|
||||
|
|
@ -201,12 +196,12 @@ struct DeviceConfig: View {
|
|||
if connectedNode != nil {
|
||||
var dc = Config.DeviceConfig()
|
||||
dc.role = DeviceRoles(rawValue: deviceRole)!.protoEnumValue()
|
||||
dc.serialEnabled = serialEnabled
|
||||
dc.buttonGpio = UInt32(buttonGPIO)
|
||||
dc.buzzerGpio = UInt32(buzzerGPIO)
|
||||
dc.rebroadcastMode = RebroadcastModes(rawValue: rebroadcastMode)?.protoEnumValue() ?? RebroadcastModes.all.protoEnumValue()
|
||||
dc.nodeInfoBroadcastSecs = UInt32(nodeInfoBroadcastSecs)
|
||||
dc.doubleTapAsButtonPress = doubleTapAsButtonPress
|
||||
dc.disableTripleClick = !tripleClickAsAdHocPing
|
||||
dc.tzdef = tzdef
|
||||
dc.ledHeartbeatDisabled = !ledHeartbeatEnabled
|
||||
let adminMessageId = bleManager.saveDeviceConfig(config: dc, fromUser: connectedNode!.user!, toUser: node!.user!, adminIndex: connectedNode?.myInfo?.adminIndex ?? 0)
|
||||
|
|
@ -254,20 +249,17 @@ struct DeviceConfig: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.onChange(of: deviceRole) {
|
||||
if $0 != node?.deviceConfig?.role ?? -1 { hasChanges = true }
|
||||
.onChange(of: deviceRole) { oldRole, newRole in
|
||||
if oldRole != newRole && newRole != node?.deviceConfig?.role ?? -1 { hasChanges = true }
|
||||
}
|
||||
.onChange(of: serialEnabled) {
|
||||
if $0 != node?.deviceConfig?.serialEnabled { hasChanges = true }
|
||||
.onChange(of: buttonGPIO) { oldButtonGPIO, newButtonGPIO in
|
||||
if oldButtonGPIO != newButtonGPIO && newButtonGPIO != node?.deviceConfig?.buttonGpio ?? -1 { hasChanges = true }
|
||||
}
|
||||
.onChange(of: buttonGPIO) { newButtonGPIO in
|
||||
if newButtonGPIO != node?.deviceConfig?.buttonGpio ?? -1 { hasChanges = true }
|
||||
.onChange(of: buzzerGPIO) { oldBuzzerGPIO, newBuzzerGPIO in
|
||||
if oldBuzzerGPIO != newBuzzerGPIO && newBuzzerGPIO != node?.deviceConfig?.buzzerGpio ?? -1 { hasChanges = true }
|
||||
}
|
||||
.onChange(of: buzzerGPIO) { newBuzzerGPIO in
|
||||
if newBuzzerGPIO != node?.deviceConfig?.buttonGpio ?? -1 { hasChanges = true }
|
||||
}
|
||||
.onChange(of: rebroadcastMode) { newRebroadcastMode in
|
||||
if newRebroadcastMode != node?.deviceConfig?.rebroadcastMode ?? -1 { hasChanges = true }
|
||||
.onChange(of: rebroadcastMode) { oldRebroadcastMode, newRebroadcastMode in
|
||||
if oldRebroadcastMode != newRebroadcastMode && newRebroadcastMode != node?.deviceConfig?.rebroadcastMode ?? -1 { hasChanges = true }
|
||||
}
|
||||
.onChange(of: nodeInfoBroadcastSecs) { newNodeInfoBroadcastSecs in
|
||||
if newNodeInfoBroadcastSecs != node?.deviceConfig?.nodeInfoBroadcastSecs ?? -1 { hasChanges = true }
|
||||
|
|
@ -276,7 +268,7 @@ struct DeviceConfig: View {
|
|||
if $0 != node?.deviceConfig?.doubleTapAsButtonPress { hasChanges = true }
|
||||
}
|
||||
.onChange(of: tripleClickAsAdHocPing) {
|
||||
// if $0 != node?.deviceConfig?.tripleClickAsAdHocPing { hasChanges = true }
|
||||
if $0 != node?.deviceConfig?.tripleClickAsAdHocPing { hasChanges = true }
|
||||
}
|
||||
.onChange(of: tzdef) { newTzdef in
|
||||
if newTzdef != node?.deviceConfig?.tzdef { hasChanges = true }
|
||||
|
|
@ -289,7 +281,6 @@ struct DeviceConfig: View {
|
|||
}
|
||||
func setDeviceValues() {
|
||||
self.deviceRole = Int(node?.deviceConfig?.role ?? 0)
|
||||
self.serialEnabled = (node?.deviceConfig?.serialEnabled ?? true)
|
||||
self.buttonGPIO = Int(node?.deviceConfig?.buttonGpio ?? 0)
|
||||
self.buzzerGPIO = Int(node?.deviceConfig?.buzzerGpio ?? 0)
|
||||
self.rebroadcastMode = Int(node?.deviceConfig?.rebroadcastMode ?? 0)
|
||||
|
|
@ -298,6 +289,7 @@ struct DeviceConfig: View {
|
|||
nodeInfoBroadcastSecs = 3600
|
||||
}
|
||||
self.doubleTapAsButtonPress = node?.deviceConfig?.doubleTapAsButtonPress ?? false
|
||||
self.tripleClickAsAdHocPing = node?.deviceConfig?.tripleClickAsAdHocPing ?? false
|
||||
self.ledHeartbeatEnabled = node?.deviceConfig?.ledHeartbeatEnabled ?? true
|
||||
self.tzdef = node?.deviceConfig?.tzdef ?? ""
|
||||
if self.tzdef.isEmpty {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue