diff --git a/Meshtastic Client.xcodeproj/project.pbxproj b/Meshtastic Client.xcodeproj/project.pbxproj index 39305a3c..7b156787 100644 --- a/Meshtastic Client.xcodeproj/project.pbxproj +++ b/Meshtastic Client.xcodeproj/project.pbxproj @@ -738,7 +738,7 @@ CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\""; DEVELOPMENT_TEAM = GCH7VS5Y9R; ENABLE_PREVIEWS = YES; @@ -769,7 +769,7 @@ CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\""; DEVELOPMENT_TEAM = GCH7VS5Y9R; ENABLE_PREVIEWS = YES; diff --git a/MeshtasticClient/Helpers/BLEManager.swift b/MeshtasticClient/Helpers/BLEManager.swift index bfb97ab5..8ed430d1 100644 --- a/MeshtasticClient/Helpers/BLEManager.swift +++ b/MeshtasticClient/Helpers/BLEManager.swift @@ -897,7 +897,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph print(decodedInfo.packet.decoded.requestID) print(decodedInfo.packet.priority) //let mes = routingMessage. - //let error = routingMessage.errorReason + let error = routingMessage.errorReason //routingMessage.routeRequest } @@ -1111,7 +1111,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph let fromNodeNum = connectedPeripheral.num - if fromNodeNum <= 0 { + if fromNodeNum <= 0 || (LocationHelper.currentLocation.latitude == LocationHelper.DefaultLocation.latitude && LocationHelper.currentLocation.longitude == LocationHelper.DefaultLocation.longitude) { return false } @@ -1199,6 +1199,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph // Send a position out to the mesh if "share location with the mesh" is enabled in settings if userSettings!.provideLocation { + let success = sendPosition(destNum: connectedPeripheral.num, wantResponse: false) if !success { diff --git a/MeshtasticClient/Helpers/LocationHelper.swift b/MeshtasticClient/Helpers/LocationHelper.swift index b3459ef7..7cea2ee3 100644 --- a/MeshtasticClient/Helpers/LocationHelper.swift +++ b/MeshtasticClient/Helpers/LocationHelper.swift @@ -4,8 +4,8 @@ class LocationHelper: NSObject, ObservableObject { static let shared = LocationHelper() - // Mount Rainier - static let DefaultLocation = CLLocationCoordinate2D(latitude: 46.879967, longitude: -121.726906) + // Apple Park ° N, 122.0090° W + static let DefaultLocation = CLLocationCoordinate2D(latitude: 37.3346, longitude: -122.0090) static let DefaultAltitude = CLLocationDistance(integerLiteral: 0) diff --git a/MeshtasticClient/Views/Nodes/NodeList.swift b/MeshtasticClient/Views/Nodes/NodeList.swift index 9a73881c..3c043ea8 100644 --- a/MeshtasticClient/Views/Nodes/NodeList.swift +++ b/MeshtasticClient/Views/Nodes/NodeList.swift @@ -87,28 +87,28 @@ struct NodeList: View { } .padding([.leading, .top, .bottom]) } - .swipeActions { - - Button { - - context.delete(node) - - do { - - try context.save() - print("Successfully Deleted NodeInfoEntiy: \(node.num)") - - } catch { - - print("Failed to save context after deleting NodeInfoEntity Num: \(node.num)") - } - - } label: { - - Label("Delete from app", systemImage: "trash") - } - .tint(.red) - } +// .swipeActions { +// +// Button { +// +// context.delete(node) +// +// do { +// +// try context.save() +// print("Successfully Deleted NodeInfoEntiy: \(node.num)") +// +// } catch { +// +// print("Failed to save context after deleting NodeInfoEntity Num: \(node.num)") +// } +// +// } label: { +// +// Label("Delete from app", systemImage: "trash") +// } +// .tint(.red) +// } } } }