summaryrefslogtreecommitdiff
path: root/driver_garmin_txt.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-09 19:17:16 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-09 19:17:16 -0400
commitd6c1a9c97365e69341b6317648d755b523a4b67c (patch)
tree566877db9f5cd729be36be31b44fd0ea0247a1bf /driver_garmin_txt.c
parent542fbcdc813478e817c47a7fc11e4eb5774c2d83 (diff)
downloadgpsd-d6c1a9c97365e69341b6317648d755b523a4b67c.tar.gz
Make the client library and daemon use different sets of state-flag masks.
Large patch, no actual executable code changes except in three debug dumpers. Breaks up the *_SET status macros so the client side continues to use them, but the daemon uses a similarly-named set with an _IS suffix. This frees up two mask bits in both sets - the client side no longer needs to have REPORT_SET and CLEAR_SET bits, and the daemon side no longer needs to have VERSION_SET and POLICY_SET. The only actual code change is that the maskdump.c module, generated by maskaudit.py, splits in half - one child now dumps client-side flags, the other daemon-side flags. One other function call in a debug dumper in libgps_core.c changes. All regression tests pass.
Diffstat (limited to 'driver_garmin_txt.c')
-rw-r--r--driver_garmin_txt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c
index f1834144..8d93ced0 100644
--- a/driver_garmin_txt.c
+++ b/driver_garmin_txt.c
@@ -282,7 +282,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
if (session->packet.outbuflen < 54) {
/* trailing CR and LF can be ignored; ('@' + 54x 'DATA' + '\r\n') has length 57 */
gpsd_report(LOG_WARN, "Message is too short, rejected.\n");
- return ONLINE_SET;
+ return ONLINE_IS;
}
session->packet.type=GARMINTXT_PACKET;
@@ -317,13 +317,13 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
session->driver.nmea.date.tm_sec = (int)result;
session->driver.nmea.subseconds = 0;
session->newdata.time = (double)mkgmtime(&session->driver.nmea.date)+session->driver.nmea.subseconds;
- mask |= TIME_SET;
+ mask |= TIME_IS;
} while (0);
/* assume that possition is unknown; if the position is known we will fix status information later */
session->newdata.mode = MODE_NO_FIX;
session->gpsdata.status = STATUS_NO_FIX;
- mask |= MODE_SET | STATUS_SET | CLEAR_SET | REPORT_SET;
+ mask |= MODE_IS | STATUS_IS | CLEAR_IS | REPORT_IS;
/* process position */
@@ -373,7 +373,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
session->newdata.mode = MODE_NO_FIX;
session->gpsdata.status = STATUS_NO_FIX;
}
- mask |= MODE_SET | STATUS_SET | LATLON_SET;
+ mask |= MODE_IS | STATUS_IS | LATLON_IS;
} while (0);
/* EPH */
@@ -382,7 +382,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
if (0 != gar_decode((char *) session->packet.outbuffer+31, 3, "", 1.0, &eph)) break;
/* eph is a circular error, sqrt(epx**2 + epy**2) */
session->newdata.epx = session->newdata.epy = eph * (1/sqrt(2)) * (GPSD_CONFIDENCE/CEP50_SIGMA);
- mask |= HERR_SET;
+ mask |= HERR_IS;
} while (0);
/* Altitude */
@@ -390,7 +390,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
double alt;
if (0 != gar_decode((char *) session->packet.outbuffer+34, 6, "+-", 1.0, &alt)) break;
session->newdata.altitude = alt;
- mask |= ALTITUDE_SET;
+ mask |= ALTITUDE_IS;
} while (0);
/* Velocity */
@@ -403,7 +403,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
track = atan2(ewvel, nsvel) * RAD_2_DEG; /* is this correct formula? Result is in degrees */
if (track < 0.0) track += 360.0;
session->newdata.track = track;
- mask |= SPEED_SET | TRACK_SET;
+ mask |= SPEED_IS | TRACK_IS;
} while (0);
@@ -412,7 +412,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session)
double climb;
if (0 != gar_decode((char *) session->packet.outbuffer+50, 5, "UD", 100.0, &climb)) break;
session->newdata.climb = climb; /* climb in mps */
- mask |= CLIMB_SET;
+ mask |= CLIMB_IS;
} while (0);
gpsd_report(LOG_DATA, "GTXT: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f exp=%.2f epy=%.2f mode=%d status=%d mask=%s\n",