mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Put GPS setting in the right place
This commit is contained in:
parent
60eb3a0b05
commit
a60228d119
4 changed files with 23 additions and 20 deletions
|
|
@ -64,7 +64,6 @@
|
|||
<attribute name="debugLogEnabled" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="disableTripleClick" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="doubleTapAsButtonPress" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="gpsEnGpio" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="isManaged" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<attribute name="nodeInfoBroadcastSecs" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="rebroadcastMode" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
|
|
@ -263,6 +262,7 @@
|
|||
<attribute name="deviceGpsEnabled" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="fixedPosition" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="gpsAttemptTime" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="gpsEnGpio" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="gpsUpdateInterval" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="positionBroadcastSeconds" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="positionFlags" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
|
|
|
|||
|
|
@ -588,6 +588,7 @@ func upsertPositionConfigPacket(config: Meshtastic.Config.PositionConfig, nodeNu
|
|||
newPositionConfig.deviceGpsEnabled = config.gpsEnabled
|
||||
newPositionConfig.rxGpio = Int32(config.rxGpio)
|
||||
newPositionConfig.txGpio = Int32(config.txGpio)
|
||||
newPositionConfig.gpsEnGpio = Int32(config.gpsEnGpio)
|
||||
newPositionConfig.fixedPosition = config.fixedPosition
|
||||
newPositionConfig.positionBroadcastSeconds = Int32(truncatingIfNeeded: config.positionBroadcastSecs)
|
||||
newPositionConfig.broadcastSmartMinimumIntervalSecs = Int32(config.broadcastSmartMinimumIntervalSecs)
|
||||
|
|
@ -599,6 +600,7 @@ func upsertPositionConfigPacket(config: Meshtastic.Config.PositionConfig, nodeNu
|
|||
fetchedNode[0].positionConfig?.deviceGpsEnabled = config.gpsEnabled
|
||||
fetchedNode[0].positionConfig?.rxGpio = Int32(config.rxGpio)
|
||||
fetchedNode[0].positionConfig?.txGpio = Int32(config.txGpio)
|
||||
fetchedNode[0].positionConfig?.gpsEnGpio = Int32(config.gpsEnGpio)
|
||||
fetchedNode[0].positionConfig?.fixedPosition = config.fixedPosition
|
||||
fetchedNode[0].positionConfig?.positionBroadcastSeconds = Int32(config.positionBroadcastSecs)
|
||||
fetchedNode[0].positionConfig?.broadcastSmartMinimumIntervalSecs = Int32(config.broadcastSmartMinimumIntervalSecs)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ struct DeviceConfig: View {
|
|||
@State var rebroadcastMode = 0
|
||||
@State var doubleTapAsButtonPress = false
|
||||
@State var isManaged = false
|
||||
@State var gpsEnGPIO = 0
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
|
|
@ -123,18 +122,6 @@ struct DeviceConfig: View {
|
|||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
Picker("GPS EN GPIO", selection: $gpsEnGPIO) {
|
||||
ForEach(0..<46) {
|
||||
if $0 == 0 {
|
||||
Text("unset")
|
||||
} else {
|
||||
Text("Pin \($0)")
|
||||
}
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
Text("(Re)define PIN_GPS_EN for your board.")
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
.disabled(self.bleManager.connectedPeripheral == nil || node?.deviceConfig == nil)
|
||||
|
|
@ -281,11 +268,6 @@ struct DeviceConfig: View {
|
|||
if newBuzzerGPIO != node!.deviceConfig!.buttonGpio { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: gpsEnGPIO) { newgpsEnGpio in
|
||||
if node != nil && node?.deviceConfig != nil {
|
||||
if newgpsEnGpio != node!.deviceConfig!.gpsEnGpio { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: rebroadcastMode) { newRebroadcastMode in
|
||||
if node != nil && node?.deviceConfig != nil {
|
||||
if newRebroadcastMode != node!.deviceConfig!.rebroadcastMode { hasChanges = true }
|
||||
|
|
@ -308,7 +290,6 @@ struct DeviceConfig: View {
|
|||
self.debugLogEnabled = node?.deviceConfig?.debugLogEnabled ?? false
|
||||
self.buttonGPIO = Int(node?.deviceConfig?.buttonGpio ?? 0)
|
||||
self.buzzerGPIO = Int(node?.deviceConfig?.buzzerGpio ?? 0)
|
||||
self.gpsEnGPIO = Int(node?.deviceConfig?.gpsEnGpio ?? 0)
|
||||
self.rebroadcastMode = Int(node?.deviceConfig?.rebroadcastMode ?? 0)
|
||||
self.doubleTapAsButtonPress = node?.deviceConfig?.doubleTapAsButtonPress ?? false
|
||||
self.isManaged = node?.deviceConfig?.isManaged ?? false
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct PositionConfig: View {
|
|||
@State var deviceGpsEnabled = true
|
||||
@State var rxGpio = 0
|
||||
@State var txGpio = 0
|
||||
@State var gpsEnGpio = 0
|
||||
@State var fixedPosition = false
|
||||
@State var positionBroadcastSeconds = 0
|
||||
@State var broadcastSmartMinimumDistance = 0
|
||||
|
|
@ -231,6 +232,18 @@ struct PositionConfig: View {
|
|||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
Picker("GPS EN GPIO", selection: $gpsEnGpio) {
|
||||
ForEach(0..<46) {
|
||||
if $0 == 0 {
|
||||
Text("unset")
|
||||
} else {
|
||||
Text("Pin \($0)")
|
||||
}
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
Text("(Re)define PIN_GPS_EN for your board.")
|
||||
.font(.caption)
|
||||
} else {
|
||||
Toggle(isOn: $fixedPosition) {
|
||||
Label("Fixed Position", systemImage: "location.square.fill")
|
||||
|
|
@ -277,6 +290,7 @@ struct PositionConfig: View {
|
|||
pc.broadcastSmartMinimumDistance = UInt32(broadcastSmartMinimumDistance)
|
||||
pc.rxGpio = UInt32(rxGpio)
|
||||
pc.txGpio = UInt32(txGpio)
|
||||
pc.gpsEnGpio = UInt32(gpsEnGpio)
|
||||
var pf: PositionFlags = []
|
||||
if includeAltitude { pf.insert(.Altitude) }
|
||||
if includeAltitudeMsl { pf.insert(.AltitudeMsl) }
|
||||
|
|
@ -338,6 +352,11 @@ struct PositionConfig: View {
|
|||
if newTxGpio != node!.positionConfig!.txGpio { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: txGpio) { newGpsEnGpio in
|
||||
if node != nil && node!.positionConfig != nil {
|
||||
if newGpsEnGpio != node!.positionConfig!.gpsEnGpio { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: smartPositionEnabled) { newSmartPositionEnabled in
|
||||
if node != nil && node!.positionConfig != nil {
|
||||
if newSmartPositionEnabled != node!.positionConfig!.smartPositionEnabled { hasChanges = true }
|
||||
|
|
@ -424,6 +443,7 @@ struct PositionConfig: View {
|
|||
self.deviceGpsEnabled = node?.positionConfig?.deviceGpsEnabled ?? true
|
||||
self.rxGpio = Int(node?.positionConfig?.rxGpio ?? 0)
|
||||
self.txGpio = Int(node?.positionConfig?.txGpio ?? 0)
|
||||
self.gpsEnGpio = Int(node?.positionConfig?.gpsEnGpio ?? 0)
|
||||
self.fixedPosition = node?.positionConfig?.fixedPosition ?? false
|
||||
self.positionBroadcastSeconds = Int(node?.positionConfig?.positionBroadcastSeconds ?? 900)
|
||||
self.broadcastSmartMinimumIntervalSecs = Int(node?.positionConfig?.broadcastSmartMinimumIntervalSecs ?? 30)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue