mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(release): fixes to prep for release (#4546)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
c5f2b1bbea
commit
80d9a2e0aa
30 changed files with 2324 additions and 312 deletions
|
|
@ -27,6 +27,7 @@ import okio.ByteString
|
|||
import okio.ByteString.Companion.toByteString
|
||||
import org.meshtastic.core.model.util.ByteStringParceler
|
||||
import org.meshtastic.core.model.util.ByteStringSerializer
|
||||
import org.meshtastic.proto.MeshPacket
|
||||
import org.meshtastic.proto.PortNum
|
||||
import org.meshtastic.proto.Waypoint
|
||||
|
||||
|
|
@ -70,6 +71,8 @@ data class DataPacket(
|
|||
@Serializable(with = ByteStringSerializer::class)
|
||||
@TypeParceler<ByteString?, ByteStringParceler>
|
||||
var sfppHash: ByteString? = null,
|
||||
/** The transport mechanism this packet arrived over (see [MeshPacket.TransportMechanism]). */
|
||||
var transportMechanism: Int = 0,
|
||||
) : Parcelable {
|
||||
|
||||
fun readFromParcel(parcel: Parcel) {
|
||||
|
|
@ -108,6 +111,7 @@ data class DataPacket(
|
|||
viaMqtt = parcel.readInt() != 0
|
||||
emoji = parcel.readInt()
|
||||
sfppHash = ByteStringParceler.create(parcel)
|
||||
transportMechanism = parcel.readInt()
|
||||
}
|
||||
|
||||
/** If there was an error with this message, this string describes what was wrong. */
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ data class NodeInfo(
|
|||
var channel: Int = 0,
|
||||
var environmentMetrics: EnvironmentMetrics? = null,
|
||||
var hopsAway: Int = 0,
|
||||
var nodeStatus: String? = null,
|
||||
) : Parcelable {
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
|
|
|
|||
|
|
@ -68,3 +68,9 @@ fun Int.mpsToMph(): Float {
|
|||
val mph = this * MPS_TO_KMPH * KM_TO_MILES
|
||||
return mph
|
||||
}
|
||||
|
||||
/** Returns true if this packet arrived via a LoRa transport mechanism. */
|
||||
fun MeshPacket.isLora(): Boolean = transport_mechanism == MeshPacket.TransportMechanism.TRANSPORT_LORA ||
|
||||
transport_mechanism == MeshPacket.TransportMechanism.TRANSPORT_LORA_ALT1 ||
|
||||
transport_mechanism == MeshPacket.TransportMechanism.TRANSPORT_LORA_ALT2 ||
|
||||
transport_mechanism == MeshPacket.TransportMechanism.TRANSPORT_LORA_ALT3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue