From 9c6a42e5c2e00584f30507f8e877462178f9beff Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 9 Sep 2022 22:15:27 -0300 Subject: [PATCH] add waypoint payload parser --- app/src/main/java/com/geeksville/mesh/DataPacket.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/geeksville/mesh/DataPacket.kt b/app/src/main/java/com/geeksville/mesh/DataPacket.kt index b462de0f..c67f42b7 100644 --- a/app/src/main/java/com/geeksville/mesh/DataPacket.kt +++ b/app/src/main/java/com/geeksville/mesh/DataPacket.kt @@ -55,6 +55,12 @@ data class DataPacket( else null + val waypoint: MeshProtos.Waypoint? + get() = if (dataType == Portnums.PortNum.WAYPOINT_APP_VALUE) + MeshProtos.Waypoint.parseFrom(bytes) + else + null + // Autogenerated comparision, because we have a byte array constructor(parcel: Parcel) : this(