From 489ca28529341c8dad14bab167bc3c8e39e91f66 Mon Sep 17 00:00:00 2001 From: Matthew Davies Date: Sun, 26 Jan 2025 11:32:45 -0800 Subject: [PATCH] send tr received notification --- Meshtastic/Helpers/BLEManager.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 1afb59be..5c8aa5ae 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -960,6 +960,22 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate } traceRoute?.hops = NSOrderedSet(array: hopNodes) traceRoute?.time = Date() + + if let tr = traceRoute { + let manager = LocalNotificationManager() + manager.notifications = [ + Notification( + id: (UUID().uuidString), + title: "Traceroute Complete", + subtitle: "TR received back from \(destinationHop.name ?? "unknown")", + content: "Hops from: \(tr.hopsTowards), Hops back: \(tr.hopsBack)\n\(tr.routeText ?? "unknown".localized)\n\(tr.routeBackText ?? "unknown".localized)", + target: "nodes", + path: "meshtastic:///nodes?nodenum=\(connectedNode.user?.num ?? 0)" + ) + ] + manager.schedule() + } + do { try context.save() Logger.data.info("💾 Saved Trace Route")