2023-11-11 09:44:03 -08:00
|
|
|
//
|
|
|
|
|
// WaypointForm.swift
|
|
|
|
|
// Meshtastic
|
|
|
|
|
//
|
|
|
|
|
// Copyright Garth Vander Houwen 1/10/23.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import CoreLocation
|
2024-06-07 22:09:20 -05:00
|
|
|
import MapKit
|
|
|
|
|
import MeshtasticProtobufs
|
2024-06-03 02:17:55 -07:00
|
|
|
import OSLog
|
2024-06-07 22:09:20 -05:00
|
|
|
import SwiftUI
|
2023-11-11 09:44:03 -08:00
|
|
|
|
|
|
|
|
struct WaypointForm: View {
|
2024-05-29 16:40:07 -05:00
|
|
|
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
@EnvironmentObject var accessoryManager: AccessoryManager
|
2025-07-02 09:31:56 -04:00
|
|
|
@Environment(\.managedObjectContext) var context
|
2023-11-11 09:44:03 -08:00
|
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
|
@State var waypoint: WaypointEntity
|
2023-11-14 21:43:26 -08:00
|
|
|
let distanceFormatter = MKDistanceFormatter()
|
|
|
|
|
@State var editMode: Bool = false
|
2023-11-11 09:44:03 -08:00
|
|
|
@FocusState private var iconIsFocused: Bool
|
|
|
|
|
@State private var name: String = ""
|
|
|
|
|
@State private var description: String = ""
|
|
|
|
|
@State private var icon: String = "📍"
|
|
|
|
|
@State private var latitude: Double = 0
|
|
|
|
|
@State private var longitude: Double = 0
|
|
|
|
|
@State private var expires: Bool = false
|
|
|
|
|
@State private var expire: Date = Date.now.addingTimeInterval(60 * 480) // 1 minute * 480 = 8 Hours
|
|
|
|
|
@State private var locked: Bool = false
|
|
|
|
|
@State private var lockedTo: Int64 = 0
|
2024-09-03 07:12:15 -07:00
|
|
|
@State private var selectedDetent: PresentationDetent = .medium
|
2025-06-05 08:24:17 -07:00
|
|
|
@State private var waypointFailedAlert: Bool = false
|
2024-05-29 16:40:07 -05:00
|
|
|
|
2023-11-11 09:44:03 -08:00
|
|
|
var body: some View {
|
2023-11-26 12:19:32 -08:00
|
|
|
NavigationStack {
|
2023-11-14 21:43:26 -08:00
|
|
|
if editMode {
|
|
|
|
|
Text((waypoint.id > 0) ? "Editing Waypoint" : "Create Waypoint")
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
Divider()
|
|
|
|
|
Form {
|
2025-10-05 17:51:18 -07:00
|
|
|
if let cl = LocationsHandler.currentLocation {
|
|
|
|
|
let distance = CLLocation(latitude: cl.latitude, longitude: cl.longitude).distance(from: CLLocation(latitude: waypoint.coordinate.latitude, longitude: waypoint.coordinate.longitude ))
|
|
|
|
|
Section(header: Text("Coordinate") ) {
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Location:")
|
|
|
|
|
.foregroundColor(.secondary)
|
|
|
|
|
Text("\(String(format: "%.5f", waypoint.coordinate.latitude) + "," + String(format: "%.5f", waypoint.coordinate.longitude))")
|
|
|
|
|
.textSelection(.enabled)
|
|
|
|
|
.foregroundColor(.secondary)
|
|
|
|
|
.font(.caption)
|
|
|
|
|
|
|
|
|
|
}
|
2025-06-04 09:25:30 -07:00
|
|
|
Button {
|
2025-10-05 17:51:18 -07:00
|
|
|
waypoint.coordinate.longitude = cl.longitude
|
|
|
|
|
waypoint.coordinate.latitude = cl.latitude
|
2025-06-04 09:25:30 -07:00
|
|
|
} label: {
|
2025-06-12 10:51:48 -07:00
|
|
|
HStack {
|
|
|
|
|
Text("Use my Location")
|
|
|
|
|
Image(systemName: "location")
|
|
|
|
|
}
|
2025-06-04 09:25:30 -07:00
|
|
|
}
|
2025-06-05 08:30:15 -07:00
|
|
|
.accessibilityLabel("Set to current location")
|
2025-10-05 17:51:18 -07:00
|
|
|
HStack {
|
|
|
|
|
if waypoint.coordinate.latitude != 0 && waypoint.coordinate.longitude != 0 {
|
|
|
|
|
DistanceText(meters: distance)
|
|
|
|
|
.foregroundColor(Color.gray)
|
|
|
|
|
}
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
Section(header: Text("Waypoint Options")) {
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Name")
|
|
|
|
|
Spacer()
|
|
|
|
|
TextField(
|
|
|
|
|
"Name",
|
|
|
|
|
text: $name,
|
|
|
|
|
axis: .vertical
|
|
|
|
|
)
|
|
|
|
|
.foregroundColor(Color.gray)
|
2024-10-05 16:35:42 -07:00
|
|
|
.onChange(of: name) {
|
2024-09-22 08:03:18 -07:00
|
|
|
var totalBytes = name.utf8.count
|
2023-11-14 21:43:26 -08:00
|
|
|
// Only mess with the value if it is too big
|
2024-09-22 08:03:18 -07:00
|
|
|
while totalBytes > 30 {
|
2024-04-04 09:39:03 -07:00
|
|
|
name = String(name.dropLast())
|
2024-09-22 08:03:18 -07:00
|
|
|
totalBytes = name.utf8.count
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
2025-06-05 08:24:17 -07:00
|
|
|
waypoint.name = name.count > 0 ? name : "Dropped Pin"
|
2024-10-05 16:35:42 -07:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Description")
|
|
|
|
|
Spacer()
|
|
|
|
|
TextField(
|
|
|
|
|
"Description",
|
|
|
|
|
text: $description,
|
|
|
|
|
axis: .vertical
|
|
|
|
|
)
|
|
|
|
|
.foregroundColor(Color.gray)
|
2024-10-05 16:35:42 -07:00
|
|
|
.onChange(of: description) {
|
2024-09-22 08:03:18 -07:00
|
|
|
var totalBytes = description.utf8.count
|
2023-11-14 21:43:26 -08:00
|
|
|
// Only mess with the value if it is too big
|
2024-09-22 08:03:18 -07:00
|
|
|
while totalBytes > 100 {
|
2024-04-04 09:39:03 -07:00
|
|
|
description = String(description.dropLast())
|
2024-09-22 08:03:18 -07:00
|
|
|
totalBytes = description.utf8.count
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
2024-10-05 16:35:42 -07:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Icon")
|
|
|
|
|
Spacer()
|
2026-01-15 14:13:40 -08:00
|
|
|
TextField("Select an emoji", text: $icon)
|
|
|
|
|
.keyboardType(.emoji)
|
2023-11-14 21:43:26 -08:00
|
|
|
.font(.title)
|
|
|
|
|
.focused($iconIsFocused)
|
2024-10-06 08:50:12 -07:00
|
|
|
.onChange(of: icon) { _, value in
|
2023-11-14 21:43:26 -08:00
|
|
|
// If a second emoji is entered delete the first one
|
|
|
|
|
if value.count >= 1 {
|
|
|
|
|
if value.count > 1 {
|
|
|
|
|
let index = value.index(value.startIndex, offsetBy: 1)
|
|
|
|
|
icon = String(value[index])
|
|
|
|
|
}
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
|
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
Toggle(isOn: $expires) {
|
|
|
|
|
Label("Expires", systemImage: "clock.badge.xmark")
|
|
|
|
|
}
|
|
|
|
|
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
|
|
|
|
if expires {
|
|
|
|
|
DatePicker("Expire", selection: $expire, in: Date.now...)
|
|
|
|
|
.datePickerStyle(.compact)
|
|
|
|
|
.font(.callout)
|
|
|
|
|
}
|
|
|
|
|
Toggle(isOn: $locked) {
|
|
|
|
|
Label("Locked", systemImage: "lock")
|
|
|
|
|
}
|
|
|
|
|
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
2023-11-12 00:28:59 -08:00
|
|
|
}
|
2023-11-11 09:44:03 -08:00
|
|
|
}
|
2024-09-03 07:12:15 -07:00
|
|
|
.scrollDismissesKeyboard(.immediately)
|
2023-11-14 21:43:26 -08:00
|
|
|
HStack {
|
|
|
|
|
Button {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
guard let deviceNum = accessoryManager.activeDeviceNum else {
|
|
|
|
|
Logger.mesh.warning("Send waypoint failed: No deviceNum")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if accessoryManager.isConnected {
|
2025-05-05 17:21:08 -07:00
|
|
|
/// Send a new or exiting waypoint
|
|
|
|
|
var newWaypoint = Waypoint()
|
|
|
|
|
if waypoint.id == 0 {
|
|
|
|
|
newWaypoint.id = UInt32.random(in: UInt32(UInt8.max)..<UInt32.max)
|
|
|
|
|
waypoint.id = Int64(newWaypoint.id)
|
2023-11-14 21:43:26 -08:00
|
|
|
} else {
|
2025-05-05 17:21:08 -07:00
|
|
|
newWaypoint.id = UInt32(waypoint.id)
|
|
|
|
|
}
|
|
|
|
|
newWaypoint.latitudeI = waypoint.latitudeI
|
|
|
|
|
newWaypoint.longitudeI = waypoint.longitudeI
|
|
|
|
|
newWaypoint.name = name.count > 0 ? name : "Dropped Pin"
|
|
|
|
|
newWaypoint.description_p = description
|
|
|
|
|
// Unicode scalar value for the icon emoji string
|
|
|
|
|
let unicodeScalers = icon.unicodeScalars
|
|
|
|
|
// First element as an UInt32
|
|
|
|
|
let unicode = unicodeScalers[unicodeScalers.startIndex].value
|
|
|
|
|
newWaypoint.icon = unicode
|
|
|
|
|
if locked {
|
|
|
|
|
if lockedTo == 0 {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
newWaypoint.lockedTo = UInt32(deviceNum)
|
2025-05-05 17:21:08 -07:00
|
|
|
} else {
|
|
|
|
|
newWaypoint.lockedTo = UInt32(lockedTo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if expires {
|
|
|
|
|
newWaypoint.expire = UInt32(expire.timeIntervalSince1970)
|
|
|
|
|
} else {
|
|
|
|
|
newWaypoint.expire = 0
|
|
|
|
|
}
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
|
|
|
|
|
Task {
|
|
|
|
|
do {
|
|
|
|
|
try await accessoryManager.sendWaypoint(waypoint: newWaypoint)
|
|
|
|
|
dismiss()
|
|
|
|
|
} catch {
|
|
|
|
|
Logger.mesh.warning("Send waypoint failed: \(error)")
|
|
|
|
|
Task { @MainActor in
|
|
|
|
|
waypointFailedAlert = true
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
} else {
|
2025-05-05 17:21:08 -07:00
|
|
|
Logger.mesh.warning("Send waypoint failed, node not connected")
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
} label: {
|
|
|
|
|
Label("Send", systemImage: "arrow.up")
|
2023-11-14 10:32:11 -08:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
.buttonStyle(.bordered)
|
|
|
|
|
.buttonBorderShape(.capsule)
|
|
|
|
|
.controlSize(.regular)
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
.disabled(!accessoryManager.isConnected)
|
2023-11-14 21:43:26 -08:00
|
|
|
.padding(.bottom)
|
2024-05-29 16:40:07 -05:00
|
|
|
|
2023-11-14 21:43:26 -08:00
|
|
|
Button(role: .cancel) {
|
2023-11-14 10:32:11 -08:00
|
|
|
dismiss()
|
2023-11-14 21:43:26 -08:00
|
|
|
} label: {
|
2025-02-15 12:17:22 -08:00
|
|
|
Label("Cancel", systemImage: "x.circle")
|
2023-11-14 10:32:11 -08:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
.buttonStyle(.bordered)
|
|
|
|
|
.buttonBorderShape(.capsule)
|
|
|
|
|
.controlSize(.regular)
|
|
|
|
|
.padding(.bottom)
|
2024-05-29 16:40:07 -05:00
|
|
|
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
if waypoint.id > 0 && accessoryManager.isConnected {
|
2024-05-29 16:40:07 -05:00
|
|
|
|
2023-11-14 21:43:26 -08:00
|
|
|
Menu {
|
|
|
|
|
Button("For me", action: {
|
2025-07-02 09:31:56 -04:00
|
|
|
context.delete(waypoint)
|
2023-11-14 21:43:26 -08:00
|
|
|
do {
|
2025-07-02 09:31:56 -04:00
|
|
|
try context.save()
|
2023-11-14 21:43:26 -08:00
|
|
|
} catch {
|
2025-07-02 09:31:56 -04:00
|
|
|
context.rollback()
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
dismiss() })
|
|
|
|
|
Button("For everyone", action: {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
guard let deviceNum = accessoryManager.activeDeviceNum else {
|
|
|
|
|
Logger.mesh.error("Unable to set waypoint: No Device num")
|
|
|
|
|
return
|
|
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
var newWaypoint = Waypoint()
|
|
|
|
|
newWaypoint.id = UInt32(waypoint.id)
|
|
|
|
|
newWaypoint.name = name.count > 0 ? name : "Dropped Pin"
|
|
|
|
|
newWaypoint.description_p = description
|
2024-04-08 10:59:38 -07:00
|
|
|
newWaypoint.latitudeI = waypoint.latitudeI
|
|
|
|
|
newWaypoint.longitudeI = waypoint.longitudeI
|
2023-11-14 21:43:26 -08:00
|
|
|
// Unicode scalar value for the icon emoji string
|
|
|
|
|
let unicodeScalers = icon.unicodeScalars
|
|
|
|
|
// First element as an UInt32
|
|
|
|
|
let unicode = unicodeScalers[unicodeScalers.startIndex].value
|
|
|
|
|
newWaypoint.icon = unicode
|
|
|
|
|
if locked {
|
|
|
|
|
if lockedTo == 0 {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
newWaypoint.lockedTo = UInt32(deviceNum)
|
2023-11-14 21:43:26 -08:00
|
|
|
} else {
|
|
|
|
|
newWaypoint.lockedTo = UInt32(lockedTo)
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-08 10:59:38 -07:00
|
|
|
newWaypoint.expire = UInt32(1)
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
Task {
|
2023-11-14 21:43:26 -08:00
|
|
|
do {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
try await accessoryManager.sendWaypoint(waypoint: newWaypoint)
|
|
|
|
|
Task { @MainActor in
|
|
|
|
|
context.delete(waypoint)
|
|
|
|
|
do {
|
|
|
|
|
try context.save()
|
|
|
|
|
} catch {
|
|
|
|
|
context.rollback()
|
|
|
|
|
}
|
|
|
|
|
dismiss()
|
|
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
} catch {
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
Logger.mesh.warning("Send waypoint failed")
|
|
|
|
|
Task {@MainActor in
|
|
|
|
|
waypointFailedAlert = true
|
|
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
2023-11-14 10:32:11 -08:00
|
|
|
}
|
2023-11-14 21:43:26 -08:00
|
|
|
})
|
|
|
|
|
}
|
2023-11-14 10:32:11 -08:00
|
|
|
label: {
|
2025-05-05 08:57:38 -07:00
|
|
|
Label("Delete", systemImage: "trash")
|
2023-11-14 10:32:11 -08:00
|
|
|
.foregroundColor(.red)
|
|
|
|
|
}
|
|
|
|
|
.buttonStyle(.bordered)
|
|
|
|
|
.buttonBorderShape(.capsule)
|
|
|
|
|
.controlSize(.regular)
|
|
|
|
|
.padding(.bottom)
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
VStack {
|
2024-05-29 16:40:07 -05:00
|
|
|
HStack {
|
2024-09-03 07:12:15 -07:00
|
|
|
CircleText(text: String(UnicodeScalar(Int(waypoint.icon)) ?? "📍"), color: Color.orange, circleSize: 50)
|
2023-11-14 21:43:26 -08:00
|
|
|
Spacer()
|
|
|
|
|
Text(waypoint.name ?? "?")
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
Spacer()
|
Transports Interface to Support TCP for all Platforms and Serial on Mac (#1341)
* Initial implementation of transports
* Initial LogRadio implementation
* Fixes for Settings view (caused by debug commenting)
* Refinement of the object and actor model
* Connect view text and tab updates
* Fix mac catalyst and tests
* Warning and logging clean-up
* In progress commit
* Serial Transport and Reconnect draft work
* Serial transport and reconnection draft work
* Quick fix for BLE - still more work to do
* interim commit
* More in progress changes
* Minor improvements
* Pretty good initial implementation
* Bump version beyond the app store
* Fix for disconnection swipeAction
* Tweaks to TCPConnection implementation
* Retry for NONCE_ONLY_DB
* Revert json string change
* Simplified some of the API + "Anti-discovery"
* Tweaks for devices leaving the discovery process
* Bump version
* iOS26 Tweaks
* Tweaks and bug fixes
* Add link with slash sf symbol
* update symbol image on connect view
* BLE disconnect handling
* Log privacy attributes
* Onboarding and minor fixes.
* change database to nodes, add emoji to tcp logs
* Error handling improvements
* More logging emojis
* Suppressed unnecessary errors on disconnect
* Heartbeat emoji
* Add bluetooth symbol
* add privacy attributes to [TCP] logs, add custom bluetooth logo
* Improve routing logs
* Emoji for connect logs
* Heartbeat emoji
* Add CBCentralManagerScanOptionAllowDuplicatesKey options to central for bluetooth
* fix nav errors by switching from observableobject to state
* Update connection indicator icon
* fix for BLE disconnects
* Connection process fixes
* More fixes/tweaks to connection process
* Strict concurrency
* Fix some warnings, remove wifi warning
* delete stale keys
* interim commit
* Update privacy for log, fix wrong space
* fix a couple of linting items
* Switch to targeted
* interim commit
* BLE Signal strenth on connect view
* Remove BLE RSSI from long press menu
* Modem lights
* minor spacing tweak
* Additional BLE logging and a scanning fix.
* Discovery and BLE RSSI improvements
* Background suspension
* Update isConnected to enable UI during db load
* update protobufs
* Replace config if statements with switches, Fix unknown module config logging, make dark mode modem circle stroke color white so they are visible
* Additional logging cleanup
* hast
* Set unmessagable to true if the longname has the unmessagable emoji
* Connect error handling improvements
* Admin popup list icon and activity lights updates
* Revert use of .toolbar back to .navigationBarItems
* More public logging
* Better BLE error handling
* Node DB progress meter
* minor tweak to activity light interaction timing
* Fix comment linting, remove stale keys
* Remove stale keys
* Easy linting fixes
* Two more simple linting fixes
* clean up meshtasticapp
* More public logging
* Replay config
* Logging
* Fix for unselected node on Settings
* Tweak to progress meter based on device idiom
* Update protos
* Session replay redaction of messages
* Serial fix for old devices, and a let statement
* Mask text too
* Fix typo
* BLE poweredOff is now an auto-reconnectable error
* Update logging
* Fix for peerRemovedPairingInformation
* Logging for BLE peripheral:didUpdateValueFor errors.
* Fix for inconsistent swipe disconnect behavior
* periperal:didUpdateValueFor error handling
* Fix for BLEConnection continuation guarding
* BLEConnection actor deadlock on disconnect
* Heartbeat nonce
* Fix for swipe disconnect and task cancellation
* Fix for swipe actions not honoring .disabled()
* Tell BLETransport when BLEConnection is cancelled
* Update navigation logging
* Logging updates
* Bump version to 2.7.0
* Organize into folders and heartbeat stuff
* Minor improvements to manual TCP connection
* Auto-connect toggle
* Possible BLE bug, still waiting to see in logs
* Concurrency tweaks
* Concurrency improvements
* requestDeviceMetadata fix. fixes remote admin
* Minor typo fixes
* "All" button for log filters: category and level
* More robust continuation handling for BLE
* @FetchRequest based ChannelMessageList
* Update info.plist and device hardware file
* Move auto connect toggle to app settings and debug mode, tint properly with the accent color
* Add label to auto connect toggle
* Update log for node info received from ourselves over the mesh
* Remove unused scrollViewProxy
* Update Meshtastic/Views/Onboarding/DeviceOnboarding.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update target for connect view
* Properly Set datadog environment
* Comment out ble manager
* Adjust cyclomatic complexity thresholds in .swiftlint.yml
* Linting fixes, delete ble manager
* Make session replay debug only
---------
Co-authored-by: jake-b <jake-b@users.noreply.github.com>
Co-authored-by: jake <jake@jakes-Mac-mini.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 08:09:02 -07:00
|
|
|
if waypoint.locked > 0 && waypoint.locked != UInt32(accessoryManager.activeDeviceNum ?? 0) {
|
2025-06-05 09:23:51 -07:00
|
|
|
Image(systemName: "lock.fill")
|
2023-11-14 21:43:26 -08:00
|
|
|
.font(.largeTitle)
|
|
|
|
|
} else {
|
|
|
|
|
Button {
|
|
|
|
|
editMode = true
|
2024-09-03 07:12:15 -07:00
|
|
|
selectedDetent = .fraction(0.85)
|
2023-11-14 21:43:26 -08:00
|
|
|
} label: {
|
|
|
|
|
Image(systemName: "square.and.pencil" )
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
.symbolRenderingMode(.hierarchical)
|
|
|
|
|
.foregroundColor(.accentColor)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Divider()
|
2024-05-29 16:40:07 -05:00
|
|
|
VStack(alignment: .leading) {
|
2023-11-14 21:43:26 -08:00
|
|
|
// Description
|
|
|
|
|
if (waypoint.longDescription ?? "").count > 0 {
|
|
|
|
|
Label {
|
|
|
|
|
Text(waypoint.longDescription ?? "")
|
|
|
|
|
.foregroundColor(.primary)
|
|
|
|
|
.multilineTextAlignment(.leading)
|
|
|
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
|
|
|
} icon: {
|
|
|
|
|
Image(systemName: "doc.plaintext")
|
|
|
|
|
}
|
2024-09-02 21:35:01 -07:00
|
|
|
.padding(.bottom)
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
/// Coordinate
|
|
|
|
|
Label {
|
2024-09-03 07:12:15 -07:00
|
|
|
Text("Coordinates:")
|
2023-11-14 21:43:26 -08:00
|
|
|
.foregroundColor(.primary)
|
2024-09-03 07:12:15 -07:00
|
|
|
Text("\(String(format: "%.6f", waypoint.coordinate.latitude)), \(String(format: "%.6f", waypoint.coordinate.longitude))")
|
|
|
|
|
.textSelection(.enabled)
|
|
|
|
|
.foregroundColor(.secondary)
|
|
|
|
|
.font(.caption2)
|
2023-11-14 21:43:26 -08:00
|
|
|
} icon: {
|
2024-09-02 21:35:01 -07:00
|
|
|
Image(systemName: "mappin.circle")
|
|
|
|
|
}
|
|
|
|
|
.padding(.bottom)
|
|
|
|
|
// Drop Maps Pin
|
|
|
|
|
Button(action: {
|
|
|
|
|
if let url = URL(string: "http://maps.apple.com/?ll=\(waypoint.coordinate.latitude),\(waypoint.coordinate.longitude)&q=\(waypoint.name ?? "Dropped Pin")") {
|
|
|
|
|
UIApplication.shared.open(url)
|
|
|
|
|
}
|
|
|
|
|
}) {
|
|
|
|
|
Label("Drop Pin in Maps", systemImage: "mappin.and.ellipse")
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
2024-09-02 21:35:01 -07:00
|
|
|
.padding(.bottom)
|
2023-11-14 21:43:26 -08:00
|
|
|
/// Created
|
|
|
|
|
Label {
|
|
|
|
|
Text("Created: \(waypoint.created?.formatted() ?? "?")")
|
|
|
|
|
.foregroundColor(.primary)
|
|
|
|
|
} icon: {
|
|
|
|
|
Image(systemName: "clock.badge.checkmark")
|
|
|
|
|
.symbolRenderingMode(.hierarchical)
|
|
|
|
|
}
|
2024-09-02 21:35:01 -07:00
|
|
|
.padding(.bottom)
|
2023-11-14 21:43:26 -08:00
|
|
|
/// Updated
|
|
|
|
|
if waypoint.lastUpdated != nil {
|
|
|
|
|
Label {
|
|
|
|
|
Text("Updated: \(waypoint.lastUpdated?.formatted() ?? "?")")
|
|
|
|
|
.foregroundColor(.primary)
|
|
|
|
|
} icon: {
|
|
|
|
|
Image(systemName: "clock.arrow.circlepath")
|
|
|
|
|
.symbolRenderingMode(.hierarchical)
|
|
|
|
|
}
|
2024-09-02 21:35:01 -07:00
|
|
|
.padding(.bottom)
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
/// Expires
|
|
|
|
|
if waypoint.expire != nil {
|
|
|
|
|
Label {
|
|
|
|
|
Text("Expires: \(waypoint.expire?.formatted() ?? "?")")
|
|
|
|
|
.foregroundColor(.primary)
|
|
|
|
|
} icon: {
|
|
|
|
|
Image(systemName: "hourglass.bottomhalf.filled")
|
|
|
|
|
.symbolRenderingMode(.hierarchical)
|
|
|
|
|
.frame(width: 35)
|
|
|
|
|
}
|
|
|
|
|
.padding(.bottom, 5)
|
|
|
|
|
}
|
|
|
|
|
/// Distance
|
2025-10-05 17:51:18 -07:00
|
|
|
if let cl = LocationsHandler.currentLocation {
|
|
|
|
|
if cl.distance(from: cl) > 0.0 {
|
|
|
|
|
let metersAway = waypoint.coordinate.distance(from: cl)
|
|
|
|
|
Label {
|
|
|
|
|
Text("Distance".localized + ": \(distanceFormatter.string(fromDistance: Double(metersAway)))")
|
|
|
|
|
.foregroundColor(.primary)
|
|
|
|
|
} icon: {
|
|
|
|
|
Image(systemName: "lines.measurement.horizontal")
|
|
|
|
|
.symbolRenderingMode(.hierarchical)
|
|
|
|
|
.frame(width: 35)
|
|
|
|
|
}
|
|
|
|
|
.padding(.bottom, 5)
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.padding(.top)
|
2023-11-21 22:39:42 -08:00
|
|
|
#if targetEnvironment(macCatalyst)
|
2023-11-14 21:43:26 -08:00
|
|
|
Spacer()
|
|
|
|
|
Button {
|
|
|
|
|
dismiss()
|
|
|
|
|
} label: {
|
2025-04-27 11:26:23 -07:00
|
|
|
Label("Close", systemImage: "xmark")
|
2023-11-14 21:43:26 -08:00
|
|
|
}
|
|
|
|
|
.buttonStyle(.bordered)
|
|
|
|
|
.buttonBorderShape(.capsule)
|
|
|
|
|
.controlSize(.large)
|
|
|
|
|
.padding()
|
2023-11-21 22:39:42 -08:00
|
|
|
#endif
|
2023-11-14 10:32:11 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-05 08:28:04 -07:00
|
|
|
.alert("Waypoint Failed to Send", isPresented: $waypointFailedAlert) {
|
2025-06-05 08:24:17 -07:00
|
|
|
Button("OK", role: .cancel) {
|
2025-07-02 09:31:56 -04:00
|
|
|
context.delete(waypoint)
|
2025-06-05 08:24:17 -07:00
|
|
|
do {
|
2025-07-02 09:31:56 -04:00
|
|
|
try context.save()
|
2025-06-05 08:24:17 -07:00
|
|
|
} catch {
|
2025-07-02 09:31:56 -04:00
|
|
|
context.rollback()
|
2025-06-05 08:24:17 -07:00
|
|
|
}
|
|
|
|
|
dismiss()
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-05 17:21:08 -07:00
|
|
|
.onDisappear {
|
|
|
|
|
if waypoint.id == 0 {
|
|
|
|
|
// New, unsent waypoint created by the user: delete it
|
2025-07-02 09:31:56 -04:00
|
|
|
context.delete(waypoint)
|
2025-05-05 17:21:08 -07:00
|
|
|
do {
|
2025-07-02 09:31:56 -04:00
|
|
|
try context.save()
|
2025-05-05 17:21:08 -07:00
|
|
|
} catch {
|
2025-07-02 09:31:56 -04:00
|
|
|
context.rollback()
|
2025-05-05 17:21:08 -07:00
|
|
|
Logger.mesh.error("Failed to save context on waypoint deletion: \(error)")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-14 10:32:11 -08:00
|
|
|
.onAppear {
|
|
|
|
|
if waypoint.id > 0 {
|
2025-07-02 09:31:56 -04:00
|
|
|
let waypoint = getWaypoint(id: Int64(waypoint.id), context: context)
|
2023-11-14 10:32:11 -08:00
|
|
|
name = waypoint.name ?? "Dropped Pin"
|
|
|
|
|
description = waypoint.longDescription ?? ""
|
|
|
|
|
icon = String(UnicodeScalar(Int(waypoint.icon)) ?? "📍")
|
|
|
|
|
latitude = Double(waypoint.latitudeI) / 1e7
|
|
|
|
|
longitude = Double(waypoint.longitudeI) / 1e7
|
|
|
|
|
if waypoint.expire != nil {
|
|
|
|
|
expires = true
|
|
|
|
|
expire = waypoint.expire ?? Date()
|
|
|
|
|
} else {
|
|
|
|
|
expires = false
|
|
|
|
|
}
|
|
|
|
|
if waypoint.locked > 0 {
|
|
|
|
|
locked = true
|
|
|
|
|
lockedTo = waypoint.locked
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
name = ""
|
|
|
|
|
description = ""
|
|
|
|
|
locked = false
|
|
|
|
|
expires = false
|
|
|
|
|
expire = Date.now.addingTimeInterval(60 * 480)
|
|
|
|
|
icon = "📍"
|
2023-11-21 22:39:42 -08:00
|
|
|
latitude = waypoint.coordinate.latitude
|
2023-11-14 10:32:11 -08:00
|
|
|
longitude = waypoint.coordinate.longitude
|
|
|
|
|
}
|
2023-11-11 09:44:03 -08:00
|
|
|
}
|
2024-09-03 07:12:15 -07:00
|
|
|
.presentationBackgroundInteraction(.enabled(upThrough: .fraction(0.85)))
|
2023-11-26 12:19:32 -08:00
|
|
|
.presentationDragIndicator(.visible)
|
2023-11-11 09:44:03 -08:00
|
|
|
}
|
|
|
|
|
}
|