From 0dded69ddcd44982c15b1e5330bd2f1270263102 Mon Sep 17 00:00:00 2001 From: Reinhard Arlt Date: Thu, 21 Aug 2014 15:53:16 +0200 Subject: Fix NME2000 AIS Type 24 handling. --- driver_nmea2000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/driver_nmea2000.c b/driver_nmea2000.c index afc30dc6..3fe2dbdb 100644 --- a/driver_nmea2000.c +++ b/driver_nmea2000.c @@ -854,10 +854,6 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, struct gps_de beam = getleu16(bu, 22); to_starboard = getleu16(bu, 24); to_bow = getleu16(bu, 26); - ais->type24.dim.to_bow = (unsigned int) (to_bow/10); - ais->type24.dim.to_stern = (unsigned int) ((length-to_bow)/10); - ais->type24.dim.to_port = (unsigned int) ((beam-to_starboard)/10); - ais->type24.dim.to_starboard = (unsigned int) (to_starboard/10); if ((length == 0xffff) || (to_bow == 0xffff)) { length = 0; to_bow = 0; @@ -866,6 +862,10 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, struct gps_de beam = 0; to_starboard = 0; } + ais->type24.dim.to_bow = (unsigned int) (to_bow/10); + ais->type24.dim.to_stern = (unsigned int) ((length-to_bow)/10); + ais->type24.dim.to_port = (unsigned int) ((beam-to_starboard)/10); + ais->type24.dim.to_starboard = (unsigned int) (to_starboard/10); } for (i = 0; i < MAX_TYPE24_INTERLEAVE; i++) { -- cgit v1.2.1