summaryrefslogtreecommitdiff
path: root/driver_geostar.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-27 08:17:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-27 08:17:53 -0400
commit95e1dc568463108afaa55d7afaa3dda50e93b45a (patch)
treef6bfb99d1b174e0a4d9c2485dcb21e83483ae8dc /driver_geostar.c
parent05806755dbd7d671201df03194ddfebca1553a62 (diff)
downloadgpsd-95e1dc568463108afaa55d7afaa3dda50e93b45a.tar.gz
Structure member name change: packet -> lexer. No logic changes.
All regression tests pass.
Diffstat (limited to 'driver_geostar.c')
-rw-r--r--driver_geostar.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/driver_geostar.c b/driver_geostar.c
index 6423dad6..4632c31d 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -108,7 +108,7 @@ static bool geostar_detect(struct gps_device_t *session)
if (select(myfd + 1, &fdset, NULL, NULL, &to) != 1)
break;
if (generic_get(session) >= 0) {
- if (session->packet.type == GEOSTAR_PACKET) {
+ if (session->lexer.type == GEOSTAR_PACKET) {
gpsd_report(session->context->debug, LOG_RAW,
"geostar_detect found\n");
ret = true;
@@ -133,32 +133,32 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
char buf[BUFSIZ];
char buf2[BUFSIZ];
- if (session->packet.type != GEOSTAR_PACKET) {
+ if (session->lexer.type != GEOSTAR_PACKET) {
gpsd_report(session->context->debug, LOG_INF,
"geostar_analyze packet type %d\n",
- session->packet.type);
+ session->lexer.type);
return 0;
}
/*@ +charint @*/
- if (session->packet.outbuflen < 12 || session->packet.outbuffer[0] != 'P')
+ if (session->lexer.outbuflen < 12 || session->lexer.outbuffer[0] != 'P')
return 0;
/* put data part of message in buf */
memset(buf, 0, sizeof(buf));
/* cppcheck-suppress redundantCopy */
- memcpy(buf, session->packet.outbuffer, session->packet.outbuflen);
+ memcpy(buf, session->lexer.outbuffer, session->lexer.outbuflen);
buf2[len = 0] = '\0';
- for (i = 0; i < (int)session->packet.outbuflen; i++) {
+ for (i = 0; i < (int)session->lexer.outbuflen; i++) {
(void)snprintf(buf2 + strlen(buf2),
sizeof(buf2) - strlen(buf2),
- "%02x", buf[len++] = session->packet.outbuffer[i]);
+ "%02x", buf[len++] = session->lexer.outbuffer[i]);
}
/*@ -charint @*/
- id = (unsigned int)getleu16(session->packet.outbuffer, OFFSET(0));
+ id = (unsigned int)getleu16(session->lexer.outbuffer, OFFSET(0));
gpsd_report(session->context->debug, LOG_DATA,
"GeoStar packet id 0x%02x length %d: %s\n", id, len, buf2);
@@ -485,7 +485,7 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
static gps_mask_t geostar_parse_input(struct gps_device_t *session)
{
- if (session->packet.type == GEOSTAR_PACKET) {
+ if (session->lexer.type == GEOSTAR_PACKET) {
return geostar_analyze(session);;
} else
return 0;