mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
distinguish between implicit and real ACKs (#552)
This commit is contained in:
parent
1e95c200e6
commit
7c28c4091f
5 changed files with 54 additions and 38 deletions
|
|
@ -30,6 +30,10 @@ class PacketRepository @Inject constructor(private val packetDaoLazy: dagger.Laz
|
|||
packetDao.updateMessageStatus(d, m)
|
||||
}
|
||||
|
||||
suspend fun getDataPacketById(requestId: Int) = withContext(Dispatchers.IO) {
|
||||
packetDao.getDataPacketById(requestId)
|
||||
}
|
||||
|
||||
suspend fun deleteAllMessages() = withContext(Dispatchers.IO) {
|
||||
packetDao.deleteAllMessages()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,4 +47,12 @@ interface PacketDao {
|
|||
val new = data.copy(status = m)
|
||||
findDataPacket(data)?.let { update(it.copy(data = new)) }
|
||||
}
|
||||
|
||||
@Query("Select data from packet")
|
||||
fun getDataPackets(): List<DataPacket>
|
||||
|
||||
@Transaction
|
||||
fun getDataPacketById(requestId: Int): DataPacket? {
|
||||
return getDataPackets().firstOrNull { it.id == requestId }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue