Merge pull request #815 from meshtastic/repeater-in-traceroute

Identify repeaters in trace routes
This commit is contained in:
Garth Vander Houwen 2024-07-23 15:21:20 -07:00 committed by GitHub
commit 07c1018b53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -827,7 +827,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
var hopNodes: [TraceRouteHopEntity] = []
for node in routingMessage.route {
var hopNode = getNodeInfo(id: Int64(node), context: context)
if hopNode == nil && hopNode?.num ?? 0 > 0 {
if hopNode == nil && hopNode?.num ?? 0 > 0 && node != 4294967295 {
hopNode = createNodeInfo(num: Int64(node), context: context)
}
let traceRouteHop = TraceRouteHopEntity(context: context)
@ -852,7 +852,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
}
hopNodes.append(traceRouteHop)
}
routeString += "\(hopNode?.user?.longName ?? "unknown".localized) \(hopNode?.viaMqtt ?? false ? "MQTT" : "") --> "
routeString += "\(hopNode?.user?.longName ?? (node == 4294967295 ? "Repeater" : String(hopNode?.num.toHex() ?? "unknown".localized))) \(hopNode?.viaMqtt ?? false ? "MQTT" : "") --> "
}
routeString += traceRoute?.node?.user?.longName ?? "unknown".localized
traceRoute?.routeText = routeString