kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
rodzic
6f7a847957
commit
8af31bb0d0
|
@ -8,11 +8,14 @@ val MeshProtos.MeshPacket.fullRouteDiscovery: RouteDiscovery?
|
||||||
get() = with(decoded) {
|
get() = with(decoded) {
|
||||||
if (hasDecoded() && !wantResponse && portnum == Portnums.PortNum.TRACEROUTE_APP) {
|
if (hasDecoded() && !wantResponse && portnum == Portnums.PortNum.TRACEROUTE_APP) {
|
||||||
runCatching { RouteDiscovery.parseFrom(payload).toBuilder() }.getOrNull()?.apply {
|
runCatching { RouteDiscovery.parseFrom(payload).toBuilder() }.getOrNull()?.apply {
|
||||||
|
val fullRoute = listOf(to) + routeList + from
|
||||||
clearRoute()
|
clearRoute()
|
||||||
addAllRoute(listOf(to) + routeList + from)
|
addAllRoute(fullRoute)
|
||||||
if (hopStart > 0 && snrBackList.size > 0) { // otherwise back route is invalid
|
|
||||||
clearRouteBack()
|
val fullRouteBack = listOf(from) + routeBackList + to
|
||||||
addAllRouteBack(listOf(from) + routeBackList + to)
|
clearRouteBack()
|
||||||
|
if (hopStart > 0 && snrBackCount > 0) { // otherwise back route is invalid
|
||||||
|
addAllRouteBack(fullRouteBack)
|
||||||
}
|
}
|
||||||
}?.build()
|
}?.build()
|
||||||
} else {
|
} else {
|
||||||
|
|
Ładowanie…
Reference in New Issue