diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2008-07-15 21:26:32 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2008-07-15 21:26:32 +0000 |
commit | a1d5b71451e28cafadfe1f050d4d85506d5c31a8 (patch) | |
tree | dc162a4321a72bcc0a85efdd70b773b7611ee14c /drivers.c | |
parent | 2ec103007b9831405703f53ab582b4fc0059312c (diff) | |
download | gpsd-a1d5b71451e28cafadfe1f050d4d85506d5c31a8.tar.gz |
Avoid having to call the RTCM3 unpack function just to get type and length.
Diffstat (limited to 'drivers.c')
-rw-r--r-- | drivers.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -12,6 +12,7 @@ #include "gpsd_config.h" #include "gpsd.h" +#include "bits.h" /* for getuw(), to extract big-endiamn words */ extern struct gps_type_t zodiac_binary; extern struct gps_type_t ubx_binary; @@ -786,10 +787,11 @@ static struct gps_type_t rtcm104v2 = { static gps_mask_t rtcm104v3_analyze(struct gps_device_t *session) { - rtcm3_unpack(&session->gpsdata.rtcm3, (char *)session->packet.inbuffer); - gpsd_report(LOG_RAW, "RTCM 3.x packet type 0x%02x length %d words: %s\n", - session->gpsdata.rtcm3.type, - session->gpsdata.rtcm3.length, + uint length = getuw(session->packet.inbuffer, 1); + uint type = getuw(session->packet.inbuffer, 3) >> 4; + + gpsd_report(LOG_RAW, "RTCM 3.x packet type %d length %d words: %s\n", + type, length, gpsd_hexdump(session->packet.inbuffer, (size_t)(session->gpsdata.rtcm3.length))); return RTCM3_SET; |