2022-06-14 16:45:43 -07:00
|
|
|
//
|
|
|
|
|
// TelemetryConfig.swift
|
|
|
|
|
// Meshtastic Apple
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) Garth Vander Houwen 6/13/22.
|
|
|
|
|
//
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct TelemetryConfig: View {
|
|
|
|
|
|
|
|
|
|
@Environment(\.managedObjectContext) var context
|
|
|
|
|
@EnvironmentObject var bleManager: BLEManager
|
|
|
|
|
|
|
|
|
|
@State var isPowerSaving = false
|
|
|
|
|
@State var isAlwaysPowered = false
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
|
|
|
|
|
VStack {
|
|
|
|
|
|
|
|
|
|
Form {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.navigationTitle("Telemetry Config")
|
|
|
|
|
.navigationBarItems(trailing:
|
|
|
|
|
|
|
|
|
|
ZStack {
|
|
|
|
|
|
2022-06-17 18:20:30 -07:00
|
|
|
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?????")
|
2022-06-14 16:45:43 -07:00
|
|
|
})
|
|
|
|
|
.onAppear {
|
|
|
|
|
|
|
|
|
|
self.bleManager.context = context
|
|
|
|
|
}
|
|
|
|
|
.navigationViewStyle(StackNavigationViewStyle())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|