diff options
-rw-r--r-- | driver_nmea.c | 32 | ||||
-rw-r--r-- | gps.h | 8 | ||||
-rw-r--r-- | gpsd.c | 2 | ||||
-rw-r--r-- | gpsd.xml | 26 | ||||
-rw-r--r-- | gpsd_json.c | 26 | ||||
-rw-r--r-- | libgps_core.c | 2 | ||||
-rw-r--r-- | libgps_json.c | 22 |
7 files changed, 59 insertions, 59 deletions
diff --git a/driver_nmea.c b/driver_nmea.c index d7a3eccf..8b481690 100644 --- a/driver_nmea.c +++ b/driver_nmea.c @@ -432,26 +432,26 @@ static gps_mask_t processGPGST(int count, char *field[], struct gps_device_t *se } #define PARSE_FIELD(n) (*field[n] ? atof(field[n]) : NAN) - session->gpsdata.noise_stats.utctime = PARSE_FIELD(1); - session->gpsdata.noise_stats.rms_deviation = PARSE_FIELD(2); - session->gpsdata.noise_stats.smajor_deviation = PARSE_FIELD(3); - session->gpsdata.noise_stats.sminor_deviation = PARSE_FIELD(4); - session->gpsdata.noise_stats.smajor_orientation = PARSE_FIELD(5); - session->gpsdata.noise_stats.lat_err_deviation = PARSE_FIELD(6); - session->gpsdata.noise_stats.lon_err_deviation = PARSE_FIELD(7); - session->gpsdata.noise_stats.alt_err_deviation = PARSE_FIELD(8); + session->gpsdata.gst.utctime = PARSE_FIELD(1); + session->gpsdata.gst.rms_deviation = PARSE_FIELD(2); + session->gpsdata.gst.smajor_deviation = PARSE_FIELD(3); + session->gpsdata.gst.sminor_deviation = PARSE_FIELD(4); + session->gpsdata.gst.smajor_orientation = PARSE_FIELD(5); + session->gpsdata.gst.lat_err_deviation = PARSE_FIELD(6); + session->gpsdata.gst.lon_err_deviation = PARSE_FIELD(7); + session->gpsdata.gst.alt_err_deviation = PARSE_FIELD(8); #undef PARSE_FIELD gpsd_report(LOG_DATA, "GST: utc = %.2f, rms = %.2f, maj = %.2f, min = %.2f, ori = %.2f, lat = %.2f, lon = %.2f, alt = %.2f\n", - session->gpsdata.noise_stats.utctime, - session->gpsdata.noise_stats.rms_deviation, - session->gpsdata.noise_stats.smajor_deviation, - session->gpsdata.noise_stats.sminor_deviation, - session->gpsdata.noise_stats.smajor_orientation, - session->gpsdata.noise_stats.lat_err_deviation, - session->gpsdata.noise_stats.lon_err_deviation, - session->gpsdata.noise_stats.alt_err_deviation); + session->gpsdata.gst.utctime, + session->gpsdata.gst.rms_deviation, + session->gpsdata.gst.smajor_deviation, + session->gpsdata.gst.sminor_deviation, + session->gpsdata.gst.smajor_orientation, + session->gpsdata.gst.lat_err_deviation, + session->gpsdata.gst.lon_err_deviation, + session->gpsdata.gst.alt_err_deviation); return NOISE_IS | ONLINE_IS; } @@ -103,7 +103,7 @@ struct gps_fix_t { /* * The structure describing the pseudorange errors (GPGST) */ -struct noise_t { +struct gst_t { double utctime; double rms_deviation; double smajor_deviation; @@ -1327,7 +1327,7 @@ struct gps_data_t { #define AIS_SET 0x10000000u #define PACKET_SET 0x20000000u #define SUBFRAME_SET 0x40000000u -#define NOISE_SET 0x80000000u +#define GST_SET 0x80000000u double online; /* NZ if GPS is on line, 0 if not. * * Note: gpsd clears this time when sentences @@ -1380,7 +1380,7 @@ struct gps_data_t { char buffer[GPS_BUFFER_MAX * 2]; /* pack things never reported together to reduce structure size */ -#define UNION_SET (RTCM2_SET|RTCM3_SET|SUBFRAME_SET|AIS_SET|VERSION_SET|DEVICELIST_SET|ERROR_SET|NOISE_SET) +#define UNION_SET (RTCM2_SET|RTCM3_SET|SUBFRAME_SET|AIS_SET|VERSION_SET|DEVICELIST_SET|ERROR_SET|GST_SET) union { /* unusual forms of sensor data that might come up the pipe */ struct rtcm2_t rtcm2; @@ -1389,7 +1389,7 @@ struct gps_data_t { struct ais_t ais; struct attitude_t attitude; struct rawdata_t raw; - struct noise_t noise_stats; + struct gst_t gst; /* "artificial" structures for various protocol responses */ struct version_t version; struct { @@ -1181,7 +1181,7 @@ static void handle_request(struct subscriber_t *sub, } if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '\0'; /* trim trailing comma */ - (void)strlcat(reply, "],\"noise_stats\":[", replylen); + (void)strlcat(reply, "],\"gst\":[", replylen); for (devp = devices; devp < devices + MAXDEVICES; devp++) { if (allocated_device(devp) && subscribed(sub, devp)) { if ((devp->observed & GPS_TYPEMASK) != 0) { @@ -701,11 +701,11 @@ will assert the SATELLITE_SET bit in the top-level set member.</para> </varlistentry> <varlistentry> -<term>NOISE</term> +<term>GST</term> <listitem> -<para>A NOISE object is a pseudorange noise report.</para> +<para>A GST object is a pseudorange noise report.</para> -<table frame="all" pgwide="0"><title>NOISE object</title> +<table frame="all" pgwide="0"><title>GST object</title> <tgroup cols="3" align="left" colsep="1" rowsep="1"> <thead> <row> @@ -720,7 +720,7 @@ will assert the SATELLITE_SET bit in the top-level set member.</para> <entry>class</entry> <entry>Yes</entry> <entry>string</entry> - <entry>Fixed: "NOISE"</entry> + <entry>Fixed: "GST"</entry> </row> <row> <entry>tag</entry> @@ -747,51 +747,51 @@ fractional part of up to .01sec precision.</entry> <entry>rms</entry> <entry>No</entry> <entry>numeric</entry> - <entry>value of the standard deviation of the range inputs to the + <entry>Value of the standard deviation of the range inputs to the navigation process (range inputs include pseudoranges and DGPS -corrections)</entry> +corrections).</entry> </row> <row> <entry>major</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Standard deviation of semi-major axis of error ellipse, in meters</entry> + <entry>Standard deviation of semi-major axis of error ellipse, in meters.</entry> </row> <row> <entry>minor</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Standard deviation of semi-minor axis of error ellipse, in meters</entry> + <entry>Standard deviation of semi-minor axis of error ellipse, in meters.</entry> </row> <row> <entry>orient</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Orientation of semi-major axis of error ellipse, in degrees from true north</entry> + <entry>Orientation of semi-major axis of error ellipse, in degrees from true north.</entry> </row> <row> <entry>lat</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Standard deviation of latitude error, in meters</entry> + <entry>Standard deviation of latitude error, in meters.</entry> </row> <row> <entry>lon</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Standard deviation of longitude error, in meters</entry> + <entry>Standard deviation of longitude error, in meters.</entry> </row> <row> <entry>alt</entry> <entry>No</entry> <entry>numeric</entry> - <entry>Standard deviation of altitude error, in meters</entry> + <entry>Standard deviation of altitude error, in meters.</entry> </row> </tbody> @@ -801,7 +801,7 @@ corrections)</entry> <para>Here's an example:</para> <programlisting> -{"class":"NOISE","tag":"GST","device":"/dev/ttyUSB0", +{"class":"GST","tag":"GST","device":"/dev/ttyUSB0", "time":"2010-12-07T10:23:07.09Z","rms":2.440, "major":1.660,"minor":1.120,"orient":68.989, "lat":1.600,"lon":1.200,"alt":2.520} diff --git a/gpsd_json.c b/gpsd_json.c index 082a45f0..7df12791 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -208,7 +208,7 @@ void json_noise_dump(const struct gps_data_t *gpsdata, char tbuf[JSON_DATE_MAX+1]; assert(replylen > 2); - (void)strlcpy(reply, "{\"class\":\"NOISE\",", replylen); + (void)strlcpy(reply, "{\"class\":\"GST\",", replylen); (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "\"tag\":\"%s\",", @@ -219,23 +219,23 @@ void json_noise_dump(const struct gps_data_t *gpsdata, (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "\"time\":\"%s\",", - unix_to_iso8601(gpsdata->noise_stats.utctime, tbuf, sizeof(tbuf))); -#define ADD_NOISE_FIELD(tag, field) do { \ - if (isnan(gpsdata->noise_stats.field) == 0) \ + unix_to_iso8601(gpsdata->gst.utctime, tbuf, sizeof(tbuf))); +#define ADD_GST_FIELD(tag, field) do { \ + if (isnan(gpsdata->gst.field) == 0) \ (void)snprintf(reply + strlen(reply), \ replylen - strlen(reply), \ - "\"" tag "\":%.3f,", gpsdata->noise_stats.field); \ + "\"" tag "\":%.3f,", gpsdata->gst.field); \ } while(0) - ADD_NOISE_FIELD("rms", rms_deviation); - ADD_NOISE_FIELD("major", smajor_deviation); - ADD_NOISE_FIELD("minor", sminor_deviation); - ADD_NOISE_FIELD("orient", smajor_orientation); - ADD_NOISE_FIELD("lat", lat_err_deviation); - ADD_NOISE_FIELD("lon", lon_err_deviation); - ADD_NOISE_FIELD("alt", alt_err_deviation); + ADD_GST_FIELD("rms", rms_deviation); + ADD_GST_FIELD("major", smajor_deviation); + ADD_GST_FIELD("minor", sminor_deviation); + ADD_GST_FIELD("orient", smajor_orientation); + ADD_GST_FIELD("lat", lat_err_deviation); + ADD_GST_FIELD("lon", lon_err_deviation); + ADD_GST_FIELD("alt", alt_err_deviation); -#undef ADD_NOISE_FIELD +#undef ADD_GST_FIELD if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '\0'; /* trim trailing comma */ diff --git a/libgps_core.c b/libgps_core.c index 293b9f3a..3cb523f3 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -756,7 +756,7 @@ int main(int argc, char *argv[]) sizeof(struct rtcm3_t), sizeof(struct ais_t), sizeof(struct attitude_t), sizeof(struct rawdata_t), sizeof(collect.devices), sizeof(struct policy_t), - sizeof(struct version_t), sizeof(struct noise_t)); + sizeof(struct version_t), sizeof(struct gst_t)); exit(0); case 'D': debug = atoi(optarg); diff --git a/libgps_json.c b/libgps_json.c index 611e9917..fbce7f19 100644 --- a/libgps_json.c +++ b/libgps_json.c @@ -129,26 +129,26 @@ static int json_noise_read(const char *buf, struct gps_data_t *gpsdata, /*@ -fullinitblock @*/ const struct json_attr_t json_attrs_1[] = { /* *INDENT-OFF* */ - {"class", t_check, .dflt.check = "NOISE"}, + {"class", t_check, .dflt.check = "GST"}, {"device", t_string, .addr.string = gpsdata->dev.path, .len = sizeof(gpsdata->dev.path)}, {"tag", t_string, .addr.string = gpsdata->tag, .len = sizeof(gpsdata->tag)}, {"time", t_string, .addr.string = tbuf, .len = sizeof(tbuf)}, - {"rms", t_real, .addr.real = &gpsdata->noise_stats.rms_deviation, + {"rms", t_real, .addr.real = &gpsdata->gst.rms_deviation, .dflt.real = NAN}, - {"major", t_real, .addr.real = &gpsdata->noise_stats.smajor_deviation, + {"major", t_real, .addr.real = &gpsdata->gst.smajor_deviation, .dflt.real = NAN}, - {"minor", t_real, .addr.real = &gpsdata->noise_stats.sminor_deviation, + {"minor", t_real, .addr.real = &gpsdata->gst.sminor_deviation, .dflt.real = NAN}, - {"orient", t_real, .addr.real = &gpsdata->noise_stats.smajor_orientation, + {"orient", t_real, .addr.real = &gpsdata->gst.smajor_orientation, .dflt.real = NAN}, - {"lat", t_real, .addr.real = &gpsdata->noise_stats.lat_err_deviation, + {"lat", t_real, .addr.real = &gpsdata->gst.lat_err_deviation, .dflt.real = NAN}, - {"lon", t_real, .addr.real = &gpsdata->noise_stats.lon_err_deviation, + {"lon", t_real, .addr.real = &gpsdata->gst.lon_err_deviation, .dflt.real = NAN}, - {"alt", t_real, .addr.real = &gpsdata->noise_stats.alt_err_deviation, + {"alt", t_real, .addr.real = &gpsdata->gst.alt_err_deviation, .dflt.real = NAN}, {NULL}, /* *INDENT-ON* */ @@ -161,12 +161,12 @@ static int json_noise_read(const char *buf, struct gps_data_t *gpsdata, /*@-usedef@*/ if (tbuf[0] == '\0') - gpsdata->noise_stats.utctime = NAN; + gpsdata->gst.utctime = NAN; else - gpsdata->noise_stats.utctime = iso8601_to_unix(tbuf); + gpsdata->gst.utctime = iso8601_to_unix(tbuf); /*@+usedef@*/ - gpsdata->set |= NOISE_SET; + gpsdata->set |= GST_SET; return 0; } |