summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-27 10:57:51 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-03-27 10:57:51 -0400
commitd004b6a55f36506cbc5977d817bd4ce3c3903c6f (patch)
treee8d5af24676888fd628887721ce6e3e0b6c98f5d
parent81670f70953c4f99730c51bd17fb0c8a65972fe1 (diff)
downloadgpsd-d004b6a55f36506cbc5977d817bd4ce3c3903c6f.tar.gz
Re-identify most *_IS flags with corresponding *_SET flags.
Required so clients looking at flag masks in data exported via the shared-memory interface will see the right thing. These were separated originally in order to avoid pushing the reqyuired width of the gpsdata.set flag mask over 32 bits. It became 64 bits in the Version 5 API change, so that constraint went away. All regression tests pass.
-rw-r--r--Makefile.am8
-rw-r--r--driver_evermore.c20
-rw-r--r--driver_garmin.c18
-rw-r--r--driver_garmin_txt.c18
-rw-r--r--driver_geostar.c12
-rw-r--r--driver_italk.c16
-rw-r--r--driver_navcom.c16
-rw-r--r--driver_nmea.c110
-rw-r--r--driver_oncore.c16
-rw-r--r--driver_proto.c14
-rw-r--r--driver_sirf.c40
-rw-r--r--driver_superstar2.c18
-rw-r--r--driver_tsip.c60
-rw-r--r--driver_ubx.c18
-rw-r--r--driver_zodiac.c12
-rw-r--r--drivers.c14
-rw-r--r--gps.h1
-rw-r--r--gpsctl.c4
-rw-r--r--gpsd.c28
-rw-r--r--gpsd.h-tail44
-rw-r--r--gpsd_json.c14
-rw-r--r--gpsdecode.c6
-rw-r--r--gpsmon.c2
-rw-r--r--gpsutils.c22
-rw-r--r--libgps_shm.c2
-rw-r--r--libgpsd_core.c24
-rw-r--r--maskaudit.py.in37
-rw-r--r--pseudonmea.c12
-rw-r--r--shmexport.c2
-rw-r--r--subframe.c2
30 files changed, 292 insertions, 318 deletions
diff --git a/Makefile.am b/Makefile.am
index 3d1cf3c2..4658ad82 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -173,7 +173,6 @@ libgpsd_c_sources = \
crc24q.c \
gpsd_json.c \
isgps.c \
- gpsd_maskdump.c \
timebase.c \
libgpsd_core.c \
net_dgpsip.c \
@@ -212,7 +211,7 @@ libgpsd_h_sources = \
libgpsd_la_LDFLAGS = $(LIBUSB_LIBS) $(BLUEZ_LIBS)
-BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i gps_maskdump.c gpsd_maskdump.c timebase.h
+BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i gps_maskdump.c timebase.h
$(srcdir)/gpsutils.c $(srcdir)/gpsd.c: $(BUILT_SOURCES)
touch $@
@@ -245,11 +244,6 @@ gps_maskdump.c: gps.h maskaudit.py
$(PYTHON) maskaudit.py -c $(srcdir) >gps_maskdump.c && \
chmod a-w gps_maskdump.c
-gpsd_maskdump.c: gpsd.h maskaudit.py
- rm -f gpsd_maskdump.c && \
- $(PYTHON) maskaudit.py -d >gpsd_maskdump.c && \
- chmod a-w gpsd_maskdump.c
-
timebase.h: $(srcdir)/leapsecond.py $(srcdir)/leapseconds.cache
$(PYTHON) $(srcdir)/leapsecond.py -h $(srcdir)/leapseconds.cache >timebase.h
diff --git a/driver_evermore.c b/driver_evermore.c
index 144a4cf1..8136a877 100644
--- a/driver_evermore.c
+++ b/driver_evermore.c
@@ -206,13 +206,13 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
session->newdata.mode = MODE_2D;
else {
session->newdata.mode = MODE_3D;
- mask |= ALTITUDE_IS | CLIMB_IS;
+ mask |= ALTITUDE_SET | CLIMB_SET;
}
- mask |= TIME_IS | PPSTIME_IS | LATLON_IS | TRACK_IS | SPEED_IS | MODE_IS;
+ mask |= TIME_SET | PPSTIME_IS | LATLON_SET | TRACK_SET | SPEED_SET | MODE_SET;
if (session->subtype[0] == '\0') {
(void)snprintf(session->subtype, sizeof(session->subtype),
"%3.2f", version);
- mask |= DEVICEID_IS;
+ mask |= DEVICEID_SET;
}
gpsd_report(LOG_DATA,
"NDO 0x02: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f mode=%d subtype='%s' mask=%s\n",
@@ -220,7 +220,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
session->newdata.longitude, session->newdata.altitude,
session->newdata.speed, session->newdata.track,
session->newdata.climb, session->newdata.mode,
- session->gpsdata.dev.subtype, gpsd_maskdump(mask));
+ session->gpsdata.dev.subtype, gps_maskdump(mask));
return mask | CLEAR_IS | REPORT_IS;
case 0x04: /* DOP Data Output */
@@ -258,7 +258,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
break;
}
/* that's all the information in this packet */
- mask = TIME_IS | PPSTIME_IS | DOP_IS | MODE_IS | STATUS_IS;
+ mask = TIME_SET | PPSTIME_IS | DOP_SET | MODE_SET | STATUS_SET;
gpsd_report(LOG_DATA,
"DDO 0x04: gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f mode=%d, status=%d mask={TIME| DOP|MODE|STATUS}\n",
session->gpsdata.dop.gdop, session->gpsdata.dop.pdop,
@@ -313,7 +313,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
}
session->gpsdata.satellites_visible = (int)satcnt;
/* that's all the information in this packet */
- mask = SATELLITE_IS | USED_IS;
+ mask = SATELLITE_SET | USED_IS;
gpsd_report(LOG_DATA,
"CSO 0x06: time=%.2f used=%d visible=%d mask={TIME|SATELLITE|USED}\n",
session->newdata.time, session->gpsdata.satellites_used,
@@ -359,21 +359,21 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
#undef UBITS
gpsd_report(LOG_DATA, "MDO 0x04: time=%.2f mask={TIME|RAW}\n",
session->newdata.time);
- return TIME_IS | PPSTIME_IS | RAW_IS;
+ return TIME_SET | PPSTIME_IS | RAW_IS;
case 0x20: /* LogConfig Info, could be used as a probe for EverMore GPS */
gpsd_report(LOG_IO, "LogConfig EverMore packet, length %zd: %s\n",
datalen, gpsd_hexdump_wrapper(buf2, datalen, LOG_IO));
- return ONLINE_IS;
+ return ONLINE_SET;
case 0x22: /* LogData */
gpsd_report(LOG_IO, "LogData EverMore packet, length %zd: %s\n",
datalen, gpsd_hexdump_wrapper(buf2, datalen, LOG_IO));
- return ONLINE_IS;
+ return ONLINE_SET;
case 0x38: /* ACK */
gpsd_report(LOG_PROG, "EverMore command %02X ACK\n", getub(buf2, 2));
- return ONLINE_IS;
+ return ONLINE_SET;
default:
gpsd_report(LOG_WARN,
diff --git a/driver_garmin.c b/driver_garmin.c
index d2bf60f9..2acc8e55 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -356,9 +356,9 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
gpsd_report(LOG_INF, "Garmin: Product ID: %d, SoftVer: %d.%02d\n",
prod_id, maj_ver, min_ver);
gpsd_report(LOG_INF, "Garmin: Product Desc: %s\n", &buf[4]);
- mask |= DEVICEID_IS;
+ mask |= DEVICEID_SET;
gpsd_report(LOG_DATA, "Garmin: PRODUCT_DATA: subtype=%s mask=%s\n",
- session->subtype, gpsd_maskdump(mask));
+ session->subtype, gps_maskdump(mask));
break;
case GARMIN_PKTID_PVT_DATA:
gpsd_report(LOG_PROG, "Garmin: Appl, PVT Data Sz: %d\n", pkt_len);
@@ -478,8 +478,8 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
if (session->newdata.mode > MODE_NO_FIX) {
/* data only valid with a fix */
mask |=
- TIME_IS | LATLON_IS | ALTITUDE_IS | STATUS_IS | MODE_IS |
- SPEED_IS | TRACK_IS | CLIMB_IS | HERR_IS | VERR_IS | PERR_IS |
+ TIME_SET | LATLON_SET | ALTITUDE_SET | STATUS_SET | MODE_SET |
+ SPEED_SET | TRACK_SET | CLIMB_SET | HERR_SET | VERR_SET | PERR_IS |
CLEAR_IS | REPORT_IS;
/*
* Garmin documentation says we should wait until four good fixes
@@ -504,7 +504,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
session->newdata.epy,
session->newdata.epv,
session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
break;
case GARMIN_PKTID_RMD_DATA:
case GARMIN_PKTID_RMD41_DATA:
@@ -568,11 +568,11 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
}
session->gpsdata.skyview_time = NAN;
- mask |= SATELLITE_IS | USED_IS;
+ mask |= SATELLITE_SET | USED_IS;
gpsd_report(LOG_DATA,
"Garmin: SAT_DATA: visible=%d used=%d mask=%s\n",
session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used, gpsd_maskdump(mask));
+ session->gpsdata.satellites_used, gps_maskdump(mask));
break;
case GARMIN_PKTID_PROTOCOL_ARRAY:
// this packet is never requested, it just comes, in some case
@@ -593,7 +593,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
break;
}
gpsd_report(LOG_IO, "Garmin: PrintSERPacket(, %#02x, %#02x, ) = %s\n",
- pkt_id, pkt_len, gpsd_maskdump(mask));
+ pkt_id, pkt_len, gps_maskdump(mask));
return mask;
}
@@ -1123,7 +1123,7 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
Send_ACK();
/*@ +usedef +compdef @*/
gpsd_report(LOG_IO, "Garmin: garmin_ser_parse( ) = %s\n",
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
return mask;
}
diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c
index fe12588f..74b1ce57 100644
--- a/driver_garmin_txt.c
+++ b/driver_garmin_txt.c
@@ -272,7 +272,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_IS;
+ return ONLINE_SET;
}
session->packet.type = GARMINTXT_PACKET;
@@ -316,13 +316,13 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
session->newdata.time =
(timestamp_t)mkgmtime(&session->driver.garmintxt.date) +
session->driver.garmintxt.subseconds;
- mask |= TIME_IS;
+ mask |= TIME_SET;
} 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_IS | STATUS_IS | CLEAR_IS | REPORT_IS;
+ mask |= MODE_SET | STATUS_SET | CLEAR_IS | REPORT_IS;
/* process position */
@@ -384,7 +384,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_IS | STATUS_IS | LATLON_IS;
+ mask |= MODE_SET | STATUS_SET | LATLON_SET;
} while (0);
/* EPH */
@@ -397,7 +397,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
/* 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_IS;
+ mask |= HERR_SET;
} while (0);
/* Altitude */
@@ -408,7 +408,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
&alt))
break;
session->newdata.altitude = alt;
- mask |= ALTITUDE_IS;
+ mask |= ALTITUDE_SET;
} while (0);
/* Velocity */
@@ -428,7 +428,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
if (track < 0.0)
track += 360.0;
session->newdata.track = track;
- mask |= SPEED_IS | TRACK_IS;
+ mask |= SPEED_SET | TRACK_SET;
} while (0);
@@ -440,7 +440,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
&climb))
break;
session->newdata.climb = climb; /* climb in mps */
- mask |= CLIMB_IS;
+ mask |= CLIMB_SET;
} while (0);
gpsd_report(LOG_DATA,
@@ -450,7 +450,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
session->newdata.speed, session->newdata.track,
session->newdata.climb, session->newdata.epx,
session->newdata.epy, session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
diff --git a/driver_geostar.c b/driver_geostar.c
index f6738ffb..738e75aa 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -204,14 +204,14 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
if (ul1 != 0) {
session->gpsdata.status = STATUS_NO_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
} else {
if (session->gpsdata.status < STATUS_FIX) {
session->gpsdata.status = STATUS_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
}
- mask |= TIME_IS | PPSTIME_IS | LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | DOP_IS | USED_IS | REPORT_IS;
+ mask |= TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | DOP_SET | USED_IS | REPORT_IS;
gpsd_report(LOG_INF, "Geographic coordinates %f %g %g %g %g %g\n",
d1,
@@ -247,7 +247,7 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
session->newdata.mode = MODE_NO_FIX;
}
- mask |= MODE_IS | STATUS_IS;
+ mask |= MODE_SET | STATUS_SET;
break;
case 0x22:
ul1 = getleu32(buf, OFFSET(1));
@@ -270,7 +270,7 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
}
}
session->gpsdata.skyview_time = NAN;
- mask |= SATELLITE_IS | USED_IS;
+ mask |= SATELLITE_SET | USED_IS;
break;
case 0x3e:
ul1 = getleu32(buf, OFFSET(1));
@@ -414,7 +414,7 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
/*@ +formattype @*/
gpsd_report(LOG_INF, "Response to Request FW version command: %s\n",
session->subtype);
- mask |= DEVICEID_IS;
+ mask |= DEVICEID_SET;
break;
case 0xc2:
gpsd_report(LOG_INF, "Response to Restart receiver command\n");
diff --git a/driver_italk.c b/driver_italk.c
index 2c29f093..cb8d93d8 100644
--- a/driver_italk.c
+++ b/driver_italk.c
@@ -53,7 +53,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
session->gpsdata.status = STATUS_NO_FIX;
session->newdata.mode = MODE_NO_FIX;
- mask = ONLINE_IS | MODE_IS | STATUS_IS | CLEAR_IS;
+ mask = ONLINE_SET | MODE_SET | STATUS_SET | CLEAR_IS;
/* just bail out if this fix is not marked valid */
if (0 != (pflags & FIX_FLAG_MASK_INVALID)
@@ -63,7 +63,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
session->newdata.time = gpsd_gpstime_resolve(session,
(unsigned short) getles16(buf, 7 + 82),
(unsigned int)getleu32(buf, 7 + 84) / 1000.0);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
epx = (double)(getles32(buf, 7 + 96) / 100.0);
epy = (double)(getles32(buf, 7 + 100) / 100.0);
@@ -73,7 +73,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
evz = (double)(getles32(buf, 7 + 194) / 1000.0);
ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation,
epx, epy, epz, evx, evy, evz);
- mask |= LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | CLIMB_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET;
eph = (double)(getles32(buf, 7 + 252) / 100.0);
/* eph is a circular error, sqrt(epx**2 + epy**2) */
session->newdata.epx = session->newdata.epy = eph / sqrt(2);
@@ -90,7 +90,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
session->gpsdata.dop.pdop = (double)(getleu16(buf, 7 + 60) / 100.0);
session->gpsdata.dop.vdop = (double)(getleu16(buf, 7 + 62) / 100.0);
session->gpsdata.dop.tdop = (double)(getleu16(buf, 7 + 64) / 100.0);
- mask |= DOP_IS;
+ mask |= DOP_SET;
}
if ((pflags & FIX_FLAG_MASK_INVALID) == 0
@@ -115,7 +115,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
session->gpsdata.status, session->gpsdata.dop.gdop,
session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop, session->gpsdata.dop.tdop,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
return mask;
}
@@ -154,7 +154,7 @@ static gps_mask_t decode_itk_prnstatus(struct gps_device_t *session,
}
session->gpsdata.satellites_visible = (int)st;
session->gpsdata.satellites_used = (int)nsv;
- mask = USED_IS | SATELLITE_IS;;
+ mask = USED_IS | SATELLITE_SET;;
gpsd_report(LOG_DATA,
"PRN_STATUS: time=%.2f visible=%d used=%d mask={USED|SATELLITE}\n",
@@ -193,7 +193,7 @@ static gps_mask_t decode_itk_utcionomodel(struct gps_device_t *session,
gpsd_report(LOG_DATA,
"UTC_IONO_MODEL: time=%.2f mask={TIME}\n",
session->newdata.time);
- return TIME_IS | PPSTIME_IS;
+ return TIME_SET | PPSTIME_IS;
}
static gps_mask_t decode_itk_subframe(struct gps_device_t *session,
@@ -368,7 +368,7 @@ static gps_mask_t italk_parse(struct gps_device_t *session,
(void)snprintf(session->gpsdata.tag, sizeof(session->gpsdata.tag),
"ITK-%02x", type);
- return mask | ONLINE_IS;
+ return mask | ONLINE_SET;
}
/*@ -charint @*/
diff --git a/driver_navcom.c b/driver_navcom.c
index e5b66896..c0a79d6e 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -514,10 +514,10 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
#undef VEL_RES
#undef DOP_UNDEFINED
- mask = LATLON_IS | ALTITUDE_IS | CLIMB_IS | SPEED_IS | TRACK_IS
- | STATUS_IS | MODE_IS | USED_IS | HERR_IS | VERR_IS
- | TIMERR_IS | DOP_IS
- | TIME_IS | PPSTIME_IS;
+ mask = LATLON_SET | ALTITUDE_SET | CLIMB_SET | SPEED_SET | TRACK_SET
+ | STATUS_SET | MODE_SET | USED_IS | HERR_SET | VERR_SET
+ | TIMERR_SET | DOP_SET
+ | TIME_SET | PPSTIME_IS;
gpsd_report(LOG_DATA, "PVT 0xb1: time=%.2f, lat=%.2f lon=%.2f alt=%.f "
"speed=%.2f track=%.2f climb=%.2f mode=%d status=%d "
"epx=%.2f epy=%.2f epv=%.2f "
@@ -806,7 +806,7 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
"CS 0x86: visible=%d, used=%d, mask={SATELLITE|STATUS}\n",
session->gpsdata.satellites_visible,
session->gpsdata.satellites_used);
- return SATELLITE_IS | STATUS_IS;
+ return SATELLITE_SET | STATUS_SET;
}
/* Raw Meas. Data Block */
@@ -889,7 +889,7 @@ static gps_mask_t handle_0xb0(struct gps_device_t *session)
static gps_mask_t handle_0xb5(struct gps_device_t *session)
{
if (sizeof(double) == 8) {
- gps_mask_t mask = TIME_IS;
+ gps_mask_t mask = TIME_SET;
union long_double l_d;
unsigned char *buf = session->packet.outbuffer + 3;
uint16_t week = getleu16(buf, 3);
@@ -913,7 +913,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
#ifdef __UNUSED__
session->newdata.eph = hrms * 1.96;
session->newdata.epv = alt_sd * 1.96;
- mask |= (HERR_IS | VERR_IS);
+ mask |= (HERR_SET | VERR_SET);
#endif /* __UNUSED__ */
session->newdata.time = gpsd_gpstime_resolve(session,
(unsigned short)week,
@@ -1072,7 +1072,7 @@ static gps_mask_t handle_0xae(struct gps_device_t *session)
engconfstr, asicstr, swvermaj, swvermin, slsbn, dcser,
dcclass, rfcser, rfcclass);
/*@ +formattype @*/
- return DEVICEID_IS;
+ return DEVICEID_SET;
/*@+modobserver@*/
}
diff --git a/driver_nmea.c b/driver_nmea.c
index 6f6b40f5..ec29f197 100644
--- a/driver_nmea.c
+++ b/driver_nmea.c
@@ -165,14 +165,14 @@ static gps_mask_t processGPRMC(int count, char *field[],
/* copes with Magellan EC-10X, see below */
if (session->gpsdata.status != STATUS_NO_FIX) {
session->gpsdata.status = STATUS_NO_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
if (session->newdata.mode >= MODE_2D) {
session->newdata.mode = MODE_NO_FIX;
- mask |= MODE_IS;
+ mask |= MODE_SET;
}
/* set something nz, so it won't look like an unknown sentence */
- mask |= ONLINE_IS;
+ mask |= ONLINE_SET;
} else if (strcmp(field[2], "A") == 0) {
/*
* The MTK3301, Royaltek RGM-3800, and possibly other
@@ -182,14 +182,14 @@ static gps_mask_t processGPRMC(int count, char *field[],
if (count > 9 && field[1][0] != '\0' && field[9][0] != '\0') {
merge_hhmmss(field[1], session);
merge_ddmmyy(field[9], session);
- mask |= TIME_IS;
+ mask |= TIME_SET;
register_fractional_time(field[0], field[1], session);
}
do_lat_lon(&field[3], &session->newdata);
- mask |= LATLON_IS;
+ mask |= LATLON_SET;
session->newdata.speed = atof(field[7]) * KNOTS_TO_MPS;
session->newdata.track = atof(field[8]);
- mask |= (TRACK_IS | SPEED_IS);
+ mask |= (TRACK_SET | SPEED_SET);
/*
* This copes with GPSes like the Magellan EC-10X that *only* emit
* GPRMC. In this case we set mode and status here so the client
@@ -198,11 +198,11 @@ static gps_mask_t processGPRMC(int count, char *field[],
*/
if (session->gpsdata.status == STATUS_NO_FIX) {
session->gpsdata.status = STATUS_FIX; /* could be DGPS_FIX, we can't tell */
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
if (session->newdata.mode < MODE_2D) {
session->newdata.mode = MODE_2D;
- mask |= MODE_IS;
+ mask |= MODE_SET;
}
}
@@ -215,7 +215,7 @@ static gps_mask_t processGPRMC(int count, char *field[],
session->newdata.speed,
session->newdata.track,
session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
@@ -265,14 +265,14 @@ static gps_mask_t processGPGLL(int count, char *field[],
gpsd_report(LOG_WARN,
"can't use GLL time until after ZDA or RMC has supplied a year.\n");
else {
- mask = TIME_IS;
+ mask = TIME_SET;
}
}
if (strcmp(field[6], "A") == 0 && (count < 8 || *status != 'N')) {
int newstatus = session->gpsdata.status;
do_lat_lon(&field[1], &session->newdata);
- mask |= LATLON_IS;
+ mask |= LATLON_SET;
if (count >= 8 && *status == 'D')
newstatus = STATUS_DGPS_FIX; /* differential */
else
@@ -286,10 +286,10 @@ static gps_mask_t processGPGLL(int count, char *field[],
*/
if (session->newdata.mode < MODE_2D) {
session->newdata.mode = MODE_2D;
- mask |= MODE_IS;
+ mask |= MODE_SET;
}
session->gpsdata.status = newstatus;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
gpsd_report(LOG_DATA,
@@ -298,7 +298,7 @@ static gps_mask_t processGPGLL(int count, char *field[],
session->newdata.latitude,
session->newdata.longitude,
session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
@@ -326,7 +326,7 @@ static gps_mask_t processGPGGA(int c UNUSED, char *field[],
gps_mask_t mask;
session->gpsdata.status = atoi(field[6]);
- mask = STATUS_IS;
+ mask = STATUS_SET;
/*
* There are some receivers (the Trimble Placer 450 is an example) that
* don't ship a GSA with mode 1 when they lose satellite lock. Instead
@@ -355,10 +355,10 @@ static gps_mask_t processGPGGA(int c UNUSED, char *field[],
gpsd_report(LOG_WARN,
"can't use GGA time until after ZDA or RMC has supplied a year.\n");
else {
- mask |= TIME_IS;
+ mask |= TIME_SET;
}
do_lat_lon(&field[2], &session->newdata);
- mask |= LATLON_IS;
+ mask |= LATLON_SET;
session->gpsdata.satellites_used = atoi(field[7]);
altitude = field[9];
/*
@@ -370,11 +370,11 @@ static gps_mask_t processGPGGA(int c UNUSED, char *field[],
if (session->newdata.mode == MODE_3D) {
session->newdata.mode =
session->gpsdata.status ? MODE_2D : MODE_NO_FIX;
- mask |= MODE_IS;
+ mask |= MODE_SET;
}
} else {
session->newdata.altitude = atof(altitude);
- mask |= ALTITUDE_IS;
+ mask |= ALTITUDE_SET;
/*
* This is a bit dodgy. Technically we shouldn't set the mode
* bit until we see GSA. But it may be later in the cycle,
@@ -384,7 +384,7 @@ static gps_mask_t processGPGGA(int c UNUSED, char *field[],
*/
if (session->newdata.mode < MODE_3D) {
session->newdata.mode = MODE_3D;
- mask |= MODE_IS;
+ mask |= MODE_SET;
}
}
if (strlen(field[11]) > 0) {
@@ -402,7 +402,7 @@ static gps_mask_t processGPGGA(int c UNUSED, char *field[],
session->newdata.longitude,
session->newdata.altitude,
session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
@@ -449,7 +449,7 @@ static gps_mask_t processGPGST(int count, char *field[], struct gps_device_t *se
session->gpsdata.gst.lon_err_deviation,
session->gpsdata.gst.alt_err_deviation);
- return NOISE_IS | ONLINE_IS;
+ return GST_SET | ONLINE_SET;
}
@@ -479,11 +479,11 @@ static gps_mask_t processGPGSA(int count, char *field[],
* Alarmingly, it's possible this error may be generic to SiRFstarIII.
*/
if (count < 17) {
- gpsd_report(LOG_DATA, "GPGSA: malformed, setting ONLINE_IS only.\n");
- mask = ONLINE_IS;
+ gpsd_report(LOG_DATA, "GPGSA: malformed, setting ONLINE_SET only.\n");
+ mask = ONLINE_SET;
} else if (session->driver.nmea.latch_mode) {
/* last GGA had a non-advancing timestamp; don't trust this GSA */
- mask = ONLINE_IS;
+ mask = ONLINE_SET;
} else {
int i;
session->newdata.mode = atoi(field[2]);
@@ -495,7 +495,7 @@ static gps_mask_t processGPGSA(int count, char *field[],
if (session->newdata.mode == 0 && field[2][0] == 'E')
mask = 0;
else
- mask = MODE_IS;
+ mask = MODE_SET;
gpsd_report(LOG_PROG, "GPGSA sets mode %d\n", session->newdata.mode);
session->gpsdata.dop.pdop = atof(field[15]);
session->gpsdata.dop.hdop = atof(field[16]);
@@ -509,14 +509,14 @@ static gps_mask_t processGPGSA(int count, char *field[],
session->gpsdata.used[session->gpsdata.satellites_used++] =
prn;
}
- mask |= DOP_IS | USED_IS;
+ mask |= DOP_SET | USED_IS;
gpsd_report(LOG_DATA,
"GPGSA: mode=%d used=%d pdop=%.2f hdop=%.2f vdop=%.2f mask=%s\n",
session->newdata.mode,
session->gpsdata.satellites_used,
session->gpsdata.dop.pdop,
session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop, gpsd_maskdump(mask));
+ session->gpsdata.dop.vdop, gps_maskdump(mask));
}
return mask;
}
@@ -543,21 +543,21 @@ static gps_mask_t processGPGSV(int count, char *field[],
count);
gpsd_zero_satellites(&session->gpsdata);
session->gpsdata.satellites_visible = 0;
- return ONLINE_IS;
+ return ONLINE_SET;
}
if (count % 4 != 0) {
gpsd_report(LOG_WARN, "malformed GPGSV - fieldcount %d %% 4 != 0\n",
count);
gpsd_zero_satellites(&session->gpsdata);
session->gpsdata.satellites_visible = 0;
- return ONLINE_IS;
+ return ONLINE_SET;
}
session->driver.nmea.await = atoi(field[1]);
if (sscanf(field[2], "%d", &session->driver.nmea.part) < 1) {
gpsd_report(LOG_WARN, "malformed GPGSV - bad part\n");
gpsd_zero_satellites(&session->gpsdata);
- return ONLINE_IS;
+ return ONLINE_SET;
} else if (session->driver.nmea.part == 1)
gpsd_zero_satellites(&session->gpsdata);
@@ -595,7 +595,7 @@ static gps_mask_t processGPGSV(int count, char *field[],
if (session->driver.nmea.part < session->driver.nmea.await) {
gpsd_report(LOG_PROG, "Partial satellite data (%d of %d).\n",
session->driver.nmea.part, session->driver.nmea.await);
- return ONLINE_IS;
+ return ONLINE_SET;
}
/*
* This sanity check catches an odd behavior of SiRFstarII receivers.
@@ -611,12 +611,12 @@ static gps_mask_t processGPGSV(int count, char *field[],
gpsd_report(LOG_WARN, "Satellite data no good (%d of %d).\n",
session->driver.nmea.part, session->driver.nmea.await);
gpsd_zero_satellites(&session->gpsdata);
- return ONLINE_IS;
+ return ONLINE_SET;
sane:
session->gpsdata.skyview_time = NAN;
gpsd_report(LOG_DATA, "GSV: Satellite data OK (%d of %d).\n",
session->driver.nmea.part, session->driver.nmea.await);
- return SATELLITE_IS;
+ return SATELLITE_SET;
}
static gps_mask_t processPGRME(int c UNUSED, char *field[],
@@ -652,13 +652,13 @@ static gps_mask_t processPGRME(int c UNUSED, char *field[],
atof(field[3]) * (GPSD_CONFIDENCE / CEP50_SIGMA);
session->gpsdata.epe =
atof(field[5]) * (GPSD_CONFIDENCE / CEP50_SIGMA);
- mask = HERR_IS | VERR_IS | PERR_IS;
+ mask = HERR_SET | VERR_SET | PERR_IS;
}
gpsd_report(LOG_DATA, "PGRME: epx=%.2f epy=%.2f epv=%.2f mask=%s\n",
session->newdata.epx,
session->newdata.epy,
- session->newdata.epv, gpsd_maskdump(mask));
+ session->newdata.epv, gps_maskdump(mask));
return mask;
}
@@ -692,8 +692,8 @@ static gps_mask_t processGPGBS(int c UNUSED, char *field[],
gpsd_report(LOG_DATA, "GBS: epx=%.2f epy=%.2f epv=%.2f mask=%s\n",
session->newdata.epx,
session->newdata.epy,
- session->newdata.epv, gpsd_maskdump(HERR_IS | VERR_IS));
- return HERR_IS | VERR_IS;
+ session->newdata.epv, gps_maskdump(HERR_SET | VERR_SET));
+ return HERR_SET | VERR_SET;
} else {
gpsd_report(LOG_PROG,
"second in $GPGBS error estimates doesn't match.\n");
@@ -765,10 +765,10 @@ static gps_mask_t processGPZDA(int c UNUSED, char *field[],
session->driver.nmea.date.tm_year = year - 1900;
session->driver.nmea.date.tm_mon = mon - 1;
session->driver.nmea.date.tm_mday = mday;
- mask = TIME_IS;
+ mask = TIME_SET;
}
};
- gpsd_report(LOG_DATA, "ZDA: mask=%s\n", gpsd_maskdump(mask));
+ gpsd_report(LOG_DATA, "ZDA: mask=%s\n", gps_maskdump(mask));
return mask;
}
@@ -807,7 +807,7 @@ static gps_mask_t processTNTHTM(int c UNUSED, char *field[],
occur as a range.
*/
gps_mask_t mask;
- mask = ONLINE_IS;
+ mask = ONLINE_SET;
session->gpsdata.attitude.heading = atof(field[1]);
session->gpsdata.attitude.mag_st = *field[2];
@@ -828,7 +828,7 @@ static gps_mask_t processTNTHTM(int c UNUSED, char *field[],
session->gpsdata.attitude.acc_z = NAN;
session->gpsdata.attitude.gyro_x = NAN;
session->gpsdata.attitude.gyro_y = NAN;
- mask |= (ATT_IS);
+ mask |= (ATTITUDE_SET);
gpsd_report(LOG_RAW, "time %.3f, heading %lf (%c).\n",
session->newdata.time,
@@ -863,7 +863,7 @@ static gps_mask_t processOHPR(int c UNUSED, char *field[],
*hh mandatory nmea_checksum
*/
gps_mask_t mask;
- mask = ONLINE_IS;
+ mask = ONLINE_SET;
session->gpsdata.attitude.heading = atof(field[1]);
session->gpsdata.attitude.mag_st = '\0';
@@ -886,7 +886,7 @@ static gps_mask_t processOHPR(int c UNUSED, char *field[],
session->gpsdata.attitude.acc_z = atof(field[13]);
session->gpsdata.attitude.gyro_x = atof(field[15]);
session->gpsdata.attitude.gyro_y = atof(field[16]);
- mask |= (ALTITUDE_IS);
+ mask |= (ALTITUDE_SET);
gpsd_report(LOG_RAW, "Heading %lf.\n", session->gpsdata.attitude.heading);
return mask;
@@ -907,7 +907,7 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
session->subtype);
return mask;
} else if (0 == strcmp("POS", field[1])) { /* 3D Position */
- mask |= MODE_IS | STATUS_IS | CLEAR_IS;
+ mask |= MODE_SET | STATUS_SET | CLEAR_IS;
if (0 == strlen(field[2])) {
/* empty first field means no 3D fix is available */
session->gpsdata.status = STATUS_NO_FIX;
@@ -932,9 +932,9 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
session->gpsdata.dop.hdop = atof(field[15]);
session->gpsdata.dop.vdop = atof(field[16]);
session->gpsdata.dop.tdop = atof(field[17]);
- mask |= (TIME_IS | LATLON_IS | ALTITUDE_IS);
- mask |= (SPEED_IS | TRACK_IS | CLIMB_IS);
- mask |= DOP_IS;
+ mask |= (TIME_SET | LATLON_SET | ALTITUDE_SET);
+ mask |= (SPEED_SET | TRACK_SET | CLIMB_SET);
+ mask |= DOP_SET;
gpsd_report(LOG_DATA,
"PASHR,POS: hhmmss=%s lat=%.2f lon=%.2f alt=%.f speed=%.2f track=%.2f climb=%.2f mode=%d status=%d pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f mask=%s\n",
field[4], session->newdata.latitude,
@@ -943,7 +943,7 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
session->newdata.climb, session->newdata.mode,
session->gpsdata.status, session->gpsdata.dop.pdop,
session->gpsdata.dop.hdop, session->gpsdata.dop.vdop,
- session->gpsdata.dop.tdop, gpsd_maskdump(mask));
+ session->gpsdata.dop.tdop, gps_maskdump(mask));
}
} else if (0 == strcmp("SAT", field[1])) { /* Satellite Status */
int i, n, p, u;
@@ -959,9 +959,9 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
}
session->gpsdata.satellites_used = u;
gpsd_report(LOG_DATA, "PASHR,SAT: used=%d mask=%s\n",
- session->gpsdata.satellites_used, gpsd_maskdump(mask));
+ session->gpsdata.satellites_used, gps_maskdump(mask));
session->gpsdata.skyview_time = NAN;
- mask |= SATELLITE_IS | USED_IS;
+ mask |= SATELLITE_SET | USED_IS;
}
return mask;
}
@@ -1050,7 +1050,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
if (strlen(sentence) > NMEA_MAX) {
gpsd_report(LOG_WARN, "Overlong packet of %zd chars rejected.\n",
strlen(sentence));
- return ONLINE_IS;
+ return ONLINE_SET;
}
/*@ -usedef @*//* splint 3.1.1 seems to have a bug here */
@@ -1111,17 +1111,17 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
*/
thistag = i + 1;
} else
- retval = ONLINE_IS; /* unknown sentence */
+ retval = ONLINE_SET; /* unknown sentence */
break;
}
}
/* timestamp recording for fixes happens here */
- if ((retval & TIME_IS) != 0) {
+ if ((retval & TIME_SET) != 0) {
session->newdata.time = gpsd_utc_resolve(session);
/*
* WARNING: This assumes time is always field 0, and that field 0
- * is a timestamp whenever TIME_IS is set.
+ * is a timestamp whenever TIME_SET is set.
*/
gpsd_report(LOG_DATA,
"%s time is %2f = %d-%02d-%02dT%02d:%02d:%02.2fZ\n",
diff --git a/driver_oncore.c b/driver_oncore.c
index 88bc8f39..a90665cf 100644
--- a/driver_oncore.c
+++ b/driver_oncore.c
@@ -77,7 +77,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
if (data_len != 76)
return 0;
- mask = ONLINE_IS;
+ mask = ONLINE_SET;
gpsd_report(LOG_IO, "oncore NAVSOL - navigation data\n");
flags = (unsigned char)getub(buf, 72);
@@ -94,7 +94,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->newdata.mode = MODE_NO_FIX;
session->gpsdata.status = STATUS_NO_FIX;
}
- mask |= MODE_IS;
+ mask |= MODE_SET;
/*@ +predboolothers @*/
/* Unless we have seen non-zero utc offset data, the time is GPS time
@@ -112,7 +112,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
/*@ -unrecog */
session->newdata.time = (timestamp_t)timegm(&unpacked_date) + nsec * 1e-9;
/*@ +unrecog */
- mask |= TIME_IS;
+ mask |= TIME_SET;
gpsd_report(LOG_IO,
"oncore NAVSOL - time: %04d-%02d-%02d %02d:%02d:%02d.%09d\n",
unpacked_date.tm_year + 1900, unpacked_date.tm_mon + 1,
@@ -143,7 +143,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->newdata.speed = speed;
session->newdata.track = track;
- mask |= LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET;
gpsd_zero_satellites(&session->gpsdata);
/* Merge the satellite information from the Bb message. */
@@ -181,7 +181,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
if (status & 0x02)
mask |= PPSTIME_IS;
/*
- * The PPSTIME_IS mask bit exists distinctly from TIME_IS exactly
+ * The PPSTIME_IS mask bit exists distinctly from TIME_SET exactly
* so an OnCore running in time-service mode (and other GPS clocks)
* can signal that it's returning time even though no position fixes
* have been available.
@@ -202,7 +202,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.satellites_used = (int)nsv;
session->gpsdata.satellites_visible = (int)st;
- mask |= SATELLITE_IS | USED_IS;
+ mask |= SATELLITE_SET | USED_IS;
/* Some messages can only be polled. As they are not so
* important, would be enough to poll e.g. one message per cycle.
@@ -220,7 +220,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->newdata.speed, session->newdata.track,
session->newdata.mode, session->gpsdata.status,
session->gpsdata.satellites_used,
- session->gpsdata.satellites_visible, gpsd_maskdump(mask));
+ session->gpsdata.satellites_visible, gps_maskdump(mask));
return mask;
}
@@ -310,7 +310,7 @@ oncore_msg_svinfo(struct gps_device_t *session, unsigned char *buf,
}
gpsd_report(LOG_DATA, "SVINFO: mask={SATELLITE}\n");
- return SATELLITE_IS;
+ return SATELLITE_SET;
}
/**
diff --git a/driver_proto.c b/driver_proto.c
index fdea23b1..3f298a3b 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -78,14 +78,14 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
if ((flags & _PROTO__SOLUTION_VALID) == 0)
return 0;
- mask = ONLINE_IS;
+ mask = ONLINE_SET;
/* extract ECEF navigation solution here */
/* or extract the local tangential plane (ENU) solution */
[Px, Py, Pz, Vx, Vy, Vz] = GET_ECEF_FIX();
ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation,
Px, Py, Pz, Vx, Vy, Vz);
- mask |= LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | CLIMB_IS ;
+ mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET ;
session->newdata.epx = GET_LONGITUDE_ERROR();
session->newdata.epy = GET_LATITUDE_ERROR();
@@ -103,7 +103,7 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
session->gpsdata.dop.hdop = GET_HDOP();
session->gpsdata.dop.vdop = GET_VDOP();
/* other DOP if available */
- mask |= DOP_IS;
+ mask |= DOP_SET;
session->newdata.mode = GET_FIX_MODE();
session->gpsdata.status = GET_FIX_STATUS();
@@ -113,7 +113,7 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
* information. Mix in REPORT_IS when the sentence is reliably
* the last in a reporting cycle.
*/
- mask |= MODE_IS | STATUS_IS | REPORT_IS;
+ mask |= MODE_SET | STATUS_SET | REPORT_IS;
/*
* At the end of each packet-cracking function, report at LOG_DATA level
@@ -127,7 +127,7 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
session->newdata.altitude,
session->newdata.mode,
session->gpsdata.status,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
return mask;
}
@@ -154,7 +154,7 @@ _proto__msg_utctime(struct gps_device_t *session, unsigned char *buf, size_t dat
session->context->leap_seconds = GET_GPS_LEAPSECONDS();
session->newdata.time = gpsd_gpstime_resolve(session, gps_week, tow / 1000.0);
- return TIME_IS | PPSTIME_IS | ONLINE_IS;
+ return TIME_SET | PPSTIME_IS | ONLINE_SET;
}
/**
@@ -212,7 +212,7 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
"SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
session->gpsdata.satellites_visible,
session->gpsdata.satellites_used);
- return SATELLITE_IS | USED_IS;
+ return SATELLITE_SET | USED_IS;
}
/**
diff --git a/driver_sirf.c b/driver_sirf.c
index 975b879e..164a367d 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -428,7 +428,7 @@ static gps_mask_t sirf_msg_swversion(struct gps_device_t *session,
#endif /* ALLOW_RECONFIGURE */
gpsd_report(LOG_DATA, "SiRF: FV MID 0x06: subtype='%s' mask={DEVICEID}\n",
session->subtype);
- return DEVICEID_IS;
+ return DEVICEID_SET;
}
static gps_mask_t sirf_msg_navdata(struct gps_device_t *session,
@@ -521,7 +521,7 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session,
* but presently there's no other way to pass the time to NTP.
*/
session->newdata.time = session->gpsdata.skyview_time;
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
/*
* This time stamp, at 4800bps, is so close to 1 sec old as to
* be confusing to ntpd, but ntpshm_put() will ignore it if a better
@@ -531,7 +531,7 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session,
#endif /* NTPSHM_ENABLE */
gpsd_report(LOG_DATA, "SiRF: MTD 0x04: visible=%d mask={SATELLITE}\n",
session->gpsdata.satellites_visible);
- return SATELLITE_IS | mask;
+ return SATELLITE_SET | mask;
}
#ifdef NTPSHM_ENABLE
@@ -625,7 +625,7 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session,
else if (session->gpsdata.status != 0)
session->newdata.mode = MODE_2D;
if (session->newdata.mode == MODE_3D)
- mask |= ALTITUDE_IS | CLIMB_IS;
+ mask |= ALTITUDE_SET | CLIMB_SET;
gpsd_report(LOG_PROG,
"SiRF: MND 0x02: Navtype = 0x%0x, Status = %d, mode = %d\n",
navtype, session->gpsdata.status, session->newdata.mode);
@@ -647,8 +647,8 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session,
/* fix quality data */
session->gpsdata.dop.hdop = (double)getub(buf, 20) / 5.0;
mask |=
- TIME_IS | LATLON_IS | ALTITUDE_IS | TRACK_IS |
- SPEED_IS | STATUS_IS | MODE_IS | DOP_IS | USED_IS;
+ TIME_SET | LATLON_SET | ALTITUDE_SET | TRACK_SET |
+ SPEED_SET | STATUS_SET | MODE_SET | DOP_SET | USED_IS;
if ( 3 <= session->gpsdata.satellites_visible ) {
mask |= PPSTIME_IS;
}
@@ -659,7 +659,7 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session,
session->newdata.track, session->newdata.speed,
session->newdata.mode, session->gpsdata.status,
session->gpsdata.dop.hdop, session->gpsdata.satellites_used,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
return mask;
}
@@ -716,21 +716,21 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
gpsd_report(LOG_PROG,
"SiRF: GND 0x29: Navtype = 0x%0x, Status = %d, mode = %d\n",
navtype, session->gpsdata.status, session->newdata.mode);
- mask |= STATUS_IS | MODE_IS;
+ mask |= STATUS_SET | MODE_SET;
session->newdata.latitude = getbes32(buf, 23) * 1e-7;
session->newdata.longitude = getbes32(buf, 27) * 1e-7;
if (session->newdata.latitude != 0 && session->newdata.latitude != 0)
- mask |= LATLON_IS;
+ mask |= LATLON_SET;
if ((eph = getbes32(buf, 50) * 1e-2) > 0) {
session->newdata.epx = session->newdata.epy = eph / sqrt(2);
- mask |= HERR_IS;
+ mask |= HERR_SET;
}
if ((session->newdata.epv = getbes32(buf, 54) * 1e-2) > 0)
- mask |= VERR_IS;
+ mask |= VERR_SET;
if ((session->newdata.eps = getbes16(buf, 62) * 1e-2) > 0)
- mask |= SPEEDERR_IS;
+ mask |= SPEEDERR_SET;
/* HDOP should be available at byte 89, but in 231 it's zero. */
//session->gpsdata.dop.hdop = (unsigned int)getub(buf, 89) * 0.2;
@@ -807,9 +807,9 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
session->newdata.track = getbeu16(buf, 42) * 1e-2;
/* skip 2 bytes of magnetic variation */
session->newdata.climb = getbes16(buf, 46) * 1e-2;
- mask |= TIME_IS | SPEED_IS | TRACK_IS;
+ mask |= TIME_SET | SPEED_SET | TRACK_SET;
if (session->newdata.mode == MODE_3D)
- mask |= ALTITUDE_IS | CLIMB_IS;
+ mask |= ALTITUDE_SET | CLIMB_SET;
}
gpsd_report(LOG_DATA,
"SiRF: GND 0x29: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f mode=%d status=%d mask=%s\n",
@@ -820,7 +820,7 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
session->newdata.track,
session->newdata.speed,
session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
#endif /* __UNUSED__ */
@@ -860,8 +860,8 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
return 0;
/* this packet is only sent by uBlox firmware from version 1.32 */
- mask = LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | CLIMB_IS |
- STATUS_IS | MODE_IS | DOP_IS;
+ mask = LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET |
+ STATUS_SET | MODE_SET | DOP_SET;
session->newdata.latitude = (double)getbes32(buf, 1) * RAD_2_DEG * 1e-8;
session->newdata.longitude = (double)getbes32(buf, 5) * RAD_2_DEG * 1e-8;
session->gpsdata.separation =
@@ -891,7 +891,7 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
if (navtype & 0x40) { /* UTC corrected timestamp? */
struct tm unpacked_date;
double subseconds;
- mask |= TIME_IS;
+ mask |= TIME_SET;
if ( 3 <= session->gpsdata.satellites_visible ) {
mask |= PPSTIME_IS;
}
@@ -932,7 +932,7 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
session->gpsdata.status, session->gpsdata.dop.gdop,
session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop, session->gpsdata.dop.tdop,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
return mask;
}
@@ -968,7 +968,7 @@ static gps_mask_t sirf_msg_ppstime(struct gps_device_t *session,
session->driver.sirf.time_seen);
session->driver.sirf.time_seen |= TIME_SEEN_UTC_2;
#endif /* NTPSHM_ENABLE */
- mask |= TIME_IS;
+ mask |= TIME_SET;
if ( 3 <= session->gpsdata.satellites_visible ) {
mask |= PPSTIME_IS;
}
diff --git a/driver_superstar2.c b/driver_superstar2.c
index d8bdfa55..4c895373 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -99,7 +99,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
tm.tm_mon = (int)getub(buf, 15) - 1;
tm.tm_year = (int)getleu16(buf, 16) - 1900;
session->newdata.time = (timestamp_t)timegm(&tm) + (d - tm.tm_sec);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
/* extract the local tangential plane (ENU) solution */
session->newdata.latitude = getled(buf, 18) * RAD_2_DEG;
@@ -108,13 +108,13 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
session->newdata.speed = getlef(buf, 38);
session->newdata.track = getlef(buf, 42) * RAD_2_DEG;
session->newdata.climb = getlef(buf, 54);
- mask |= LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | CLIMB_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET;
session->gpsdata.satellites_used = (int)getub(buf, 71) & 0x0f;
/*@i3@*/ session->gpsdata.dop.hdop = getleu16(buf, 66) * 0.1;
/*@i3@*/ session->gpsdata.dop.vdop = getleu16(buf, 68) * 0.1;
/* other DOP if available */
- mask |= DOP_IS | USED_IS;
+ mask |= DOP_SET | USED_IS;
flags = (unsigned char)getub(buf, 70);
switch (flags & 0x1f) {
@@ -140,7 +140,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
session->newdata.mode = MODE_NO_FIX;
}
- mask |= MODE_IS | STATUS_IS;
+ mask |= MODE_SET | STATUS_SET;
gpsd_report(LOG_DATA,
"NAVSOL_LLA: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d hdop=%.2f hdop=%.2f used=%d mask=%s\n",
session->newdata.time,
@@ -154,7 +154,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
session->gpsdata.status,
session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop,
- session->gpsdata.satellites_used, gpsd_maskdump(mask));
+ session->gpsdata.satellites_used, gps_maskdump(mask));
return mask;
}
@@ -203,7 +203,7 @@ superstar2_msg_svinfo(struct gps_device_t *session,
"SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
session->gpsdata.satellites_visible,
session->gpsdata.satellites_used);
- return SATELLITE_IS | USED_IS;
+ return SATELLITE_SET | USED_IS;
}
static gps_mask_t
@@ -231,7 +231,7 @@ superstar2_msg_version(struct gps_device_t *session,
(void)strlcpy(session->subtype, main_sw, sizeof(session->subtype));
gpsd_report(LOG_DATA, "VERSION: subtype='%s' mask={DEVEICEID}\n",
session->subtype);
- return DEVICEID_IS;
+ return DEVICEID_SET;
}
/**
@@ -267,7 +267,7 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf,
tm.tm_sec = (int)d;
session->newdata.time = (timestamp_t)timegm(&tm);
session->context->leap_seconds = (int)getsb(buf, 20);
- mask = TIME_IS | PPSTIME_IS;
+ mask = TIME_SET | PPSTIME_IS;
}
gpsd_report(LOG_DATA, "TIMING: time=%.2f mask={TIME}\n",
session->newdata.time);
@@ -355,7 +355,7 @@ superstar2_msg_ephemeris(struct gps_device_t *session, unsigned char *buf,
(void)superstar2_write(session, (char *)iono_utc_msg,
sizeof(iono_utc_msg));
- return ONLINE_IS;
+ return ONLINE_SET;
}
diff --git a/driver_tsip.c b/driver_tsip.c
index 368b0dc5..02d27e0c 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -197,7 +197,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->context->valid |= LEAP_SECOND_VALID;
session->newdata.time =
gpsd_gpstime_resolve(session, (unsigned short)s1, (double)f1);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
}
gpsd_report(LOG_INF, "GPS Time %f %d %f\n", f1, s1, f2);
break;
@@ -235,7 +235,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
getub(buf, 7), getub(buf, 8));
/*@ +formattype @*/
gpsd_report(LOG_INF, "Software version: %s\n", session->subtype);
- mask |= DEVICEID_IS;
+ mask |= DEVICEID_SET;
break;
case 0x46: /* Health of Receiver */
if (len != 2)
@@ -245,11 +245,11 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
u2 = getub(buf, 1); /* Antenna/Battery */
if (u1 != (uint8_t) 0) {
session->gpsdata.status = STATUS_NO_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
} else {
if (session->gpsdata.status < STATUS_FIX) {
session->gpsdata.status = STATUS_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
}
gpsd_report(LOG_PROG, "Receiver health %02x %02x\n", u1, u2);
@@ -273,7 +273,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
" %d=%.1f", (int)u1, f1);
}
gpsd_report(LOG_PROG, "Signal Levels (%d):%s\n", count, buf2);
- mask |= SATELLITE_IS;
+ mask |= SATELLITE_SET;
break;
case 0x48: /* GPS System Message */
buf[len] = '\0';
@@ -294,15 +294,15 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
gpsd_gpstime_resolve(session,
(unsigned short)session->context->gps_week,
(double)f2);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
}
- mask |= LATLON_IS | ALTITUDE_IS | CLEAR_IS | REPORT_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | CLEAR_IS | REPORT_IS;
gpsd_report(LOG_DATA, "SPPLLA 0x4a "
"time=%.2f lat=%.2f lon=%.2f alt=%.2f mask=%s\n",
session->newdata.time,
session->newdata.latitude,
session->newdata.longitude,
- session->newdata.altitude, gpsd_maskdump(mask));
+ session->newdata.altitude, gps_maskdump(mask));
break;
case 0x4b: /* Machine/Code ID and Additional Status */
if (len != 3)
@@ -369,13 +369,13 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->newdata.track += 360.0;
gpsd_report(LOG_INF, "GPS Velocity ENU %f %f %f %f %f\n", f1, f2, f3,
f4, f5);
- mask |= SPEED_IS | TRACK_IS | CLIMB_IS;
+ mask |= SPEED_SET | TRACK_SET | CLIMB_SET;
gpsd_report(LOG_DATA, "VFENU 0x56 "
"time=%.2f speed=%.2f track=%.2f climb=%.2f mask=%s\n",
session->newdata.time,
session->newdata.speed,
session->newdata.track,
- session->newdata.climb, gpsd_maskdump(mask));
+ session->newdata.climb, gps_maskdump(mask));
break;
case 0x57: /* Information About Last Computed Fix */
if (len != 8)
@@ -434,7 +434,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
}
if (++i == session->gpsdata.satellites_visible) {
session->gpsdata.skyview_time = NAN;
- mask |= SATELLITE_IS; /* last of the series */
+ mask |= SATELLITE_SET; /* last of the series */
}
if (i > session->gpsdata.satellites_visible)
session->gpsdata.satellites_visible = i;
@@ -471,7 +471,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->newdata.mode = MODE_NO_FIX;
break;
}
- mask |= MODE_IS;
+ mask |= MODE_SET;
#endif /* __UNUSED__ */
session->gpsdata.satellites_used = count;
session->gpsdata.dop.pdop = getbef(buf, 1);
@@ -502,8 +502,8 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop,
session->gpsdata.dop.tdop,
- session->gpsdata.dop.gdop, gpsd_maskdump(mask));
- mask |= DOP_IS | STATUS_IS | USED_IS;
+ session->gpsdata.dop.gdop, gps_maskdump(mask));
+ mask |= DOP_SET | STATUS_SET | USED_IS;
break;
case 0x6e: /* Synchronized Measurements */
break;
@@ -526,11 +526,11 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
/*@ +charint @*/
if (session->gpsdata.status == STATUS_FIX && (u1 & 0x01) != 0) {
session->gpsdata.status = STATUS_DGPS_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
/*@ -charint @*/
gpsd_report(LOG_DATA, "DPFM 0x82 status=%d mask=%s\n",
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
break;
case 0x83: /* Double-Precision XYZ Position Fix and Bias Information */
if (len != 36)
@@ -556,19 +556,19 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
gpsd_gpstime_resolve(session,
(unsigned short)session->context->gps_week,
(double)f1);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
}
gpsd_report(LOG_INF, "GPS DP LLA %f %f %f %f\n",
session->newdata.time,
session->newdata.latitude,
session->newdata.longitude, session->newdata.altitude);
- mask |= LATLON_IS | ALTITUDE_IS | CLEAR_IS | REPORT_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | CLEAR_IS | REPORT_IS;
gpsd_report(LOG_DATA, "DPPLLA 0x84 "
"time=%.2f lat=%.2f lon=%.2f alt=%.2f mask=%s\n",
session->newdata.time,
session->newdata.latitude,
session->newdata.longitude,
- session->newdata.altitude, gpsd_maskdump(mask));
+ session->newdata.altitude, gps_maskdump(mask));
break;
case 0x8f: /* Super Packet. Well... */
/*@ +charint @*/
@@ -653,8 +653,8 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
(unsigned short)s4,
(double)ul1 *1e-3);
mask |=
- TIME_IS | PPSTIME_IS | LATLON_IS | ALTITUDE_IS | SPEED_IS |
- TRACK_IS | CLIMB_IS | STATUS_IS | MODE_IS | CLEAR_IS |
+ TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET |
+ TRACK_SET | CLIMB_SET | STATUS_SET | MODE_SET | CLEAR_IS |
REPORT_IS;
gpsd_report(LOG_DATA,
"SP-LFEI 0x20: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
@@ -664,7 +664,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->newdata.altitude, session->newdata.speed,
session->newdata.track, session->newdata.climb,
session->newdata.mode, session->gpsdata.status,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
break;
case 0x23: /* Compact Super Packet */
session->driver.tsip.req_compact = 0;
@@ -724,8 +724,8 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
if ((session->newdata.track = atan2(d1, d2) * RAD_2_DEG) < 0)
session->newdata.track += 360.0;
mask |=
- TIME_IS | PPSTIME_IS | LATLON_IS | ALTITUDE_IS | SPEED_IS |
- TRACK_IS |CLIMB_IS | STATUS_IS | MODE_IS | CLEAR_IS |
+ TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET |
+ TRACK_SET |CLIMB_SET | STATUS_SET | MODE_SET | CLEAR_IS |
REPORT_IS;
gpsd_report(LOG_DATA,
"SP-CSP 0x23: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
@@ -735,7 +735,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->newdata.altitude, session->newdata.speed,
session->newdata.track, session->newdata.climb,
session->newdata.mode, session->gpsdata.status,
- gpsd_maskdump(mask));
+ gps_maskdump(mask));
break;
case 0xab: /* Thunderbolt Timing Superpacket */
@@ -753,7 +753,7 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
session->context->valid |= LEAP_SECOND_VALID;
session->newdata.time =
gpsd_gpstime_resolve(session, (unsigned short)s1, (double)ul1);
- mask |= TIME_IS | PPSTIME_IS | CLEAR_IS;
+ mask |= TIME_SET | PPSTIME_IS | CLEAR_IS;
gpsd_report(LOG_DATA, "SP-TTS 0xab time=%.2f mask={TIME}\n",
session->newdata.time);
}
@@ -777,11 +777,11 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
u2 = getub(buf, 1); /* Receiver Mode */
if (u1 != (uint8_t) 0) {
session->gpsdata.status = STATUS_NO_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
} else {
if (session->gpsdata.status < STATUS_FIX) {
session->gpsdata.status = STATUS_FIX;
- mask |= STATUS_IS;
+ mask |= STATUS_SET;
}
}
@@ -829,13 +829,13 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
break;
}
- mask |= LATLON_IS | ALTITUDE_IS | MODE_IS | REPORT_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | MODE_SET | REPORT_IS;
gpsd_report(LOG_DATA, "SP-TPS 0xac "
"time=%.2f lat=%.2f lon=%.2f alt=%.2f mask=%s\n",
session->newdata.time,
session->newdata.latitude,
session->newdata.longitude,
- session->newdata.altitude, gpsd_maskdump(mask));
+ session->newdata.altitude, gps_maskdump(mask));
break;
diff --git a/driver_ubx.c b/driver_ubx.c
index c18245eb..d0de67fc 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -74,7 +74,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
tow = (unsigned int)getleu32(buf, 0);
gw = (unsigned short)getles16(buf, 8);
session->newdata.time = gpsd_gpstime_resolve(session, gw, tow / 1000.0);
- mask |= TIME_IS | PPSTIME_IS;
+ mask |= TIME_SET | PPSTIME_IS;
}
epx = (double)(getles32(buf, 12) / 100.0);
@@ -85,7 +85,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
evz = (double)(getles32(buf, 36) / 100.0);
ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation,
epx, epy, epz, evx, evy, evz);
- mask |= LATLON_IS | ALTITUDE_IS | SPEED_IS | TRACK_IS | CLIMB_IS;
+ mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET;
session->newdata.epx = session->newdata.epy =
(double)(getles32(buf, 24) / 100.0) / sqrt(2);
session->newdata.eps = (double)(getles32(buf, 40) / 100.0);
@@ -113,7 +113,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
else if (session->newdata.mode != MODE_NO_FIX)
session->gpsdata.status = STATUS_FIX;
- mask |= MODE_IS | STATUS_IS;
+ mask |= MODE_SET | STATUS_SET;
gpsd_report(LOG_DATA,
"NAVSOL: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d used=%d mask=%s\n",
session->newdata.time,
@@ -125,7 +125,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
session->newdata.climb,
session->newdata.mode,
session->gpsdata.status,
- session->gpsdata.satellites_used, gpsd_maskdump(mask));
+ session->gpsdata.satellites_used, gps_maskdump(mask));
return mask;
}
@@ -156,7 +156,7 @@ ubx_msg_nav_dop(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop,
session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
- return DOP_IS;
+ return DOP_SET;
}
/**
@@ -182,7 +182,7 @@ ubx_msg_nav_timegps(struct gps_device_t *session, unsigned char *buf,
gpsd_report(LOG_DATA, "TIMEGPS: time=%.2f mask={TIME}\n",
session->newdata.time);
- return TIME_IS | PPSTIME_IS;
+ return TIME_SET | PPSTIME_IS;
}
/**
@@ -234,7 +234,7 @@ ubx_msg_nav_svinfo(struct gps_device_t *session, unsigned char *buf,
"SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
session->gpsdata.satellites_visible,
session->gpsdata.satellites_used);
- return SATELLITE_IS | USED_IS;
+ return SATELLITE_SET | USED_IS;
}
/*
@@ -487,7 +487,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
(void)snprintf(session->gpsdata.tag, sizeof(session->gpsdata.tag),
"0x%04hx", msgid);
- return mask | ONLINE_IS;
+ return mask | ONLINE_SET;
}
/*@ -charint @*/
@@ -508,7 +508,7 @@ static gps_mask_t parse_input(struct gps_device_t *session)
}
#ifdef NTPSHM_ENABLE
if (session->context->enable_ntpshm
- && 0 != (st & TIME_IS)
+ && 0 != (st & TIME_SET)
&& (session->gpsdata.fix.time != session->last_fixtime)) {
/* FIXME!! this needs an empirical fudge */
(void)ntpshm_put(session, session->gpsdata.fix.time, 0);
diff --git a/driver_zodiac.c b/driver_zodiac.c
index c76e0b00..ef763759 100644
--- a/driver_zodiac.c
+++ b/driver_zodiac.c
@@ -201,15 +201,15 @@ static gps_mask_t handle1000(struct gps_device_t *session)
/* clock_drift_sd = (int)getzlong(53) * 1e-2; */
mask =
- TIME_IS | PPSTIME_IS | LATLON_IS | ALTITUDE_IS | CLIMB_IS | SPEED_IS |
- TRACK_IS | STATUS_IS | MODE_IS;
+ TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | CLIMB_SET | SPEED_SET |
+ TRACK_SET | STATUS_SET | MODE_SET;
gpsd_report(LOG_DATA,
"1000: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d mask=%s\n",
session->newdata.time, session->newdata.latitude,
session->newdata.longitude, session->newdata.altitude,
session->newdata.track, session->newdata.speed,
session->newdata.climb, session->newdata.mode,
- session->gpsdata.status, gpsd_maskdump(mask));
+ session->gpsdata.status, gps_maskdump(mask));
return mask;
}
@@ -251,7 +251,7 @@ static gps_mask_t handle1002(struct gps_device_t *session)
gpsd_report(LOG_DATA, "1002: visible=%d used=%d mask={SATELLITE|USED}\n",
session->gpsdata.satellites_visible,
session->gpsdata.satellites_used);
- return SATELLITE_IS | USED_IS;
+ return SATELLITE_SET | USED_IS;
}
static gps_mask_t handle1003(struct gps_device_t *session)
@@ -300,7 +300,7 @@ static gps_mask_t handle1003(struct gps_device_t *session)
session->gpsdata.dop.hdop,
session->gpsdata.dop.vdop,
session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
- return SATELLITE_IS | DOP_IS;
+ return SATELLITE_SET | DOP_SET;
}
static void handle1005(struct gps_device_t *session UNUSED)
@@ -329,7 +329,7 @@ static gps_mask_t handle1011(struct gps_device_t *session)
getstringz(session->subtype, session->packet.outbuffer, 19, 28); /* software version field */
gpsd_report(LOG_DATA, "1011: subtype=%s mask={DEVICEID}\n",
session->subtype);
- return DEVICEID_IS;
+ return DEVICEID_SET;
}
diff --git a/drivers.c b/drivers.c
index 94cafebd..864aa65f 100644
--- a/drivers.c
+++ b/drivers.c
@@ -70,7 +70,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
&& session->device_type->event_hook != NULL)
session->device_type->event_hook(session,
event_triggermatch);
- st |= DEVICEID_IS;
+ st |= DEVICEID_SET;
}
}
}
@@ -895,7 +895,7 @@ static gps_mask_t rtcm104v2_analyze(struct gps_device_t *session)
(session->gpsdata.rtcm2.length +
2) * sizeof(isgps30bits_t), LOG_RAW));
session->cycle_end_reliable = true;
- return RTCM2_IS;
+ return RTCM2_SET;
}
/* *INDENT-OFF* */
@@ -944,7 +944,7 @@ static gps_mask_t rtcm104v3_analyze(struct gps_device_t *session)
LOG_RAW));
rtcm3_unpack(&session->gpsdata.rtcm3, (char *)session->packet.outbuffer);
session->cycle_end_reliable = true;
- return RTCM3_IS;
+ return RTCM3_SET;
}
/* *INDENT-OFF* */
@@ -1039,7 +1039,7 @@ static gps_mask_t processMTK3301(struct gps_device_t *session)
(void)strlcat(session->subtype, session->driver.nmea.field[1], sizeof(session->subtype));
(void)strlcat(session->subtype, "-", sizeof(session->subtype));
(void)strlcat(session->subtype, session->driver.nmea.field[2], sizeof(session->subtype));
- return ONLINE_IS;
+ return ONLINE_SET;
case 001: /* ACK / NACK */
reason = atoi(session->driver.nmea.field[2]);
if (atoi(session->driver.nmea.field[1]) == -1)
@@ -1051,7 +1051,7 @@ static gps_mask_t processMTK3301(struct gps_device_t *session)
gpsd_report(LOG_WARN, "MTK ACK: %s\n", session->driver.nmea.field[1]);
break;
default:
- return ONLINE_IS; /* ignore */
+ return ONLINE_SET; /* ignore */
}
}
@@ -1151,9 +1151,9 @@ static gps_mask_t aivdm_analyze(struct gps_device_t *session)
if (aivdm_decode
((char *)session->packet.outbuffer, session->packet.outbuflen,
session->aivdm, &session->gpsdata.ais)) {
- return ONLINE_IS | AIS_IS;
+ return ONLINE_SET | AIS_SET;
} else
- return ONLINE_IS;
+ return ONLINE_SET;
#ifdef NMEA_ENABLE
} else if (session->packet.type == NMEA_PACKET) {
return nmea_parse((char *)session->packet.outbuffer, session);
diff --git a/gps.h b/gps.h
index 3af4d407..012dd053 100644
--- a/gps.h
+++ b/gps.h
@@ -1355,6 +1355,7 @@ struct gps_data_t {
#define POLICY_SET (1llu<<29)
#define LOGMESSAGE_SET (1llu<<30)
#define ERROR_SET (1llu<<31)
+#define SET_HIGH_BIT 31
timestamp_t online; /* NZ if GPS is on line, 0 if not.
*
* Note: gpsd clears this time when sentences
diff --git a/gpsctl.c b/gpsctl.c
index 11c00d78..e24a71b4 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -107,7 +107,7 @@ static gps_mask_t get_packet(struct gps_device_t *session)
/*@ +usedef @*/
fieldmask = gpsd_poll(session);
- if ((fieldmask &~ ONLINE_IS)!=0)
+ if ((fieldmask &~ ONLINE_SET)!=0)
return fieldmask;
}
}
@@ -171,7 +171,7 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata,
gpsd_report(LOG_PROG, "reading...\n");
(void)gps_read(gpsdata);
- if (ERROR_IS & gpsdata->set) {
+ if (ERROR_SET & gpsdata->set) {
gpsd_report(LOG_ERROR, "error '%s'\n", gpsdata->error);
return false;
}
diff --git a/gpsd.c b/gpsd.c
index c9cb79b6..61561a16 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1271,7 +1271,7 @@ static void pseudonmea_report(struct subscriber_t *sub,
char buf[MAX_PACKET_LENGTH * 3 + 2];
gpsd_report(LOG_PROG, "data mask is %s\n",
- gpsd_maskdump(device->gpsdata.set));
+ gps_maskdump(device->gpsdata.set));
if ((changed & REPORT_IS) != 0) {
nmea_tpv_dump(device, buf, sizeof(buf));
@@ -1280,14 +1280,14 @@ static void pseudonmea_report(struct subscriber_t *sub,
(void)throttled_write(sub, buf, strlen(buf));
}
- if ((changed & SATELLITE_IS) != 0) {
+ if ((changed & SATELLITE_SET) != 0) {
nmea_sky_dump(device, buf, sizeof(buf));
gpsd_report(LOG_IO, "<= GPS (binary sky) %s: %s\n",
device->gpsdata.dev.path, buf);
(void)throttled_write(sub, buf, strlen(buf));
}
- if ((changed & SUBFRAME_IS) != 0) {
+ if ((changed & SUBFRAME_SET) != 0) {
nmea_subframe_dump(device, buf, sizeof(buf));
gpsd_report(LOG_IO, "<= GPS (binary subframe) %s: %s\n",
device->gpsdata.dev.path, buf);
@@ -1335,11 +1335,11 @@ static void consume_packets(struct gps_device_t *device)
for (fragments = 0; ; fragments++) {
changed = gpsd_poll(device);
- if (changed == ERROR_IS) {
+ if (changed == ERROR_SET) {
gpsd_report(LOG_WARN,
"device read of %s returned error or packet sniffer failed sync (flags %s)\n",
device->gpsdata.dev.path,
- gpsd_maskdump(changed));
+ gps_maskdump(changed));
deactivate_device(device);
break;
} else if (changed == NODATA_IS) {
@@ -1390,13 +1390,13 @@ static void consume_packets(struct gps_device_t *device)
device->reawake = (timestamp_t)0;
/* must have a full packet to continue */
- if ((changed & PACKET_IS) == 0)
+ if ((changed & PACKET_SET) == 0)
break;
gpsd_report(LOG_DATA,
"packet from %s with %s\n",
device->gpsdata.dev.path,
- gpsd_maskdump(device->gpsdata.set));
+ gps_maskdump(device->gpsdata.set));
#ifdef SOCKET_EXPORT_ENABLE
/* add any just-identified device to watcher lists */
@@ -1415,7 +1415,7 @@ static void consume_packets(struct gps_device_t *device)
}
/* handle laggy response to a firmware version query */
- if ((changed & (DEVICEID_IS | DRIVER_IS)) != 0) {
+ if ((changed & (DEVICEID_SET | DRIVER_IS)) != 0) {
assert(device->device_type != NULL);
{
char id2[GPS_JSON_RESPONSE_MAX];
@@ -1429,7 +1429,7 @@ static void consume_packets(struct gps_device_t *device)
* If the device provided an RTCM packet, stash it
* in the context structure for use as a future correction.
*/
- if ((changed & RTCM2_IS) != 0 || (changed & RTCM3_IS) != 0) {
+ if ((changed & RTCM2_SET) != 0 || (changed & RTCM3_SET) != 0) {
if (device->packet.outbuflen > RTCM_MAX) {
gpsd_report(LOG_ERROR,
"overlong RTCM packet (%zd bytes)\n",
@@ -1458,7 +1458,7 @@ static void consume_packets(struct gps_device_t *device)
*/
if (device->context->enable_ntpshm == 0) {
//gpsd_report(LOG_PROG, "NTP: off\n");
- } else if ((changed & TIME_IS) == 0) {
+ } else if ((changed & TIME_SET) == 0) {
//gpsd_report(LOG_PROG, "NTP: No time this packet\n");
} else if (isnan(device->newdata.time)) {
//gpsd_report(LOG_PROG, "NTP: bad new time\n");
@@ -1485,7 +1485,7 @@ static void consume_packets(struct gps_device_t *device)
* a sentence changes position or mode. Likely to
* cause display jitter.
*/
- if (!device->cycle_end_reliable && (changed & (LATLON_IS | MODE_IS))!=0)
+ if (!device->cycle_end_reliable && (changed & (LATLON_SET | MODE_SET))!=0)
changed |= REPORT_IS;
/* a few things are not per-subscriber reports */
@@ -1508,8 +1508,8 @@ static void consume_packets(struct gps_device_t *device)
}
#ifdef SHM_EXPORT_ENABLE
- if ((changed & (REPORT_IS|NOISE_IS|SATELLITE_IS|SUBFRAME_IS|
- ATT_IS|RTCM2_IS|RTCM3_IS|AIS_IS)) != 0)
+ if ((changed & (REPORT_IS|GST_SET|SATELLITE_SET|SUBFRAME_SET|
+ ATTITUDE_SET|RTCM2_SET|RTCM3_SET|AIS_SET)) != 0)
shm_update(&context, &device->gpsdata);
#endif /* DBUS_EXPORT_ENABLE */
@@ -1528,7 +1528,7 @@ static void consume_packets(struct gps_device_t *device)
if (changed & DATA_IS) {
gpsd_report(LOG_PROG,
"Changed mask: %s with %sreliable cycle detection\n",
- gpsd_maskdump(changed),
+ gps_maskdump(changed),
device->cycle_end_reliable ? "" : "un");
if ((changed & REPORT_IS) != 0)
gpsd_report(LOG_PROG, "time to report a fix\n");
diff --git a/gpsd.h-tail b/gpsd.h-tail
index f8f46b19..f0f01519 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -239,39 +239,17 @@ typedef enum {
event_reactivate,
} event_t;
-#define ONLINE_IS ((gps_mask_t)(1llu<<1))
-#define TIME_IS ((gps_mask_t)(1llu<<2))
-#define TIMERR_IS ((gps_mask_t)(1llu<<3))
-#define LATLON_IS ((gps_mask_t)(1llu<<4))
-#define ALTITUDE_IS ((gps_mask_t)(1llu<<5))
-#define SPEED_IS ((gps_mask_t)(1llu<<6))
-#define TRACK_IS ((gps_mask_t)(1llu<<7))
-#define CLIMB_IS ((gps_mask_t)(1llu<<8))
-#define STATUS_IS ((gps_mask_t)(1llu<<9))
-#define MODE_IS ((gps_mask_t)(1llu<<10))
-#define DOP_IS ((gps_mask_t)(1llu<<11))
-#define HERR_IS ((gps_mask_t)(1llu<<12))
-#define VERR_IS ((gps_mask_t)(1llu<<13))
-#define PERR_IS ((gps_mask_t)(1llu<<14))
-#define SATELLITE_IS ((gps_mask_t)(1llu<<15))
-#define RAW_IS ((gps_mask_t)(1llu<<16))
-#define USED_IS ((gps_mask_t)(1llu<<17))
-#define SPEEDERR_IS ((gps_mask_t)(1llu<<18))
-#define DRIVER_IS ((gps_mask_t)(1llu<<19))
-#define DEVICEID_IS ((gps_mask_t)(1llu<<20))
-#define ERROR_IS ((gps_mask_t)(1llu<<21))
-#define RTCM2_IS ((gps_mask_t)(1llu<<22))
-#define RTCM3_IS ((gps_mask_t)(1llu<<23))
-#define AIS_IS ((gps_mask_t)(1llu<<24))
-#define ATT_IS ((gps_mask_t)(1llu<<25))
-#define SUBFRAME_IS ((gps_mask_t)(1llu<<26))
-#define PACKET_IS ((gps_mask_t)(1llu<<27))
-#define CLEAR_IS ((gps_mask_t)(1llu<<28)) /* starts a reporting cycle */
-#define REPORT_IS ((gps_mask_t)(1llu<<29)) /* ends a reporting cycle */
-#define NOISE_IS ((gps_mask_t)(1llu<<30))
-#define NODATA_IS ((gps_mask_t)(1llu<<31)) /* no data read from fd */
-#define PPSTIME_IS ((gps_mask_t)(1llu<<32)) /* precision time is available */
-#define DATA_IS ~(ONLINE_IS|PACKET_IS|CLEAR_IS|REPORT_IS)
+
+#define INTERNAL_SET(n) ((gps_mask_t)(1llu<<(SET_HIGH_BIT+(n))))
+#define RAW_IS INTERNAL_SET(1) /* raw pseudorange data available */
+#define USED_IS INTERNAL_SET(2) /* sat-used count available */
+#define DRIVER_IS INTERNAL_SET(3) /* driver type identified */
+#define CLEAR_IS INTERNAL_SET(4) /* starts a reporting cycle */
+#define REPORT_IS INTERNAL_SET(5) /* ends a reporting cycle */
+#define NODATA_IS INTERNAL_SET(6) /* no data read from fd */
+#define PPSTIME_IS INTERNAL_SET(7) /* precision time is available */
+#define PERR_IS INTERNAL_SET(8) /* PDOP set */
+#define DATA_IS ~(ONLINE_SET|PACKET_SET|CLEAR_IS|REPORT_IS)
typedef /*@unsignedintegraltype@*/ unsigned int driver_mask_t;
#define DRIVER_NOFLAGS 0x00000000u
diff --git a/gpsd_json.c b/gpsd_json.c
index 806d4471..a7a4299c 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -2265,40 +2265,40 @@ void json_data_report(gps_mask_t changed,
json_tpv_dump(datap, buf+strlen(buf), buflen-strlen(buf));
}
- if ((changed & NOISE_IS) != 0) {
+ if ((changed & GST_SET) != 0) {
json_noise_dump(datap, buf+strlen(buf), buflen-strlen(buf));
}
- if ((changed & SATELLITE_IS) != 0) {
+ if ((changed & SATELLITE_SET) != 0) {
json_sky_dump(datap, buf+strlen(buf), buflen-strlen(buf));
}
- if ((changed & SUBFRAME_IS) != 0) {
+ if ((changed & SUBFRAME_SET) != 0) {
json_subframe_dump(datap, buf+strlen(buf), buflen-strlen(buf));
}
#ifdef COMPASS_ENABLE
- if ((changed & ATT_IS) != 0) {
+ if ((changed & ATTITUDE_SET) != 0) {
json_att_dump(datap, buf+strlen(buf), buflen-strlen(buf));
}
#endif /* COMPASS_ENABLE */
#ifdef RTCM104V2_ENABLE
- if ((changed & RTCM2_IS) != 0) {
+ if ((changed & RTCM2_SET) != 0) {
json_rtcm2_dump(&datap->rtcm2, datap->dev.path,
buf+strlen(buf), buflen-strlen(buf));
}
#endif /* RTCM104V2_ENABLE */
#ifdef RTCM104V3_ENABLE
- if ((changed & RTCM3_IS) != 0) {
+ if ((changed & RTCM3_SET) != 0) {
json_rtcm3_dump(&datap->rtcm3, datap->dev.path,
buf+strlen(buf), buflen-strlen(buf));
}
#endif /* RTCM104V3_ENABLE */
#ifdef AIVDM_ENABLE
- if ((changed & AIS_IS) != 0) {
+ if ((changed & AIS_SET) != 0) {
json_aivdm_dump(&datap->ais, datap->dev.path,
policy->scaled,
buf+strlen(buf), buflen-strlen(buf));
diff --git a/gpsdecode.c b/gpsdecode.c
index a8530688..213f4e55 100644
--- a/gpsdecode.c
+++ b/gpsdecode.c
@@ -381,11 +381,11 @@ static void decode(FILE *fpin, FILE*fpout)
{
gps_mask_t changed = gpsd_poll(&session);
- if (changed == ERROR_IS || changed == NODATA_IS)
+ if (changed == ERROR_SET || changed == NODATA_IS)
break;
if (verbose >= 1 && TEXTUAL_PACKET_TYPE(session.packet.type))
(void)fputs((char *)session.packet.outbuffer, fpout);
- if ((changed & (REPORT_IS|SUBFRAME_IS|AIS_IS|RTCM2_IS|RTCM3_IS)) == 0)
+ if ((changed & (REPORT_IS|SUBFRAME_SET|AIS_SET|RTCM2_SET|RTCM3_SET)) == 0)
continue;
else if (json) {
json_data_report(changed,
@@ -394,7 +394,7 @@ static void decode(FILE *fpin, FILE*fpout)
(void)fputs(buf, fpout);
#ifdef AIVDM_ENABLE
} else if (session.packet.type == AIVDM_PACKET) {
- if ((changed & AIS_IS)!=0) {
+ if ((changed & AIS_SET)!=0) {
aivdm_csv_dump(&session.gpsdata.ais, buf, sizeof(buf));
(void)fputs(buf, fpout);
}
diff --git a/gpsmon.c b/gpsmon.c
index c3ebef33..8239dfac 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -234,7 +234,7 @@ static ssize_t readpkt(void)
if (changed == 0)
longjmp(terminate, TERM_EMPTY_READ);
- if ((changed & ERROR_IS) != 0)
+ if ((changed & ERROR_SET) != 0)
longjmp(terminate, TERM_READ_ERROR);
if (logfile != NULL && session.packet.outbuflen > 0) {
diff --git a/gpsutils.c b/gpsutils.c
index 6fad455a..8919c190 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -45,31 +45,31 @@ void gps_merge_fix( /*@ out @*/ struct gps_fix_t *to,
{
if ((NULL == to) || (NULL == from))
return;
- if ((transfer & TIME_IS) != 0)
+ if ((transfer & TIME_SET) != 0)
to->time = from->time;
- if ((transfer & LATLON_IS) != 0) {
+ if ((transfer & LATLON_SET) != 0) {
to->latitude = from->latitude;
to->longitude = from->longitude;
}
- if ((transfer & MODE_IS) != 0)
+ if ((transfer & MODE_SET) != 0)
to->mode = from->mode;
- if ((transfer & ALTITUDE_IS) != 0)
+ if ((transfer & ALTITUDE_SET) != 0)
to->altitude = from->altitude;
- if ((transfer & TRACK_IS) != 0)
+ if ((transfer & TRACK_SET) != 0)
to->track = from->track;
- if ((transfer & SPEED_IS) != 0)
+ if ((transfer & SPEED_SET) != 0)
to->speed = from->speed;
- if ((transfer & CLIMB_IS) != 0)
+ if ((transfer & CLIMB_SET) != 0)
to->climb = from->climb;
- if ((transfer & TIMERR_IS) != 0)
+ if ((transfer & TIMERR_SET) != 0)
to->ept = from->ept;
- if ((transfer & HERR_IS) != 0) {
+ if ((transfer & HERR_SET) != 0) {
to->epx = from->epx;
to->epy = from->epy;
}
- if ((transfer & VERR_IS) != 0)
+ if ((transfer & VERR_SET) != 0)
to->epv = from->epv;
- if ((transfer & SPEEDERR_IS) != 0)
+ if ((transfer & SPEEDERR_SET) != 0)
to->eps = from->eps;
}
diff --git a/libgps_shm.c b/libgps_shm.c
index f066a7ad..56fe5e5a 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -59,7 +59,7 @@ int gps_shm_read(struct gps_data_t *gpsdata)
* havoc will ensue. asm volatile("sfence") is a GCCism intended
* to prevent reordering.
*
- * This is a simple optimistic-concurrency tachnique. We wrote
+ * This is a simple optimistic-concurrency technique. We wrote
* the second bookend first, then the data, then the first bookend.
* Reader copies what it sees in normal order; that way, if we
* start to write the segment during the read, the second bookend will
diff --git a/libgpsd_core.c b/libgpsd_core.c
index a4bc9815..fa28711e 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -551,7 +551,7 @@ static gps_mask_t fill_dop(const struct gps_data_t * gpsdata, struct dop_t * dop
if (n < 4) {
gpsd_report(LOG_DATA + 2, "Not enough Satellites available %d < 4:\n",
n);
- return 0; /* Is this correct return code here? or should it be ERROR_IS */
+ return 0; /* Is this correct return code here? or should it be ERROR_SET */
}
memset(prod, 0, sizeof(prod));
@@ -642,7 +642,7 @@ static gps_mask_t fill_dop(const struct gps_data_t * gpsdata, struct dop_t * dop
}
/*@ +usedef @*/
- return DOP_IS;
+ return DOP_SET;
}
static void gpsd_error_model(struct gps_device_t *session,
@@ -717,7 +717,7 @@ static void gpsd_error_model(struct gps_device_t *session,
fix->ept = 0.005;
/* Other error computations depend on having a valid fix */
gpsd_report(LOG_DATA, "modeling errors: mode=%d, masks=%s\n",
- fix->mode, gpsd_maskdump(session->gpsdata.set));
+ fix->mode, gps_maskdump(session->gpsdata.set));
if (fix->mode >= MODE_2D) {
if (isnan(fix->epx) != 0 && isfinite(session->gpsdata.dop.hdop) != 0)
fix->epx = session->gpsdata.dop.xdop * h_uere;
@@ -841,7 +841,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
}
} else if (session->getcount++ > 1 && !gpsd_next_hunt_setting(session)) {
gpsd_run_device_hook(session->gpsdata.dev.path, "DEACTIVATE");
- return ERROR_IS;
+ return ERROR_SET;
}
}
@@ -853,7 +853,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->gpsdata.dev.path, newlen,
timestamp() - session->gpsdata.online);
session->gpsdata.online = (timestamp_t)0;
- return ERROR_IS;
+ return ERROR_SET;
} else if (newlen == 0) { /* zero length read, possible EOF */
/*
* Multiplier is 2 to avoid edge effects due to sampling at the exact
@@ -869,9 +869,9 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
} else if (session->packet.outbuflen == 0) { /* got new data, but no packet */
gpsd_report(LOG_RAW + 3, "New data on %s, not yet a packet\n",
session->gpsdata.dev.path);
- return ONLINE_IS;
+ return ONLINE_SET;
} else { /* we have recognized a packet */
- gps_mask_t received = PACKET_IS, dopmask = 0;
+ gps_mask_t received = PACKET_SET, dopmask = 0;
session->gpsdata.online = timestamp();
gpsd_report(LOG_RAW + 3, "Accepted packet on %s.\n",
@@ -928,12 +928,12 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* These will not overwrite any DOPs reported from the packet
* we just got.
*/
- if ((received & SATELLITE_IS) != 0
+ if ((received & SATELLITE_SET) != 0
&& session->gpsdata.satellites_visible > 0) {
dopmask = fill_dop(&session->gpsdata, &session->gpsdata.dop);
session->gpsdata.epe = NAN;
}
- session->gpsdata.set = ONLINE_IS | dopmask | received;
+ session->gpsdata.set = ONLINE_SET | dopmask | received;
/* copy/merge device data into staging buffers */
/*@-nullderef -nullpass@*/
@@ -941,7 +941,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
gps_clear_fix(&session->gpsdata.fix);
/* don't downgrade mode if holding previous fix */
if (session->gpsdata.fix.mode > session->newdata.mode)
- session->gpsdata.set &= ~MODE_IS;
+ session->gpsdata.set &= ~MODE_SET;
//gpsd_report(LOG_PROG,
// "transfer mask on %s: %02x\n", session->gpsdata.tag, session->gpsdata.set);
gps_merge_fix(&session->gpsdata.fix,
@@ -961,7 +961,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* devices output fix packets on a regular basis, even when unable
* to derive a good fix. Such packets should set STATUS_NO_FIX.
*/
- if ((session->gpsdata.set & LATLON_IS) != 0
+ if ((session->gpsdata.set & LATLON_SET) != 0
&& session->gpsdata.status > STATUS_NO_FIX) {
session->context->fixcnt++;
session->fixcnt++;
@@ -976,7 +976,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* driver errors, including 32-vs.-64-bit problems.
*/
/*@+relaxtypes +longunsignedintegral@*/
- if ((session->gpsdata.set & TIME_IS) != 0) {
+ if ((session->gpsdata.set & TIME_SET) != 0) {
if (session->newdata.time > time(NULL) + (60 * 60 * 24 * 365))
gpsd_report(LOG_WARN,
"date more than a year in the future!\n");
diff --git a/maskaudit.py.in b/maskaudit.py.in
index 1360413e..bea8fdd5 100644
--- a/maskaudit.py.in
+++ b/maskaudit.py.in
@@ -5,27 +5,24 @@
#
# With -p, dump a Python status mask list translated from the C one.
#
-# With -c, generate C code to dump client-side masks for debugging purposes.
-#
-# With -d, generate C code to dump demon-side masks for debugging purposes.
+# With -c, generate C code to dump masks for debugging purposes.
#
# With -t, tabulate usage of defines to find unused ones. Requires -c or -d.
import sys, commands, glob, getopt
class SourceExtractor:
- def __init__(self, sourcefile, suffix, clientside):
+ def __init__(self, sourcefile, clientside):
self.sourcefile = sourcefile
- self.suffix = suffix
self.clientside = clientside
self.daemonfiles = ["gpsd.c", "libgpsd_core.c", "pseudonmea.c", "drivers.c"] + glob.glob("driver_*.c") + ["gpsmon.c", "subframe.c"] + glob.glob("monitor_*.c")
self.masks = []
self.primitive_masks = []
for line in file(self.sourcefile):
- if line.startswith("#define") and self.suffix in line:
+ if line.startswith("#define") and ("_SET" in line or "_IS" in line):
fields = line.split()
self.masks.append((fields[1], fields[2]))
- if fields[2].startswith("(1llu<<") or fields[2].startswith("((gps_mask_t)"):
+ if fields[2].startswith("(1llu<<") or fields[2].startswith("INTERNAL_SET"):
self.primitive_masks.append((fields[1], fields[2]))
def in_library(self, flag):
@@ -62,13 +59,13 @@ if __name__ == '__main__':
else:
srcdir = arguments[0]
+ clientside = SourceExtractor(srcdir + "/gps.h", clientside=True)
+ daemonside = SourceExtractor(srcdir + "/gpsd.h", clientside=False)
if clientgen:
- source = SourceExtractor(srcdir + "/gps.h", "_SET", clientside=True)
- prefix = "gps"
+ source = clientside
banner = "Library"
elif daemongen:
- source = SourceExtractor(srcdir + "/gpsd.h", "_IS", clientside=False)
- prefix = "gpsd"
+ source = daemonside
banner = "Daemon"
if tabulate:
@@ -85,8 +82,10 @@ if __name__ == '__main__':
for (d, v) in source.primitive_masks:
if source.relevant(d):
stem = d
- if stem.endswith(source.suffix):
- stem = stem[:-len(source.suffix)]
+ if stem.endswith("_SET"):
+ stem = stem[:-4]
+ if stem.endswith("_IS"):
+ stem = stem[:-3]
maxout += len(stem) + 1
print """/* This code is generated. Do not hand-hack it! */
#include <stdio.h>
@@ -94,17 +93,19 @@ if __name__ == '__main__':
#include \"gpsd.h\"
-const char *%s_maskdump(gps_mask_t set)
+const char *gps_maskdump(gps_mask_t set)
{
static char buf[%d];
const struct {
gps_mask_t mask;
const char *name;
- } *sp, names[] = {""" % (prefix, maxout + 3,)
- for (flag, value) in source.primitive_masks:
+ } *sp, names[] = {""" % (maxout + 3,)
+ for (flag, value) in (clientside.primitive_masks + daemonside.primitive_masks):
stem = flag
- if stem.endswith(source.suffix):
- stem = stem[:-len(source.suffix)]
+ if stem.endswith("_SET"):
+ stem = stem[:-4]
+ if stem.endswith("_IS"):
+ stem = stem[:-3]
print "\t{%s,\t\"%s\"}," % (flag, stem)
print '''\
};
diff --git a/pseudonmea.c b/pseudonmea.c
index 31b094e9..f84dc010 100644
--- a/pseudonmea.c
+++ b/pseudonmea.c
@@ -167,7 +167,7 @@ static void gpsd_binary_quality_dump(struct gps_device_t *session,
char *bufp2 = bufp;
bool used_valid = (session->gpsdata.set & USED_IS) != 0;
- if (session->device_type != NULL && (session->gpsdata.set & MODE_IS) != 0) {
+ if (session->device_type != NULL && (session->gpsdata.set & MODE_SET) != 0) {
(void)snprintf(bufp, len - strlen(bufp),
"$GPGSA,%c,%d,", 'A', session->gpsdata.fix.mode);
j = 0;
@@ -281,17 +281,17 @@ void nmea_tpv_dump(struct gps_device_t *session,
/*@out@*/ char bufp[], size_t len)
{
bufp[0] = '\0';
- if ((session->gpsdata.set & TIME_IS) != 0)
+ if ((session->gpsdata.set & TIME_SET) != 0)
gpsd_binary_time_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
- if ((session->gpsdata.set & LATLON_IS) != 0) {
+ if ((session->gpsdata.set & LATLON_SET) != 0) {
gpsd_position_fix_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
gpsd_transit_fix_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
}
if ((session->gpsdata.set
- & (MODE_IS | DOP_IS | USED_IS | HERR_IS | VERR_IS)) != 0)
+ & (MODE_SET | DOP_SET | USED_IS | HERR_SET | VERR_SET)) != 0)
gpsd_binary_quality_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
}
@@ -301,7 +301,7 @@ void nmea_sky_dump(struct gps_device_t *session,
/*@out@*/ char bufp[], size_t len)
{
bufp[0] = '\0';
- if ((session->gpsdata.set & SATELLITE_IS) != 0)
+ if ((session->gpsdata.set & SATELLITE_SET) != 0)
gpsd_binary_satellite_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
}
@@ -310,7 +310,7 @@ void nmea_subframe_dump(struct gps_device_t *session,
/*@out@*/ char bufp[], size_t len)
{
bufp[0] = '\0';
- if ((session->gpsdata.set & SUBFRAME_IS) != 0)
+ if ((session->gpsdata.set & SUBFRAME_SET) != 0)
gpsd_binary_almanac_dump(session, bufp + strlen(bufp),
len - strlen(bufp));
}
diff --git a/shmexport.c b/shmexport.c
index d881417b..d9aad54c 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -70,7 +70,7 @@ void shm_update(struct gps_context_t *context, struct gps_data_t *gpsdata)
* havoc will ensue. asm volatile("sfence") is a GCCism intended
* to prevent reordering.
*
- * This is a simple optimistic-concurrency tachnique. We write
+ * This is a simple optimistic-concurrency technique. We write
* the second bookend first, then the data, then the first bookend.
* Reader copies what it sees in normal order; that way, if we
* start to write the segment during the read, the second bookend will
diff --git a/subframe.c b/subframe.c
index 25ae45b0..829dc4ff 100644
--- a/subframe.c
+++ b/subframe.c
@@ -821,7 +821,7 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
/* unknown/illegal subframe */
return 0;
}
- return SUBFRAME_IS;
+ return SUBFRAME_SET;
}
/*@ +usedef @*/