fix: move Packet log after radioInterfaceService.sendToRadio()

pull/566/head
andrekir 2023-01-12 17:34:17 -03:00
rodzic 17a6e8cbc6
commit 5a07998b73
1 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -203,6 +203,16 @@ class MeshService : Service(), Logging {
if (SoftwareUpdateService.isUpdating) throw IsUpdatingException()
radioInterfaceService.sendToRadio(b)
if (p.packet.hasDecoded()) {
val packetToSave = MeshLog(
UUID.randomUUID().toString(),
"Packet",
System.currentTimeMillis(),
p.packet.toString()
)
insertMeshLog(packetToSave)
}
}
/**
@ -779,16 +789,6 @@ class MeshService : Service(), Logging {
p.time = System.currentTimeMillis() // update time to the actual time we started sending
// debug("Sending to radio: ${packet.toPIIString()}")
sendToRadio(packet)
if (packet.hasDecoded()) {
val packetToSave = MeshLog(
UUID.randomUUID().toString(),
"Packet",
System.currentTimeMillis(),
packet.toString()
)
insertMeshLog(packetToSave)
}
}
private fun processQueuedPackets() {