From 9743a2ffcf38ccf2b849c8906c5601cd04fa83b3 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Tue, 5 May 2026 20:56:39 +0000 Subject: [PATCH] Add j1939 VP2 details Add 3 missing unused bytes (for a message len of 8) to the j1939 VP2 struct, as well as range information for the existing parameters. --- .../j1939_vehicle_position_cmn.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/j1939_vehicle_position/j1939_vehicle_position_cmn.h b/j1939_vehicle_position/j1939_vehicle_position_cmn.h index 1c9beb8..f9468bb 100644 --- a/j1939_vehicle_position/j1939_vehicle_position_cmn.h +++ b/j1939_vehicle_position/j1939_vehicle_position_cmn.h @@ -142,42 +142,48 @@ j1939_vp1_set_longitude(struct j1939_vp1_packet *packet, int32_t longitude) /** * struct j1939_vp2_packet - Represents the PGN 64502 Vehicle * Position 2 packet - * FIXME: current packet layout is guessed based on limited information: - * https://www.isobus.net/isobus/pGNAndSPN/10801?type=PGN * * @total_satellites: Total number of satellites in view * - SPN: 8128 * - Data Length: 1 byte + * - Range: 0 to 250 * * @hdop: Horizontal dilution of precision * - SPN: 8129 * - Data Length: 1 byte * - Resolution: 0.1 + * - Range: 0.0 to 25.0 * * @vdop: Vertical dilution of precision * - SPN: 8130 * - Data Length: 1 byte * - Resolution: 0.1 + * - Range: 0.0 to 25.0 * * @pdop: Position dilution of precision * - SPN: 8131 * - Data Length: 1 byte * - Resolution: 0.1 + * - Range: 0.0 to 25.0 * * @tdop: Time dilution of precision * - SPN: 8132 * - Data Length: 1 byte * - Resolution: 0.1 + * - Range: 0.0 to 25.0 * * This structure defines each component of the Vehicle Position 2 as described * in PGN 64502. */ struct j1939_vp2_packet { uint8_t total_satellites; /* SPN 8128 */ - uint8_t hdop; /* SPN 8129 */ - uint8_t vdop; /* SPN 8130 */ - uint8_t pdop; /* SPN 8131 */ - uint8_t tdop; /* SPN 8132 */ + uint8_t hdop; /* SPN 8129 */ + uint8_t vdop; /* SPN 8130 */ + uint8_t pdop; /* SPN 8131 */ + uint8_t tdop; /* SPN 8132 */ + uint8_t unused5; /* Always 0xFF */ + uint8_t unused6; /* Always 0xFF */ + uint8_t unused7; /* Always 0xFF */ } __attribute__((__packed__)); /**