diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-11 10:11:25 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-11 10:11:25 -0400 |
commit | 7a7fa9594b5e3ee025362ae56c39fa0dae5c9445 (patch) | |
tree | 8ac35c441f8c2d4ffbc3e210a09cb32d2a78fc71 /drivers.c | |
parent | 3c1b35615925d4597e475a8422e0021ab288f7ed (diff) | |
download | gpsd-7a7fa9594b5e3ee025362ae56c39fa0dae5c9445.tar.gz |
Move the AIVDM context into the main driver structure scratch area.
This allows us to get ride of the AIVDM event hook, because it all
tthat was doing was zeroing a queue index that will now be zeroed
at the time of the device structure initialization.
Diffstat (limited to 'drivers.c')
-rw-r--r-- | drivers.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -1224,20 +1224,20 @@ static bool aivdm_decode(const char *buf, size_t buflen, if (strncmp((const char *)field[0], "!AIVDO", 6) != 0) gpsd_report(session->context->debug, LOG_ERROR, "invalid empty AIS channel. Assuming 'A'\n"); - ais_context = &session->aivdm[0]; - session->aivdm_ais_channel ='A'; + ais_context = &session->driver.aivdm.context[0]; + session->driver.aivdm.ais_channel ='A'; break; case '1': /*@fallthrough@*/ case 'A': - ais_context = &session->aivdm[0]; - session->aivdm_ais_channel ='A'; + ais_context = &session->driver.aivdm.context[0]; + session->driver.aivdm.ais_channel ='A'; break; case '2': /*@fallthrough@*/ case 'B': - ais_context = &session->aivdm[1]; - session->aivdm_ais_channel ='B'; + ais_context = &session->driver.aivdm.context[1]; + session->driver.aivdm.ais_channel ='B'; break; default: gpsd_report(session->context->debug, LOG_ERROR, @@ -1328,12 +1328,6 @@ static bool aivdm_decode(const char *buf, size_t buflen, } /*@ +fixedformalarray +usedef +branchstate @*/ -static void aivdm_event_hook(struct gps_device_t *session, event_t event) -{ - if (event == event_configure) - /*@i1@*/session->aivdm->type24_queue.index = 0; -} - static gps_mask_t aivdm_analyze(struct gps_device_t *session) { if (session->packet.type == AIVDM_PACKET) { @@ -1365,7 +1359,7 @@ const struct gps_type_t aivdm = { .get_packet = generic_get, /* how to get a packet */ .parse_packet = aivdm_analyze, /* how to analyze a packet */ .rtcm_writer = NULL, /* don't send RTCM data, */ - .event_hook = aivdm_event_hook,/* lifetime event handler */ + .event_hook = NULL, /* lifetime event handler */ #ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ |