fix: move Packet log after radioInterfaceService.sendToRadio()

This commit is contained in:
andrekir 2023-01-12 17:34:17 -03:00
parent 17a6e8cbc6
commit 5a07998b73

View file

@ -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() {