@@ -51,7 +51,7 @@ struct j1939_vp_err_msg {
5151#define J1939_VP1_PRIO_DEFAULT 6
5252#define J1939_VP1_MAX_TRANSFER_LENGH \
5353 sizeof(struct j1939_vp1_packet)
54- #define J1939_VP1_REPETITION_RATE_MS 5000
54+ #define J1939_VP1_REPETITION_RATE_MS 1000
5555#define J1939_VP1_JITTER_MS 500
5656
5757/**
@@ -63,17 +63,17 @@ struct j1939_vp_err_msg {
6363 * - Data Length: 4 bytes
6464 * - Resolution: 10^-7 deg/bit
6565 * - Offset: -210 degrees
66- * - Range: -210 to +211.1008122 degrees
67- * - Operating Range: -210 degrees (SOUTH) to +211.108122 degrees
66+ * - Range: -210 to +211.10081215 degrees
67+ * - Operating Range: -210 degrees (SOUTH) to +211.1081215 degrees
6868 * (NORTH)
6969 *
7070 * @longitude: Raw longitude position of the vehicle
7171 * - SPN: 585
7272 * - Data Length: 4 bytes
7373 * - Resolution: 10^-7 deg/bit
7474 * - Offset: -210 degrees
75- * - Range: -210 to +211.1008122 degrees
76- * - Operating Range: -210 degrees (WEST) to +211.108122 degrees
75+ * - Range: -210 to +211.10081215 degrees
76+ * - Operating Range: -210 degrees (WEST) to +211.1081215 degrees
7777 * (EAST)
7878 *
7979 * This structure defines each component of the Vehicle Position as described in
@@ -142,42 +142,48 @@ j1939_vp1_set_longitude(struct j1939_vp1_packet *packet, int32_t longitude)
142142/**
143143 * struct j1939_vp2_packet - Represents the PGN 64502 Vehicle
144144 * Position 2 packet
145- * FIXME: current packet layout is guessed based on limited information:
146- * https://www.isobus.net/isobus/pGNAndSPN/10801?type=PGN
147145 *
148146 * @total_satellites: Total number of satellites in view
149147 * - SPN: 8128
150148 * - Data Length: 1 byte
149+ * - Range: 0 to 250
151150 *
152151 * @hdop: Horizontal dilution of precision
153152 * - SPN: 8129
154153 * - Data Length: 1 byte
155154 * - Resolution: 0.1
155+ * - Range: 0.0 to 25.0
156156 *
157157 * @vdop: Vertical dilution of precision
158158 * - SPN: 8130
159159 * - Data Length: 1 byte
160160 * - Resolution: 0.1
161+ * - Range: 0.0 to 25.0
161162 *
162163 * @pdop: Position dilution of precision
163164 * - SPN: 8131
164165 * - Data Length: 1 byte
165166 * - Resolution: 0.1
167+ * - Range: 0.0 to 25.0
166168 *
167169 * @tdop: Time dilution of precision
168170 * - SPN: 8132
169171 * - Data Length: 1 byte
170172 * - Resolution: 0.1
173+ * - Range: 0.0 to 25.0
171174 *
172175 * This structure defines each component of the Vehicle Position 2 as described
173176 * in PGN 64502.
174177 */
175178struct j1939_vp2_packet {
176179 uint8_t total_satellites ; /* SPN 8128 */
177- uint8_t hdop ; /* SPN 8129 */
178- uint8_t vdop ; /* SPN 8130 */
179- uint8_t pdop ; /* SPN 8131 */
180- uint8_t tdop ; /* SPN 8132 */
180+ uint8_t hdop ; /* SPN 8129 */
181+ uint8_t vdop ; /* SPN 8130 */
182+ uint8_t pdop ; /* SPN 8131 */
183+ uint8_t tdop ; /* SPN 8132 */
184+ uint8_t unused5 ; /* Always 0xFF */
185+ uint8_t unused6 ; /* Always 0xFF */
186+ uint8_t unused7 ; /* Always 0xFF */
181187} __attribute__((__packed__ ));
182188
183189/**
0 commit comments