mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: Propagate reply ID for DataPackets (#2177)
This commit is contained in:
parent
d66b7d5d0f
commit
38b949f9c1
2 changed files with 6 additions and 2 deletions
|
|
@ -131,7 +131,7 @@ data class DataPacket(
|
|||
parcel.readInt(),
|
||||
parcel.readFloat(),
|
||||
parcel.readInt(),
|
||||
if (parcel.readInt() == 0) null else parcel.readInt()
|
||||
parcel.readInt().let { if (it == 0) null else it }
|
||||
)
|
||||
|
||||
@Suppress("CyclomaticComplexMethod")
|
||||
|
|
@ -232,7 +232,8 @@ data class DataPacket(
|
|||
const val PKC_CHANNEL_INDEX = 8
|
||||
|
||||
fun nodeNumToDefaultId(n: Int): String = "!%08x".format(n)
|
||||
fun idToDefaultNodeNum(id: String?): Int? = runCatching { id?.toLong(16)?.toInt() }.getOrNull()
|
||||
fun idToDefaultNodeNum(id: String?): Int? =
|
||||
runCatching { id?.toLong(16)?.toInt() }.getOrNull()
|
||||
|
||||
override fun createFromParcel(parcel: Parcel): DataPacket {
|
||||
return DataPacket(parcel)
|
||||
|
|
|
|||
|
|
@ -692,6 +692,9 @@ class MeshService : Service(), Logging {
|
|||
) {
|
||||
portnumValue = p.dataType
|
||||
payload = ByteString.copyFrom(p.bytes)
|
||||
if (p.replyId != null && p.replyId != 0) {
|
||||
this.replyId = p.replyId!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue