Upgrade to ios 17

This commit is contained in:
Garth Vander Houwen 2024-10-04 19:36:30 -07:00
parent dc37666114
commit e1ec14db2c
32 changed files with 41 additions and 84 deletions

View file

@ -19163,6 +19163,9 @@
},
"Send a message to a certain meshtastic channel" : {
},
"Send a position on the primary channel when the user button is triple clicked." : {
},
"Send a shutdown to the node you are connected to" : {
@ -21906,6 +21909,9 @@
},
"Treat double tap on supported accelerometers as a user button press." : {
},
"Triple Click Ad Hoc Ping" : {
},
"Try Again" : {

View file

@ -1153,7 +1153,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1540;
LastUpgradeCheck = 1600;
TargetAttributes = {
25F5D5C62C4375A8008036E3 = {
CreatedOnToolsVersion = 15.4;
@ -1667,7 +1667,6 @@
DDC2E17F26CE248F0042C5E4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
@ -1682,7 +1681,7 @@
INFOPLIST_FILE = Meshtastic/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Meshtastic;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1702,7 +1701,6 @@
DDC2E18026CE248F0042C5E4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
@ -1717,7 +1715,7 @@
INFOPLIST_FILE = Meshtastic/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Meshtastic;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -15,37 +15,36 @@ struct MessageChannelIntent: AppIntent {
@Parameter(title: "Message")
var messageContent: String
@Parameter(title: "Channel",controlStyle: .stepper, inclusiveRange: (lowerBound: 0, upperBound: 7))
@Parameter(title: "Channel", controlStyle: .stepper, inclusiveRange: (lowerBound: 0, upperBound: 7))
var channelNumber: Int
static var parameterSummary: some ParameterSummary {
Summary("Send \(\.$messageContent) to \(\.$channelNumber)")
}
func perform() async throws -> some IntentResult {
if (!BLEManager.shared.isConnected){
if !BLEManager.shared.isConnected {
throw AppIntentErrors.AppIntentError.notConnected
}
// Check if channel number is between 1 and 7
guard (0...7).contains(channelNumber) else {
throw $channelNumber.needsValueError("Channel number must be between 0 and 7.")
}
// Convert messageContent to data and check its length
guard let messageData = messageContent.data(using: .utf8) else {
throw AppIntentErrors.AppIntentError.message("Failed to encode message content")
}
if messageData.count > 228 {
throw $messageContent.needsValueError("Message content exceeds 228 bytes.")
}
if(!BLEManager.shared.sendMessage(message: messageContent, toUserNum: 0, channel: Int32(channelNumber), isEmoji: false, replyID: 0)){
if !BLEManager.shared.sendMessage(message: messageContent, toUserNum: 0, channel: Int32(channelNumber), isEmoji: false, replyID: 0) {
throw AppIntentErrors.AppIntentError.message("Failed to send message")
}
return .result()
return .result()
}
}

View file

@ -16,10 +16,10 @@ struct SendWaypointIntent: AppIntent {
@Parameter(title: "Name", default: "Dropped Pin")
var nameParameter: String?
@Parameter(title: "Description", default: "")
var descriptionParameter: String?
@Parameter(title: "Emoji", default: "📍")
var emojiParameter: String?
@ -27,19 +27,19 @@ struct SendWaypointIntent: AppIntent {
var locationParameter: CLPlacemark
func perform() async throws -> some IntentResult {
if (!BLEManager.shared.isConnected){
if !BLEManager.shared.isConnected {
throw AppIntentErrors.AppIntentError.notConnected
}
// Provide default values if parameters are nil
let name = nameParameter ?? "Dropped Pin"
let description = descriptionParameter ?? ""
let emoji = emojiParameter ?? "📍"
// Validate name length
if name.utf8.count > 30 {
throw $nameParameter.needsValueError("Name must be less than 30 bytes")
}
// Validate description length
if description.utf8.count > 100 {
throw $descriptionParameter.needsValueError("Description must be less than 100 bytes")
@ -60,7 +60,6 @@ struct SendWaypointIntent: AppIntent {
newWaypoint.longitudeI = Int32(longitude * 10_000_000)
}
newWaypoint.id = UInt32.random(in: UInt32(UInt8.max)..<UInt32.max)
// Unicode scalar value for the icon emoji string
let unicodeScalers = emoji.unicodeScalars
@ -69,12 +68,9 @@ struct SendWaypointIntent: AppIntent {
newWaypoint.icon = unicode
newWaypoint.name = name
newWaypoint.description_p = description
if(!BLEManager.shared.sendWaypoint(waypoint: newWaypoint)){
if !BLEManager.shared.sendWaypoint(waypoint: newWaypoint) {
throw AppIntentErrors.AppIntentError.message("Failed to Send Waypoint")
}
return .result()
}

View file

@ -10,7 +10,6 @@ import CoreLocation
import OSLog
// Shared state that manages the `CLLocationManager` and `CLBackgroundActivitySession`.
@available(iOS 17.0, macOS 14.0, *)
@MainActor class LocationsHandler: ObservableObject {
static let shared = LocationsHandler() // Create a single, shared instance of the object.

View file

@ -675,7 +675,7 @@ func routingPacket (packet: MeshPacket, connectedNodeNum: Int64, context: NSMana
func telemetryPacket(packet: MeshPacket, connectedNode: Int64, context: NSManagedObjectContext) {
if let telemetryMessage = try? Telemetry(serializedData: packet.decoded.payload) {
if let telemetryMessage = try? Telemetry(serializedBytes: packet.decoded.payload) {
let logString = String.localizedStringWithFormat("mesh.log.telemetry.received %@".localized, String(packet.from))
MeshLogger.log("📈 \(logString)")

View file

@ -3,9 +3,7 @@
import SwiftUI
import CoreData
import OSLog
#if canImport(TipKit)
import TipKit
#endif
@available(iOS 17.0, *)
@main

View file

@ -5,11 +5,8 @@
// Copyright(c) Garth Vander Houwen 8/31/23.
//
import SwiftUI
#if canImport(TipKit)
import TipKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct BluetoothConnectionTip: Tip {
var id: String {

View file

@ -5,11 +5,8 @@
// Copyright(c) Garth Vander Houwen 8/31/23.
//
import SwiftUI
#if canImport(TipKit)
import TipKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct ShareChannelsTip: Tip {
var id: String {
@ -26,7 +23,6 @@
}
}
@available(iOS 17.0, macOS 14.0, *)
struct CreateChannelsTip: Tip {
var id: String {
@ -43,7 +39,6 @@ struct CreateChannelsTip: Tip {
}
}
@available(iOS 17.0, macOS 14.0, *)
struct AdminChannelTip: Tip {
var id: String {

View file

@ -5,11 +5,8 @@
// Copyright(c) Garth Vander Houwen 9/15/23.
//
import SwiftUI
#if canImport(TipKit)
import TipKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct MessagesTip: Tip {
var id: String {

View file

@ -11,9 +11,7 @@ import CoreData
import CoreLocation
import CoreBluetooth
import OSLog
#if canImport(TipKit)
import TipKit
#endif
#if canImport(ActivityKit)
import ActivityKit
#endif

View file

@ -8,9 +8,7 @@
import SwiftUI
import CoreData
import OSLog
#if canImport(TipKit)
import TipKit
#endif
struct Messages: View {

View file

@ -8,9 +8,7 @@
import SwiftUI
import CoreData
import OSLog
#if canImport(TipKit)
import TipKit
#endif
struct UserList: View {

View file

@ -8,7 +8,6 @@ import SwiftUI
import MapKit
import CoreData
@available(iOS 17.0, macOS 14.0, *)
struct NodeMapContent: MapContent {
@ObservedObject var node: NodeInfoEntity

View file

@ -6,11 +6,8 @@
//
import SwiftUI
#if canImport(MapKit)
import MapKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct MapSettingsForm: View {
@Environment(\.dismiss) private var dismiss
@State private var currentDetent = PresentationDetent.medium

View file

@ -7,11 +7,8 @@
import SwiftUI
import CoreLocation
#if canImport(MapKit)
import MapKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct NodeMapSwiftUI: View {
@Environment(\.managedObjectContext) var context
@EnvironmentObject var bleManager: BLEManager

View file

@ -7,16 +7,13 @@
import SwiftUI
import Charts
#if canImport(MapKit)
import MapKit
#endif
struct PositionAltitude {
let time: Date
var altitude: Measurement<UnitLength>
}
@available(iOS 17.0, macOS 14.0, *)
struct PositionAltitudeChart: View {
@Environment(\.dismiss) private var dismiss
@ObservedObject var node: NodeInfoEntity

View file

@ -8,7 +8,6 @@
import SwiftUI
import MapKit
@available(iOS 17.0, macOS 14.0, *)
struct PositionPopover: View {
@ObservedObject var locationsHandler = LocationsHandler.shared

View file

@ -10,11 +10,8 @@ import CoreData
import CoreLocation
import Foundation
import OSLog
#if canImport(MapKit)
import MapKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct MeshMap: View {
@Environment(\.managedObjectContext) var context

View file

@ -6,11 +6,9 @@
//
import SwiftUI
#if canImport(MapKit)
import MapKit
#endif
@available(iOS 17.0, macOS 14.0, *)
struct TraceRouteLog: View {
@ObservedObject var locationsHandler = LocationsHandler.shared
@Environment(\.managedObjectContext) var context

View file

@ -8,8 +8,6 @@
import SwiftUI
import OSLog
/// Needed for TableColumnForEach
@available(iOS 17.0, macOS 14.0, *)
struct AppLog: View {
@State private var logs: [OSLogEntryLog] = []
@ -216,7 +214,6 @@ struct AppLog: View {
}
}
@available(iOS 17.0, macOS 14.0, *)
extension AppLog {
@MainActor
private func searchAppLogs() async -> [OSLogEntryLog] {

View file

@ -10,9 +10,7 @@ import MapKit
import MeshtasticProtobufs
import OSLog
import SwiftUI
#if canImport(TipKit)
import TipKit
#endif
func generateChannelKey(size: Int) -> String {
var keyData = Data(count: size)

View file

@ -6,9 +6,7 @@
//
import SwiftUI
#if canImport(MapKit)
import MapKit
#endif
struct ChannelForm: View {

View file

@ -28,6 +28,7 @@ struct DeviceConfig: View {
@State var nodeInfoBroadcastSecs = 10800
@State var doubleTapAsButtonPress = false
@State var ledHeartbeatEnabled = true
@State var tripleClickAsAdHocPing = true
@State var tzdef = ""
var body: some View {
@ -76,6 +77,12 @@ 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.")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Toggle(isOn: $ledHeartbeatEnabled) {
Label("LED Heartbeat", systemImage: "waveform.path.ecg")
@ -93,13 +100,13 @@ struct DeviceConfig: View {
Label("Time Zone", systemImage: "clock.badge.exclamationmark")
TextField("Time Zone", text: $tzdef, axis: .vertical)
.foregroundColor(.gray)
.onChange(of: tzdef, perform: { _ in
.onChange(of: tzdef) {
let totalBytes = tzdef.utf8.count
// Only mess with the value if it is too big
if totalBytes > 63 {
tzdef = String(tzdef.dropLast())
}
})
}
.foregroundColor(.gray)
}
@ -268,6 +275,9 @@ struct DeviceConfig: View {
.onChange(of: doubleTapAsButtonPress) {
if $0 != node?.deviceConfig?.doubleTapAsButtonPress { hasChanges = true }
}
.onChange(of: tripleClickAsAdHocPing) {
// if $0 != node?.deviceConfig?.tripleClickAsAdHocPing { hasChanges = true }
}
.onChange(of: tzdef) { newTzdef in
if newTzdef != node?.deviceConfig?.tzdef { hasChanges = true }
}

View file

@ -8,7 +8,6 @@ import MeshtasticProtobufs
import SwiftUI
import OSLog
@available(iOS 17.0, macOS 14.0, *)
struct AmbientLightingConfig: View {
@Environment(\.self) var environment
@Environment(\.managedObjectContext) var context

View file

@ -8,7 +8,6 @@
import SwiftUI
import CoreLocation
@available(iOS 17.0, macOS 14.0, *)
struct GPSStatus: View {
var largeFont: Font = .footnote

View file

@ -12,7 +12,6 @@ import CoreLocation
import CoreMotion
import OSLog
@available(iOS 17.0, macOS 14.0, *)
struct RouteRecorder: View {
@ObservedObject var locationsHandler: LocationsHandler = LocationsHandler.shared

View file

@ -10,7 +10,6 @@ import CoreData
import MapKit
import OSLog
@available(iOS 17.0, macOS 14.0, *)
struct Routes: View {
@State private var columnVisibility = NavigationSplitViewVisibility.doubleColumn

View file

@ -7,9 +7,7 @@
import SwiftUI
import OSLog
#if canImport(TipKit)
import TipKit
#endif
struct Settings: View {
@Environment(\.managedObjectContext) var context

View file

@ -8,10 +8,7 @@ import SwiftUI
import CoreData
import CoreImage.CIFilterBuiltins
import MeshtasticProtobufs
#if canImport(TipKit)
import TipKit
#endif
struct QrCodeImage {
let context = CIContext()