summaryrefslogtreecommitdiff
path: root/driver_aivdm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-01 08:15:04 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-01 08:15:04 +0000
commitafb11120aba9cbe40e2e3e0f04550833817253e5 (patch)
treec2b2814ec7c0658cfe662d441cdbb7c009dc40a6 /driver_aivdm.c
parent2ca680896b4daea2a9a72e43ccb902e5ea2c9421 (diff)
downloadgpsd-afb11120aba9cbe40e2e3e0f04550833817253e5.tar.gz
More code generation - up to AIS message 13 now.
All regression tests pass.
Diffstat (limited to 'driver_aivdm.c')
-rw-r--r--driver_aivdm.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c
index 7a5b1089..825b6300 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -148,30 +148,30 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
case 1: /* Position Report */
case 2:
case 3:
- ais->type123.status = UBITS(38, 4);
- ais->type123.turn = SBITS(42, 8);
- ais->type123.speed = UBITS(50, 10);
- ais->type123.accuracy = (bool)UBITS(60, 1);
- ais->type123.lon = SBITS(61, 28);
- ais->type123.lat = SBITS(89, 27);
- ais->type123.course = UBITS(116, 12);
- ais->type123.heading = UBITS(128, 9);
- ais->type123.second = UBITS(137, 6);
- ais->type123.maneuver = UBITS(143, 2);
- //ais->type123.spare = UBITS(145, 3);
- ais->type123.raim = UBITS(148, 1)!=0;
- ais->type123.radio = UBITS(149, 20);
+ ais->type1.status = UBITS(38, 4);
+ ais->type1.turn = SBITS(42, 8);
+ ais->type1.speed = UBITS(50, 10);
+ ais->type1.accuracy = (bool)UBITS(60, 1);
+ ais->type1.lon = SBITS(61, 28);
+ ais->type1.lat = SBITS(89, 27);
+ ais->type1.course = UBITS(116, 12);
+ ais->type1.heading = UBITS(128, 9);
+ ais->type1.second = UBITS(137, 6);
+ ais->type1.maneuver = UBITS(143, 2);
+ //ais->type1.spare = UBITS(145, 3);
+ ais->type1.raim = UBITS(148, 1)!=0;
+ ais->type1.radio = UBITS(149, 20);
gpsd_report(LOG_INF,
"Nav=%d TURN=%d SPEED=%d Q=%d Lon=%d Lat=%d COURSE=%d TH=%d Sec=%d\n",
- ais->type123.status,
- ais->type123.turn,
- ais->type123.speed,
- (uint)ais->type123.accuracy,
- ais->type123.lon,
- ais->type123.lat,
- ais->type123.course,
- ais->type123.heading,
- ais->type123.second);
+ ais->type1.status,
+ ais->type1.turn,
+ ais->type1.speed,
+ (uint)ais->type1.accuracy,
+ ais->type1.lon,
+ ais->type1.lat,
+ ais->type1.course,
+ ais->type1.heading,
+ ais->type1.second);
break;
case 4: /* Base Station Report */
case 11: /* UTC/Date Response */
@@ -232,7 +232,7 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
ais->type6.dest_mmsi = UBITS(40, 30);
ais->type6.retransmit = (bool)UBITS(70, 1);
//ais->type6.spare = UBITS(71, 1);
- ais->type6.application_id = UBITS(72, 16);
+ ais->type6.app_id = UBITS(72, 16);
ais->type6.bitcount = ais_context->bitlen - 88;
(void)memcpy(ais->type6.bitdata,
(char *)ais_context->bits+11,
@@ -240,7 +240,7 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
gpsd_report(LOG_INF, "seqno=%d, dest=%u, id=%u, cnt=%u\n",
ais->type6.seqno,
ais->type6.dest_mmsi,
- ais->type6.application_id,
+ ais->type6.app_id,
ais->type6.bitcount);
break;
case 7: /* Binary acknowledge */
@@ -253,13 +253,13 @@ bool aivdm_decode(char *buf, size_t buflen, struct aivdm_context_t *ais_context)
break;
case 8: /* Binary Broadcast Message */
//ais->type8.spare = UBITS(38, 2);
- ais->type8.application_id = UBITS(40, 16);
+ ais->type8.app_id = UBITS(40, 16);
ais->type8.bitcount = ais_context->bitlen - 56;
(void)memcpy(ais->type8.bitdata,
(char *)ais_context->bits+7,
(ais->type8.bitcount + 7) / 8);
gpsd_report(LOG_INF, "id=%u, cnt=%u\n",
- ais->type8.application_id,
+ ais->type8.app_id,
ais->type8.bitcount);
break;
case 9: /* Standard SAR Aircraft Position Report */