mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: auto retry text message send on max retransmit (#4124)
This commit is contained in:
parent
c9259c793f
commit
6bb40e4d20
7 changed files with 64 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
* Copyright (c) 2025-2026 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.meshtastic.core.database.entity
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
|
|
@ -55,6 +54,7 @@ data class PacketEntity(
|
|||
viaMqtt = data.viaMqtt,
|
||||
relayNode = data.relayNode,
|
||||
relays = data.relays,
|
||||
retryCount = data.retryCount,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
* Copyright (c) 2025-2026 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.meshtastic.core.database.model
|
||||
|
||||
import org.jetbrains.compose.resources.StringResource
|
||||
|
|
@ -88,6 +87,7 @@ data class Message(
|
|||
val viaMqtt: Boolean = false,
|
||||
val relayNode: Int? = null,
|
||||
val relays: Int = 0,
|
||||
val retryCount: Int = 0,
|
||||
) {
|
||||
fun getStatusStringRes(): Pair<StringResource, StringResource> {
|
||||
val title = if (routingError > 0) Res.string.error else Res.string.message_delivery_status
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ data class DataPacket(
|
|||
var relayNode: Int? = null,
|
||||
var relays: Int = 0,
|
||||
var viaMqtt: Boolean = false, // True if this packet passed via MQTT somewhere along its path
|
||||
var retryCount: Int = 0, // Number of automatic retry attempts
|
||||
var emoji: Int = 0,
|
||||
) : Parcelable {
|
||||
|
||||
|
|
@ -139,6 +140,7 @@ data class DataPacket(
|
|||
parcel.readInt().let { if (it == -1) null else it },
|
||||
parcel.readInt(), // relays
|
||||
parcel.readInt() == 1, // viaMqtt
|
||||
parcel.readInt(), // retryCount
|
||||
parcel.readInt(), // emoji
|
||||
)
|
||||
|
||||
|
|
@ -164,6 +166,7 @@ data class DataPacket(
|
|||
if (rssi != other.rssi) return false
|
||||
if (replyId != other.replyId) return false
|
||||
if (relayNode != other.relayNode) return false
|
||||
if (retryCount != other.retryCount) return false
|
||||
if (emoji != other.emoji) return false
|
||||
|
||||
return true
|
||||
|
|
@ -185,6 +188,7 @@ data class DataPacket(
|
|||
result = 31 * result + rssi
|
||||
result = 31 * result + replyId.hashCode()
|
||||
result = 31 * result + relayNode.hashCode()
|
||||
result = 31 * result + retryCount
|
||||
result = 31 * result + emoji
|
||||
return result
|
||||
}
|
||||
|
|
@ -207,6 +211,7 @@ data class DataPacket(
|
|||
parcel.writeInt(relayNode ?: -1)
|
||||
parcel.writeInt(relays)
|
||||
parcel.writeInt(if (viaMqtt) 1 else 0)
|
||||
parcel.writeInt(retryCount)
|
||||
parcel.writeInt(emoji)
|
||||
}
|
||||
|
||||
|
|
@ -231,6 +236,7 @@ data class DataPacket(
|
|||
relayNode = parcel.readInt().let { if (it == -1) null else it }
|
||||
relays = parcel.readInt()
|
||||
viaMqtt = parcel.readInt() == 1
|
||||
retryCount = parcel.readInt()
|
||||
emoji = parcel.readInt()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
<string name="unrecognized">Unrecognized</string>
|
||||
<string name="message_status_enroute">Waiting to be acknowledged</string>
|
||||
<string name="message_status_queued">Queued for sending</string>
|
||||
<string name="message_retry_count">Retries: %1$d / %2$d</string>
|
||||
<string name="routing_error_none">Acknowledged</string>
|
||||
<string name="routing_error_no_route">No route</string>
|
||||
<string name="routing_error_got_nak">Received a negative acknowledgment</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue