feat: Display relay node information for messages (#3574)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-10-30 17:25:34 -05:00 committed by GitHub
parent 7d1c5cba4c
commit 453dd398d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 840 additions and 16 deletions

View file

@ -61,6 +61,7 @@ data class DataPacket(
var snr: Float = 0f,
var rssi: Int = 0,
var replyId: Int? = null, // If this is a reply to a previous message, this is the ID of that message
var relayNode: Int? = null,
) : Parcelable {
/** If there was an error with this message, this string describes what was wrong. */
@ -133,6 +134,7 @@ data class DataPacket(
parcel.readFloat(),
parcel.readInt(),
parcel.readInt().let { if (it == 0) null else it },
parcel.readInt().let { if (it == -1) null else it },
)
@Suppress("CyclomaticComplexMethod")
@ -156,6 +158,7 @@ data class DataPacket(
if (snr != other.snr) return false
if (rssi != other.rssi) return false
if (replyId != other.replyId) return false
if (relayNode != other.relayNode) return false
return true
}
@ -175,6 +178,7 @@ data class DataPacket(
result = 31 * result + snr.hashCode()
result = 31 * result + rssi
result = 31 * result + replyId.hashCode()
result = 31 * result + relayNode.hashCode()
return result
}
@ -193,6 +197,7 @@ data class DataPacket(
parcel.writeFloat(snr)
parcel.writeInt(rssi)
parcel.writeInt(replyId ?: 0)
parcel.writeInt(relayNode ?: -1)
}
override fun describeContents(): Int = 0
@ -213,6 +218,7 @@ data class DataPacket(
snr = parcel.readFloat()
rssi = parcel.readInt()
replyId = parcel.readInt().let { if (it == 0) null else it }
relayNode = parcel.readInt().let { if (it == -1) null else it }
}
companion object CREATOR : Parcelable.Creator<DataPacket> {