mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: add traceroute (#620)
This commit is contained in:
parent
72c278c92c
commit
da5f1d529d
8 changed files with 95 additions and 2 deletions
|
|
@ -1734,13 +1734,21 @@ class MeshService : Service(), Logging {
|
|||
|
||||
override fun requestPosition(idNum: Int, position: Position) =
|
||||
toRemoteExceptions {
|
||||
val (lat, lon, alt) = with(position) { Triple(latitude, longitude, altitude) }
|
||||
val (lat, lon, alt) = position
|
||||
// request position
|
||||
if (idNum != 0) sendPosition(time = 1, destNum = idNum, wantResponse = true)
|
||||
// set local node's fixed position
|
||||
else sendPosition(time = 0, destNum = null, lat = lat, lon = lon, alt = alt)
|
||||
}
|
||||
|
||||
override fun requestTraceroute(requestId: Int, destNum: Int) = toRemoteExceptions {
|
||||
sendToRadio(newMeshPacketTo(destNum).buildMeshPacket(id = requestId) {
|
||||
portnumValue = Portnums.PortNum.TRACEROUTE_APP_VALUE
|
||||
payload = routeDiscovery {}.toByteString()
|
||||
wantResponse = true
|
||||
})
|
||||
}
|
||||
|
||||
override fun requestShutdown(idNum: Int) = toRemoteExceptions {
|
||||
sendToRadio(newMeshPacketTo(idNum).buildAdminPacket {
|
||||
shutdownSeconds = 5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue