summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
commitdf34a3add8df382eb852a67635c6859ee8cc657f (patch)
treec52183ba41403d093ad1ac971fa45c4ba1289f0c
parent9c49083f2afe799343a610912b0ed404b2ffad05 (diff)
downloadgpsd-df34a3add8df382eb852a67635c6859ee8cc657f.tar.gz
gpsd-report() -> gpsd_log()
This change is done so we can add a "log" hook to the pps_thread_t structure (this is not done yet) and harmonize with the name of the outer logging function. If that name had been left as gpsd_report() there would have been scope for bad confusion with the report_hook member. Also, remove two stray duplicative printf calls from the NMEA2000 driver (drivers shouldn't have printfs!) and fix one typo. This is a step towards factoring out ntplib. For that to happen, the PPS thread code needs to be decoupled from the core session structure. No logic changes. Object compatibility preserved. All regression tests pass.
-rw-r--r--SConstruct2
-rw-r--r--doc/explan_gpsd.c.xml23
-rw-r--r--doc/explan_gpsd_report.c.xml11
-rw-r--r--doc/explan_libgpsd_core.c.xml25
-rw-r--r--doc/internals.xml4
-rw-r--r--driver_ais.c74
-rw-r--r--driver_evermore.c91
-rw-r--r--driver_garmin.c452
-rw-r--r--driver_garmin_txt.c52
-rw-r--r--driver_geostar.c247
-rw-r--r--driver_italk.c125
-rw-r--r--driver_navcom.c406
-rw-r--r--driver_nmea0183.c340
-rw-r--r--driver_nmea2000.c269
-rw-r--r--driver_oncore.c86
-rw-r--r--driver_proto.c58
-rw-r--r--driver_rtcm3.c4
-rw-r--r--driver_sirf.c434
-rw-r--r--driver_superstar2.c108
-rw-r--r--driver_tsip.c281
-rw-r--r--driver_ubx.c197
-rw-r--r--driver_zodiac.c58
-rw-r--r--drivers.c154
-rw-r--r--gpsctl.c266
-rw-r--r--gpsd.c536
-rw-r--r--gpsd.h-tail2
-rw-r--r--gpspacket.c4
-rw-r--r--isgps.c56
-rw-r--r--libgpsd_core.c377
-rw-r--r--net_dgpsip.c22
-rw-r--r--net_gnss_dispatch.c6
-rw-r--r--net_ntrip.c118
-rw-r--r--packet.c226
-rw-r--r--ppsthread.c86
-rw-r--r--serial.c86
-rw-r--r--shmexport.c25
-rw-r--r--subframe.c368
-rw-r--r--timebase.c30
-rw-r--r--timehint.c58
-rw-r--r--valgrind-suppressions4
-rw-r--r--www/client-howto.txt6
-rw-r--r--www/writing-a-driver.xml19
42 files changed, 2920 insertions, 2876 deletions
diff --git a/SConstruct b/SConstruct
index 6ec1727d..8e9c89f4 100644
--- a/SConstruct
+++ b/SConstruct
@@ -153,7 +153,7 @@ boolopts = (
("reconfigure", True, "allow gpsd to change device settings"),
("controlsend", True, "allow gpsctl/gpsmon to change device settings"),
("nofloats", False, "float ops are expensive, suppress error estimates"),
- ("squelch", False, "squelch gpsd_report/gpsd_hexdump to save cpu"),
+ ("squelch", False, "squelch gpsd_log/gpsd_hexdump to save cpu"),
# Build control
("shared", True, "build shared libraries, not static"),
("implicit_link", imloads,"implicit linkage is supported in shared libs"),
diff --git a/doc/explan_gpsd.c.xml b/doc/explan_gpsd.c.xml
index 024b4f1f..05c08fc3 100644
--- a/doc/explan_gpsd.c.xml
+++ b/doc/explan_gpsd.c.xml
@@ -47,29 +47,6 @@
0.</para></entry>
</row>
<row>
- <entry><function>void gpsd_report(int errlevel, const char *fmt, ... )</function></entry>
- <entry><para>This code is used for error reporting, but is dependant
- on SQUELCH_DISABLE so that embedded systems (for example) are not
- burdened with unnecessary noise. The first thing to check is if the
- error level offered is high enough to be of interest (controlled by
- the debug level we are running at).</para><para>If we are
- interested, the first step is to protect the code with a mutex if we
- are using the 1PPS input.</para><para>Now we build a message buffer
- which has a fixed header (<quote>gpsd: </quote>) and the incoming
- data. The output buffer is prepared (load the start with a NULL) and
- then the input buffer is scanned, byte-by-byte, up to its
- terminating NULL. The scanned data is transferred on the fly to the
- output buffer subject to the following tests:-</para><para>If the
- character is printable, it passes through unchanged.</para><para>If
- it is a space and either of the next two bytes is NULL it will also
- pass through unchanged.</para><para>In any other case, it is copied
- across as a hexadecimal string like
- <quote>x09</quote>.</para><para>The completed output buffer is then
- either sent to the system logger if we are in background mode
- (daemon) or to the stderr file if we are in foreground
- mode.</para></entry>
-</row>
-<row>
<entry><function>static void usage(void)</function></entry>
<entry><para>Simply print a big list of the invocation parameters to
the default <application>gpsd</application> port (2947, allocated by
diff --git a/doc/explan_gpsd_report.c.xml b/doc/explan_gpsd_report.c.xml
index c9047dc4..b8f94b12 100644
--- a/doc/explan_gpsd_report.c.xml
+++ b/doc/explan_gpsd_report.c.xml
@@ -1,4 +1,4 @@
-<sect1 id="gpsd_report.c"><title><filename>report.c</filename></title>
+<sect1 id="gpsd_log.c"><title><filename>libgpsd_core.c</filename></title>
<informaltable frame='all' pgwide='1'>
<tgroup cols='2'>
<colspec colname='c1'></colspec>
@@ -13,15 +13,16 @@
<tfoot>
<row>
- <entry spanname='s1' align='left'>Notes based on code as of Mon Apr 5 21:38:06 2010 -0400</entry>
+ <entry spanname='s1' align='left'>Notes based on code as of Sat Mar 7 10:11:55 EST 2015</entry>
</row>
</tfoot>
<tbody>
<row>
- <entry><function>void gpsd_report(int errlevel UNUSED, const char *fmt, ... )</function></entry>
- <entry><para>Provides the outputting of strings to stderr for anyone
- who needs it. Used extensively by many functions to report errors or
+ <entry><function>void gpsd_log(struct gpsd_errout_t, int errlevel, const char *fmt, ... )</function></entry>
+ <entry><para>Provides the outputting of strings to stderr or through a
+ specified hook function in the errout structure for anyone
+ who needs it. Used extensively by many functions to log errors or
progress. Responds according to the <function>errlevel</function>
argument, which is filled by the DEBUG command line argument, so
that the verbosity of output is conditional on the user's wishes at
diff --git a/doc/explan_libgpsd_core.c.xml b/doc/explan_libgpsd_core.c.xml
index 2daa7f12..22ad92b3 100644
--- a/doc/explan_libgpsd_core.c.xml
+++ b/doc/explan_libgpsd_core.c.xml
@@ -15,12 +15,35 @@
<tfoot>
<row>
- <entry spanname='s1' align='left'>Notes based on code as of Mon Apr 5 21:38:06 2010 -0400.</entry>
+ <entry spanname='s1' align='left'>Notes based mostly on code as of Mon Apr 5 21:38:06 2010 -040.</entry>
</row>
</tfoot>
<tbody>
<row>
+ <entry><function>void gpsd_log(const struct errout_t, int errlevel, const char *fmt, ... )</function></entry>
+ <entry><para>This code is used for error reporting, but is dependant
+ on SQUELCH_DISABLE so that embedded systems (for example) are not
+ burdened with unnecessary noise. The first thing to check is if the
+ error level offered is high enough to be of interest (controlled by
+ the debug level we are running at).</para><para>If we are
+ interested, the first step is to protect the code with a mutex if we
+ are using the 1PPS input.</para><para>Now we build a message buffer
+ which has a fixed header (<quote>gpsd: </quote>) and the incoming
+ data. The output buffer is prepared (load the start with a NULL) and
+ then the input buffer is scanned, byte-by-byte, up to its
+ terminating NULL. The scanned data is transferred on the fly to the
+ output buffer subject to the following tests:-</para><para>If the
+ character is printable, it passes through unchanged.</para><para>If
+ it is a space and either of the next two bytes is NULL it will also
+ pass through unchanged.</para><para>In any other case, it is copied
+ across as a hexadecimal string like
+ <quote>x09</quote>.</para><para>The completed output buffer is then
+ either sent to the system logger if we are in background mode
+ (daemon) or to the stderr file if we are in foreground
+ mode.</para></entry>
+</row>
+<row>
<entry><function>int gpsd_switch_driver(struct gps_device_t *session, char* typename)</function></entry>
<entry><para>Test if the function is called with the same name as
the active driver.</para><para>If it is, test if the driver has a
diff --git a/doc/internals.xml b/doc/internals.xml
index b209387c..dd5a5ff6 100644
--- a/doc/internals.xml
+++ b/doc/internals.xml
@@ -12,7 +12,7 @@
<!ENTITY gps.h SYSTEM "explan_gps.h.xml">
<!ENTITY gpsd.c SYSTEM "explan_gpsd.c.xml">
<!ENTITY gpsd.h SYSTEM "explan_gpsd.h.xml">
-<!ENTITY gpsd_report.c SYSTEM "explan_gpsd_report.c.xml">
+<!ENTITY gpsd_log.c SYSTEM "explan_gpsd_log.c.xml">
<!ENTITY gpsdclient.c SYSTEM "explan_gpsdclient.c.xml">
<!ENTITY gpsutils.c SYSTEM "explan_gpsutils.c.xml">
<!ENTITY isgps.c SYSTEM "explan_isgps.c.xml">
@@ -93,7 +93,7 @@ is not yet documented here.</para>
&gps.h;
&gpsd.c;
&gpsd.h;
-&gpsd_report.c;
+&gpsd_log.c;
&gpsdclient.c;
&gpsutils.c;
&isgps.c;
diff --git a/driver_ais.c b/driver_ais.c
index 68430894..b08d95cc 100644
--- a/driver_ais.c
+++ b/driver_ais.c
@@ -77,26 +77,26 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type = UBITS(0, 6);
ais->repeat = UBITS(6, 2);
ais->mmsi = UBITS(8, 30);
- gpsd_report(errout, LOG_INF,
- "AIVDM message type %d, MMSI %09d:\n",
- ais->type, ais->mmsi);
+ gpsd_log(errout, LOG_INF,
+ "AIVDM message type %d, MMSI %09d:\n",
+ ais->type, ais->mmsi);
#define PERMISSIVE_LENGTH_CHECK(correct) \
if (bitlen < correct) { \
- gpsd_report(errout, LOG_ERROR, \
- "AIVDM message type %d size < %d bits (%zd).\n", \
- ais->type, correct, bitlen); \
+ gpsd_log(errout, LOG_ERROR, \
+ "AIVDM message type %d size < %d bits (%zd).\n", \
+ ais->type, correct, bitlen); \
return false; \
} else if (bitlen > correct) { \
- gpsd_report(errout, LOG_WARN, \
- "AIVDM message type %d size > %d bits (%zd).\n", \
- ais->type, correct, bitlen); \
+ gpsd_log(errout, LOG_WARN, \
+ "AIVDM message type %d size > %d bits (%zd).\n", \
+ ais->type, correct, bitlen); \
}
#define RANGE_CHECK(min, max) \
if (bitlen < min || bitlen > max) { \
- gpsd_report(errout, LOG_ERROR, \
- "AIVDM message type %d size is out of range (%zd).\n", \
- ais->type, bitlen); \
+ gpsd_log(errout, LOG_ERROR, \
+ "AIVDM message type %d size is out of range (%zd).\n", \
+ ais->type, bitlen); \
return false; \
}
@@ -144,9 +144,9 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
break;
case 5: /* Ship static and voyage related data */
if (bitlen != 424) {
- gpsd_report(errout, LOG_WARN,
- "AIVDM message type 5 size not 424 bits (%zd).\n",
- bitlen);
+ gpsd_log(errout, LOG_WARN,
+ "AIVDM message type 5 size not 424 bits (%zd).\n",
+ bitlen);
/*
* For unknown reasons, a lot of transmitters in the wild ship
* with a length of 420 or 422. This is a recoverable error.
@@ -943,9 +943,9 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
{
struct ais_type24a_t *saveptr = &type24_queue->ships[type24_queue->index];
- gpsd_report(errout, LOG_PROG,
- "AIVDM: 24A from %09u stashed.\n",
- ais->mmsi);
+ gpsd_log(errout, LOG_PROG,
+ "AIVDM: 24A from %09u stashed.\n",
+ ais->mmsi);
saveptr->mmsi = ais->mmsi;
UCHARS(40, saveptr->shipname);
++type24_queue->index;
@@ -990,9 +990,9 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
(void)strlcpy(ais->type24.shipname,
type24_queue->ships[i].shipname,
sizeof(ais->type24.shipname));
- gpsd_report(errout, LOG_PROG,
- "AIVDM 24B from %09u matches a 24A.\n",
- ais->mmsi);
+ gpsd_log(errout, LOG_PROG,
+ "AIVDM 24B from %09u matches a 24A.\n",
+ ais->mmsi);
/* prevent false match if a 24B is repeated */
type24_queue->ships[i].mmsi = 0;
ais->type24.part = both;
@@ -1004,24 +1004,24 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type24.part = part_b;
return true;
default:
- gpsd_report(errout, LOG_WARN,
- "AIVDM message type 24 of subtype unknown.\n");
+ gpsd_log(errout, LOG_WARN,
+ "AIVDM message type 24 of subtype unknown.\n");
return false;
}
// break;
case 25: /* Binary Message, Single Slot */
/* this check and the following one reject line noise */
if (bitlen < 40 || bitlen > 168) {
- gpsd_report(errout, LOG_WARN,
- "AIVDM message type 25 size not between 40 to 168 bits (%zd).\n",
- bitlen);
+ gpsd_log(errout, LOG_WARN,
+ "AIVDM message type 25 size not between 40 to 168 bits (%zd).\n",
+ bitlen);
return false;
}
ais->type25.addressed = (bool)UBITS(38, 1);
ais->type25.structured = (bool)UBITS(39, 1);
if (bitlen < (unsigned)(40 + (16*ais->type25.structured) + (30*ais->type25.addressed))) {
- gpsd_report(errout, LOG_WARN,
- "AIVDM message type 25 too short for mode.\n");
+ gpsd_log(errout, LOG_WARN,
+ "AIVDM message type 25 too short for mode.\n");
return false;
}
if (ais->type25.addressed)
@@ -1044,8 +1044,8 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type26.addressed = (bool)UBITS(38, 1);
ais->type26.structured = (bool)UBITS(39, 1);
if ((signed)bitlen < 40 + 16*ais->type26.structured + 30*ais->type26.addressed + 20) {
- gpsd_report(errout, LOG_WARN,
- "AIVDM message type 26 too short for mode.\n");
+ gpsd_log(errout, LOG_WARN,
+ "AIVDM message type 26 too short for mode.\n");
return false;
}
if (ais->type26.addressed)
@@ -1064,17 +1064,17 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
break;
case 27: /* Long Range AIS Broadcast message */
if (bitlen != 96 && bitlen != 168) {
- gpsd_report(errout, LOG_WARN,
- "unexpected AIVDM message type 27 (%zd).\n",
- bitlen);
+ gpsd_log(errout, LOG_WARN,
+ "unexpected AIVDM message type 27 (%zd).\n",
+ bitlen);
return false;
} if (bitlen == 168) {
/*
* This is an implementation error observed in the wild,
* sending a full 168-bit slot rather than just 96 bits.
*/
- gpsd_report(errout, LOG_WARN,
- "oversized 169=8-bit AIVDM message type 27.\n");
+ gpsd_log(errout, LOG_WARN,
+ "oversized 169=8-bit AIVDM message type 27.\n");
}
ais->type27.accuracy = (bool)UBITS(38, 1);
ais->type27.raim = UBITS(39, 1)!=0;
@@ -1086,8 +1086,8 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type27.gnss = (bool)UBITS(94, 1);
break;
default:
- gpsd_report(errout, LOG_ERROR,
- "Unparsed AIVDM message type %d.\n",ais->type);
+ gpsd_log(errout, LOG_ERROR,
+ "Unparsed AIVDM message type %d.\n",ais->type);
return false;
}
/* *INDENT-ON* */
diff --git a/driver_evermore.c b/driver_evermore.c
index 132d1db4..f7328182 100644
--- a/driver_evermore.c
+++ b/driver_evermore.c
@@ -173,8 +173,8 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
/*@ +usedef @*/
/*@ -usedef -compdef @*/
- gpsd_report(&session->context->errout, LOG_RAW,
- "EverMore packet type 0x%02x (%zd bytes)\n", type, tp-buf2);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "EverMore packet type 0x%02x (%zd bytes)\n", type, tp-buf2);
/*@ +usedef +compdef @*/
session->cycle_end_reliable = true;
@@ -209,13 +209,13 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
"%3.2f", version);
mask |= DEVICEID_SET;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "NDO 0x02: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f mode=%d subtype='%s\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- session->newdata.climb, session->newdata.mode,
- session->gpsdata.dev.subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NDO 0x02: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f mode=%d subtype='%s\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ session->newdata.climb, session->newdata.mode,
+ session->gpsdata.dev.subtype);
return mask | CLEAR_IS | REPORT_IS;
case 0x04: /* DOP Data Output */
@@ -254,12 +254,12 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
}
/* that's all the information in this packet */
mask = TIME_SET | PPSTIME_IS | DOP_SET | MODE_SET | STATUS_SET;
- gpsd_report(&session->context->errout, 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,
- session->gpsdata.dop.hdop, session->gpsdata.dop.vdop,
- session->gpsdata.dop.tdop, session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, 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,
+ session->gpsdata.dop.hdop, session->gpsdata.dop.vdop,
+ session->gpsdata.dop.tdop, session->newdata.mode,
+ session->gpsdata.status);
return mask;
case 0x06: /* Channel Status Output */
@@ -270,9 +270,9 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
gpsd_zero_satellites(&session->gpsdata);
memset(session->gpsdata.used, 0, sizeof(session->gpsdata.used));
if (session->gpsdata.satellites_visible > 12) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "Warning: EverMore packet has information about %d satellites!\n",
- session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Warning: EverMore packet has information about %d satellites!\n",
+ session->gpsdata.satellites_visible);
}
if (session->gpsdata.satellites_visible > EVERMORE_CHANNELS)
session->gpsdata.satellites_visible = EVERMORE_CHANNELS;
@@ -309,10 +309,10 @@ 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_SET | USED_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "CSO 0x06: time=%.2f used=%d visible=%d mask={TIME|SATELLITE|USED}\n",
- session->newdata.time, session->gpsdata.satellites_used,
- session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "CSO 0x06: time=%.2f used=%d visible=%d mask={TIME|SATELLITE|USED}\n",
+ session->newdata.time, session->gpsdata.satellites_used,
+ session->gpsdata.satellites_visible);
return mask;
case 0x08: /* Measurement Data Output */
@@ -352,30 +352,30 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
}
#undef SBITS
#undef UBITS
- gpsd_report(&session->context->errout, LOG_DATA,
- "MDO 0x04: time=%.2f mask={TIME|RAW}\n",
- session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "MDO 0x04: time=%.2f mask={TIME|RAW}\n",
+ session->newdata.time);
return TIME_SET | PPSTIME_IS | RAW_IS;
case 0x20: /* LogConfig Info, could be used as a probe for EverMore GPS */
- gpsd_report(&session->context->errout, LOG_DATA,
- "LogConfig EverMore packet, length %zd\n", datalen);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "LogConfig EverMore packet, length %zd\n", datalen);
return ONLINE_SET;
case 0x22: /* LogData */
- gpsd_report(&session->context->errout, LOG_DATA,
- "LogData EverMore packet, length %zd\n", datalen);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "LogData EverMore packet, length %zd\n", datalen);
return ONLINE_SET;
case 0x38: /* ACK */
- gpsd_report(&session->context->errout, LOG_PROG,
- "EverMore command %02X ACK\n", getub(buf2, 3));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "EverMore command %02X ACK\n", getub(buf2, 3));
return ONLINE_SET;
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown EverMore packet EID 0x%02x, length %zd\n",
- buf2[0], datalen);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown EverMore packet EID 0x%02x, length %zd\n",
+ buf2[0], datalen);
return 0;
}
}
@@ -460,8 +460,8 @@ static bool evermore_protocol(struct gps_device_t *session, int protocol)
(char)0x00, /* 3: reserved */
};
/*@ -charint */
- gpsd_report(&session->context->errout, LOG_PROG,
- "evermore_protocol(%d)\n", protocol);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "evermore_protocol(%d)\n", protocol);
/*@i1@*/ tmp8 = (protocol != 0) ? 1 : 0;
/* NMEA : binary */
evrm_protocol_config[1] = tmp8;
@@ -491,8 +491,8 @@ static bool evermore_nmea_config(struct gps_device_t *session, int mode)
0, 0, 0, 0, 0, 0, /* 10-15: reserved */
};
/*@ -charint */
- gpsd_report(&session->context->errout, LOG_PROG,
- "evermore_nmea_config(%d)\n", mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "evermore_nmea_config(%d)\n", mode);
/*@i1@*/ tmp8 = (mode == 1) ? 5 : 1;
/* NMEA GPGSV, gpsd */
evrm_nmeaout_config[6] = tmp8; /* GPGSV, 1s or 5s */
@@ -505,9 +505,9 @@ static bool evermore_nmea_config(struct gps_device_t *session, int mode)
static void evermore_mode(struct gps_device_t *session, int mode)
{
- gpsd_report(&session->context->errout, LOG_PROG,
- "evermore_mode(%d), %d\n", mode,
- session->back_to_nmea ? 1 : 0);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "evermore_mode(%d), %d\n", mode,
+ session->back_to_nmea ? 1 : 0);
if (mode == MODE_NMEA) {
/* NMEA */
(void)evermore_protocol(session, 1);
@@ -549,9 +549,9 @@ static bool evermore_speed(struct gps_device_t *session,
speed_t speed, char parity, int stopbits)
{
/*@ -type @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "evermore_speed(%u%c%d)\n", (unsigned int)speed, parity,
- stopbits);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "evermore_speed(%u%c%d)\n", (unsigned int)speed, parity,
+ stopbits);
/* parity and stopbit switching aren't available on this chip */
if (parity != session->gpsdata.dev.parity
|| stopbits != (int)session->gpsdata.dev.parity) {
@@ -592,7 +592,8 @@ static bool evermore_rate_switcher(struct gps_device_t *session, double rate)
{
/*@ +charint @*/
if (rate < 1 || rate > 10) {
- gpsd_report(&session->context->errout, LOG_ERROR, "valid rate range is 1-10.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "valid rate range is 1-10.\n");
return false;
} else {
unsigned char evrm_rate_config[] = {
diff --git a/driver_garmin.c b/driver_garmin.c
index 98bf2259..21025468 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -308,17 +308,17 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
cpo_pvt_data *pvt = NULL;
cpo_rcv_data *rmd = NULL;
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: PrintSERPacket(, %#02x, %#02x, )\n", pkt_id, pkt_len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: PrintSERPacket(, %#02x, %#02x, )\n", pkt_id, pkt_len);
session->cycle_end_reliable = true;
switch (pkt_id) {
case ACK:
- gpsd_report(&session->context->errout, LOG_PROG, "Garmin: ACK\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "Garmin: ACK\n");
break;
case NAK:
- gpsd_report(&session->context->errout, LOG_PROG, "Garmin: NAK\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "Garmin: NAK\n");
break;
case GARMIN_PKTID_L001_COMMAND_DATA:
prod_id = get_uint16((uint8_t *) buf);
@@ -343,36 +343,36 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
break;
}
/*@ +branchstate @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Appl, Command Data: %s\n", msg);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Appl, Command Data: %s\n", msg);
break;
case GARMIN_PKTID_PRODUCT_RQST:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Appl, Product Data req\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Appl, Product Data req\n");
break;
case GARMIN_PKTID_PRODUCT_DATA:
prod_id = get_uint16((uint8_t *) buf);
ver = get_uint16((uint8_t *) & buf[2]);
maj_ver = (int)(ver / 100);
min_ver = (int)(ver - (maj_ver * 100));
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Appl, Product Data, sz: %d\n",
- pkt_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Appl, Product Data, sz: %d\n",
+ pkt_len);
(void)snprintf(session->subtype, sizeof(session->subtype),
"%d: %d.%02d", (int)prod_id, maj_ver, min_ver);
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Product ID: %d, SoftVer: %d.%02d\n",
- prod_id, maj_ver, min_ver);
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Product Desc: %s\n", &buf[4]);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Product ID: %d, SoftVer: %d.%02d\n",
+ prod_id, maj_ver, min_ver);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Product Desc: %s\n", &buf[4]);
mask |= DEVICEID_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: PRODUCT_DATA: subtype=%s\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: PRODUCT_DATA: subtype=%s\n",
+ session->subtype);
break;
case GARMIN_PKTID_PVT_DATA:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Appl, PVT Data Sz: %d\n", pkt_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Appl, PVT Data Sz: %d\n", pkt_len);
pvt = (cpo_pvt_data *) buf;
@@ -386,30 +386,30 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
time_l += (time_t) round(pvt->gps_tow);
session->context->gps_tow = pvt->gps_tow;
session->newdata.time = (timestamp_t)time_l;
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: time_l: %ld\n", (long int)time_l);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: time_l: %ld\n", (long int)time_l);
session->newdata.latitude = radtodeg(pvt->lat);
/* sanity check the lat */
if (90.0 < session->newdata.latitude) {
session->newdata.latitude = 90.0;
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: ERROR: Latitude overrange\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: ERROR: Latitude overrange\n");
} else if (-90.0 > session->newdata.latitude) {
session->newdata.latitude = -90.0;
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: ERROR: Latitude negative overrange\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: ERROR: Latitude negative overrange\n");
}
session->newdata.longitude = radtodeg(pvt->lon);
/* sanity check the lon */
if (180.0 < session->newdata.longitude) {
session->newdata.longitude = 180.0;
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: ERROR: Longitude overrange\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: ERROR: Longitude overrange\n");
} else if (-180.0 > session->newdata.longitude) {
session->newdata.longitude = -180.0;
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: ERROR: Longitude negative overrange\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: ERROR: Longitude negative overrange\n");
}
// altitude over WGS84 converted to MSL
session->newdata.altitude = pvt->alt + pvt->msl_hght;
@@ -470,26 +470,26 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
break;
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Appl, mode %d, status %d\n",
- session->newdata.mode, session->gpsdata.status);
-
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: UTC Time: %lf\n",
- session->newdata.time);
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Geoid Separation (MSL-WGS84): from garmin %lf, calculated %lf\n",
- -pvt->msl_hght,
- wgs84_separation(session->newdata.latitude,
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Appl, mode %d, status %d\n",
+ session->newdata.mode, session->gpsdata.status);
+
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: UTC Time: %lf\n",
+ session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Geoid Separation (MSL-WGS84): from garmin %lf, calculated %lf\n",
+ -pvt->msl_hght,
+ wgs84_separation(session->newdata.latitude,
session->newdata.longitude));
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Alt: %.3f, Epe: %.3f, Eph: %.3f, Epv: %.3f, Fix: %d, Gps_tow: %f, Lat: %.3f, Lon: %.3f, LonVel: %.3f, LatVel: %.3f, AltVel: %.3f, MslHgt: %.3f, Leap: %d, GarminDays: %d\n",
- pvt->alt, pvt->epe, pvt->eph, pvt->epv, GPSD_LE16TOH(pvt->fix),
- pvt->gps_tow, session->newdata.latitude,
- session->newdata.longitude, pvt->lon_vel, pvt->lat_vel,
- pvt->alt_vel, pvt->msl_hght, GPSD_LE16TOH(pvt->leap_sec),
- GPSD_LE32TOH(pvt->grmn_days));
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Alt: %.3f, Epe: %.3f, Eph: %.3f, Epv: %.3f, Fix: %d, Gps_tow: %f, Lat: %.3f, Lon: %.3f, LonVel: %.3f, LatVel: %.3f, AltVel: %.3f, MslHgt: %.3f, Leap: %d, GarminDays: %d\n",
+ pvt->alt, pvt->epe, pvt->eph, pvt->epv, GPSD_LE16TOH(pvt->fix),
+ pvt->gps_tow, session->newdata.latitude,
+ session->newdata.longitude, pvt->lon_vel, pvt->lat_vel,
+ pvt->alt_vel, pvt->msl_hght, GPSD_LE16TOH(pvt->leap_sec),
+ GPSD_LE32TOH(pvt->grmn_days));
if (session->newdata.mode > MODE_NO_FIX) {
/* data only valid with a fix */
@@ -505,59 +505,59 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
if (session->fixcnt > 3)
mask |= PPSTIME_IS;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: PVT_DATA: time=%.2f, lat=%.2f lon=%.2f "
- "speed=%.2f track=%.2f climb=%.2f "
- "epx=%.2f epy=%.2f epv=%.2f "
- "mode=%d status=%d\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.speed,
- session->newdata.track,
- session->newdata.climb,
- session->newdata.epx,
- session->newdata.epy,
- session->newdata.epv,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: PVT_DATA: time=%.2f, lat=%.2f lon=%.2f "
+ "speed=%.2f track=%.2f climb=%.2f "
+ "epx=%.2f epy=%.2f epv=%.2f "
+ "mode=%d status=%d\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.speed,
+ session->newdata.track,
+ session->newdata.climb,
+ session->newdata.epx,
+ session->newdata.epy,
+ session->newdata.epv,
+ session->newdata.mode,
+ session->gpsdata.status);
break;
case GARMIN_PKTID_RMD_DATA:
case GARMIN_PKTID_RMD41_DATA:
rmd = (cpo_rcv_data *) buf;
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: PVT RMD Data Sz: %d\n", pkt_len);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: PVT RMD rcvr_tow: %f, rcvr_wn: %d\n",
- rmd->rcvr_tow, rmd->rcvr_wn);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: PVT RMD Data Sz: %d\n", pkt_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: PVT RMD rcvr_tow: %f, rcvr_wn: %d\n",
+ rmd->rcvr_tow, rmd->rcvr_wn);
for (i = 0; i < GARMIN_CHANNELS; i++) {
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: PVT RMD Sat: %3u, cycles: %9u, pr: %16.6f, "
- "phase: %7.3f, slp_dtct: %3s, snr: %3u, Valid: %3s\n",
- (int)rmd->sv[i].svid + 1,
- GPSD_LE32TOH(rmd->sv[i].cycles),
- rmd->sv[i].pr,
- (GPSD_LE16TOH(rmd->sv[i].phase) * 360.0) / 2048.0,
- rmd->sv[i].slp_dtct != 0 ? "Yes" : "No",
- rmd->sv[i].snr_dbhz,
- rmd->sv[i].valid != 0 ? "Yes" : "No");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: PVT RMD Sat: %3u, cycles: %9u, pr: %16.6f, "
+ "phase: %7.3f, slp_dtct: %3s, snr: %3u, Valid: %3s\n",
+ (int)rmd->sv[i].svid + 1,
+ GPSD_LE32TOH(rmd->sv[i].cycles),
+ rmd->sv[i].pr,
+ (GPSD_LE16TOH(rmd->sv[i].phase) * 360.0) / 2048.0,
+ rmd->sv[i].slp_dtct != 0 ? "Yes" : "No",
+ rmd->sv[i].snr_dbhz,
+ rmd->sv[i].valid != 0 ? "Yes" : "No");
}
break;
case GARMIN_PKTID_SAT_DATA:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: SAT Data Sz: %d\n", pkt_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: SAT Data Sz: %d\n", pkt_len);
sats = (cpo_sat_data *) buf;
session->gpsdata.satellites_visible = 0;
session->gpsdata.satellites_used = 0;
gpsd_zero_satellites(&session->gpsdata);
for (i = 0, j = 0; i < GARMIN_CHANNELS; i++, sats++) {
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Sat %3d, snr: %5u, elev: %2d, Azmth: %3d, Stat: %x\n",
- sats->svid, GPSD_LE16TOH(sats->snr), sats->elev,
- GPSD_LE16TOH(sats->azmth),
- sats->status);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Sat %3d, snr: %5u, elev: %2d, Azmth: %3d, Stat: %x\n",
+ sats->svid, GPSD_LE16TOH(sats->snr), sats->elev,
+ GPSD_LE16TOH(sats->azmth),
+ sats->status);
if (255 == (int)sats->svid) {
// Garmin uses 255 for empty
@@ -594,32 +594,32 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
mask |= SATELLITE_SET;
if (session->gpsdata.satellites_used > 0)
mask |= USED_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: SAT_DATA: visible=%d used=%d\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: SAT_DATA: visible=%d used=%d\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
break;
case GARMIN_PKTID_PROTOCOL_ARRAY:
// this packet is never requested, it just comes, in some case
// after a GARMIN_PKTID_PRODUCT_RQST
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: Appl, Product Capability, sz: %d\n",
- pkt_len);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: Appl, Product Capability, sz: %d\n",
+ pkt_len);
for (i = 0; i < pkt_len; i += 3) {
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: %c%03d\n",
- buf[i], get_uint16((uint8_t *) & buf[i + 1]));
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: %c%03d\n",
+ buf[i], get_uint16((uint8_t *) & buf[i + 1]));
}
break;
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "Garmin: Unknown packet id: %#02x, Sz: %#02x\n",
- pkt_id, pkt_len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Garmin: Unknown packet id: %#02x, Sz: %#02x\n",
+ pkt_id, pkt_len);
break;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: PrintSERPacket(, %#02x, %#02x, )\n",
- pkt_id, pkt_len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: PrintSERPacket(, %#02x, %#02x, )\n",
+ pkt_id, pkt_len);
return mask;
}
@@ -643,20 +643,20 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt)
//
uint8_t *buffer = (uint8_t *) pkt;
- gpsd_report(&session->context->errout, LOG_PROG, "Garmin: PrintUSBPacket()\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "Garmin: PrintUSBPacket()\n");
// gem
if (DLE == pkt->mPacketType) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: really a SER packet!\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: really a SER packet!\n");
return PrintSERPacket(session,
(unsigned char)buffer[1],
(int)buffer[2], (unsigned char *)(buffer + 3));
}
// gem
if (4096 < mDataSize) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "Garmin: bogus packet, size too large=%d\n",
- mDataSize);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Garmin: bogus packet, size too large=%d\n",
+ mDataSize);
return 0;
}
@@ -665,20 +665,20 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt)
/* Garmin USB layer specific */
switch (pkt->mPacketId) {
case GARMIN_PKTID_TRANSPORT_START_SESSION_REQ:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Transport, Start Session req\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Transport, Start Session req\n");
break;
case GARMIN_PKTID_TRANSPORT_START_SESSION_RESP:
mode = get_int32(&pkt->mData.uchars[0]);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Transport, Start Session resp, unit: 0x%x\n",
- mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Transport, Start Session resp, unit: 0x%x\n",
+ mode);
break;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Transport, Packet: Type %d %d %d, ID: %d, Sz: %d\n",
- pkt->mPacketType, pkt->mReserved1, pkt->mReserved2,
- pkt->mPacketId, mDataSize);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Transport, Packet: Type %d %d %d, ID: %d, Sz: %d\n",
+ pkt->mPacketType, pkt->mReserved1, pkt->mReserved2,
+ pkt->mPacketId, mDataSize);
break;
}
break;
@@ -695,12 +695,12 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt)
switch (pkt->mPacketId) {
case PRIV_PKTID_SET_MODE:
prod_id = get_uint16(&pkt->mData.uchars[0]);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Private, Set Mode: %d\n", prod_id);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Private, Set Mode: %d\n", prod_id);
break;
case PRIV_PKTID_INFO_REQ:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Private, ID: Info Req\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Private, ID: Info Req\n");
break;
case PRIV_PKTID_INFO_RESP:
veri = get_int32(pkt->mData.uchars);
@@ -708,24 +708,24 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt)
min_ver = (int)(veri & 0xffff);
mode = get_int32(&pkt->mData.uchars[4]);
serial = get_int32(&pkt->mData.uchars[8]);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Private, ID: Info Resp\n");
- gpsd_report(&session->context->errout, LOG_INF,
- "Garmin: USB Driver found, Version %d.%d, Mode: %d, GPS Serial# %u\n",
- maj_ver, min_ver, mode, serial);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Private, ID: Info Resp\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Garmin: USB Driver found, Version %d.%d, Mode: %d, GPS Serial# %u\n",
+ maj_ver, min_ver, mode, serial);
break;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Private, Packet: ID: %d, Sz: %d\n",
- pkt->mPacketId, mDataSize);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Private, Packet: ID: %d, Sz: %d\n",
+ pkt->mPacketId, mDataSize);
break;
}
break;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Packet: Type %d %d %d, ID: %d, Sz: %d\n",
- pkt->mPacketType, pkt->mReserved1, pkt->mReserved2,
- pkt->mPacketId, mDataSize);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Packet: Type %d %d %d, ID: %d, Sz: %d\n",
+ pkt->mPacketType, pkt->mReserved1, pkt->mReserved2,
+ pkt->mPacketId, mDataSize);
break;
}
@@ -759,9 +759,9 @@ static void Build_Send_USB_Packet(struct gps_device_t *session,
theBytesReturned = gpsd_write(session, (const char *)thePacket,
(size_t) theBytesToWrite);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: SendPacket(), wrote %zd bytes\n",
- theBytesReturned);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: SendPacket(), wrote %zd bytes\n",
+ theBytesReturned);
// Garmin says:
// If the packet size was an exact multiple of the USB packet
@@ -832,9 +832,9 @@ static void Build_Send_SER_Packet(struct gps_device_t *session,
theBytesReturned = gpsd_write(session, (const char *)thePacket,
(size_t) theBytesToWrite);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: SendPacket(), wrote %zd bytes\n",
- theBytesReturned);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: SendPacket(), wrote %zd bytes\n",
+ theBytesReturned);
}
@@ -860,13 +860,11 @@ static bool is_usb_device(const char *path UNUSED, int vendor, int product,
ssize_t i = 0;
bool found = false;
- gpsd_report(errout, LOG_INF,
- "attempting USB device enumeration.\n");
+ gpsd_log(errout, LOG_INF, "attempting USB device enumeration.\n");
(void)libusb_init(NULL);
if ((cnt = libusb_get_device_list(NULL, &list)) < 0) {
- gpsd_report(errout, LOG_ERROR,
- "USB device list call failed.\n");
+ gpsd_log(errout, LOG_ERROR, "USB device list call failed.\n");
libusb_exit(NULL);
return false;
}
@@ -877,17 +875,17 @@ static bool is_usb_device(const char *path UNUSED, int vendor, int product,
int r = libusb_get_device_descriptor(dev, &desc);
if (r < 0) {
- gpsd_report(errout, LOG_ERROR,
- "USB descriptor fetch failed on device %zd.\n", i);
+ gpsd_log(errout, LOG_ERROR,
+ "USB descriptor fetch failed on device %zd.\n", i);
continue;
}
/* we can extract device descriptor data */
- gpsd_report(errout, LOG_INF,
- "%04x:%04x (bus %d, device %d)\n",
- desc.idVendor, desc.idProduct,
- libusb_get_bus_number(dev),
- libusb_get_device_address(dev));
+ gpsd_log(errout, LOG_INF,
+ "%04x:%04x (bus %d, device %d)\n",
+ desc.idVendor, desc.idProduct,
+ libusb_get_bus_number(dev),
+ libusb_get_device_address(dev));
/* we match if vendor and product ID are right */
if (desc.idVendor == (uint16_t)vendor && desc.idProduct == (uint16_t)product) {
@@ -896,9 +894,9 @@ static bool is_usb_device(const char *path UNUSED, int vendor, int product,
}
}
- gpsd_report(errout, LOG_INF,
- "vendor/product match with %04x:%04x %sfound\n",
- vendor, product, found ? "" : "not ");
+ gpsd_log(errout, LOG_INF,
+ "vendor/product match with %04x:%04x %sfound\n",
+ vendor, product, found ? "" : "not ");
libusb_free_device_list(list, 1);
libusb_exit(NULL);
return found;
@@ -950,24 +948,24 @@ static bool garmin_usb_detect(struct gps_device_t *session UNUSED)
return false;
if (!gpsd_set_raw(session)) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: garmin_usb_detect: error changing port attributes: %s\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: garmin_usb_detect: error changing port attributes: %s\n",
+ strerror(errno));
return false;
}
if (sizeof(session->driver.garmin.Buffer) < sizeof(Packet_t)) {
/* dunno how this happens, but it does on some compilers */
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: garmin_usb_detect: Compile error, garmin.Buffer too small.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: garmin_usb_detect: Compile error, garmin.Buffer too small.\n");
return false;
}
// FIXME!!! needs to use libusb totally and move garmin_gps aside */
// set Mode 1, mode 0 is broken somewhere past 2.6.14
// but how?
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Set garmin_gps driver mode = 0\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Set garmin_gps driver mode = 0\n");
Build_Send_USB_Packet(session, GARMIN_LAYERID_PRIVATE,
PRIV_PKTID_SET_MODE, 4, MODE_GARMIN_SERIAL);
// expect no return packet !?
@@ -992,13 +990,14 @@ static void garmin_event_hook(struct gps_device_t *session, event_t event)
*/
if (event == event_identified || event == event_reactivate) {
// Tell the device to send product data
- gpsd_report(&session->context->errout, LOG_PROG, "Garmin: Get Product Data\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Get Product Data\n");
Build_Send_SER_Packet(session, GARMIN_LAYERID_APPL,
GARMIN_PKTID_PRODUCT_RQST, 0, 0);
// turn on PVT data 49
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Set to send reports every 1 second\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Set to send reports every 1 second\n");
Build_Send_SER_Packet(session, GARMIN_LAYERID_APPL,
GARMIN_PKTID_L001_COMMAND_DATA, 2,
@@ -1006,8 +1005,8 @@ static void garmin_event_hook(struct gps_device_t *session, event_t event)
#if USE_RMD
// turn on RMD data 110
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: Set to send Raw sat data\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: Set to send Raw sat data\n");
Build_Send_SER_Packet(session, GARMIN_LAYERID_APPL,
GARMIN_PKTID_L001_COMMAND_DATA, 2,
CMND_START_RM_DATA);
@@ -1015,8 +1014,8 @@ static void garmin_event_hook(struct gps_device_t *session, event_t event)
}
if (event == event_deactivate)
/* FIX-ME: is any action needed, or is closing the port sufficient? */
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: garmin_close()\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: garmin_close()\n");
}
#define Send_ACK() Build_Send_SER_Packet(session, 0, ACK, 0, 0)
@@ -1038,24 +1037,25 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
unsigned char chksum = 0;
gps_mask_t mask = 0;
- gpsd_report(&session->context->errout, LOG_RAW, "Garmin: garmin_ser_parse()\n");
+ gpsd_log(&session->context->errout, LOG_RAW, "Garmin: garmin_ser_parse()\n");
if (6 > len) {
/* WTF? */
/* minimum packet; <DLE> [pkt id] [length=0] [chksum] <DLE> <STX> */
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: serial too short: %zd\n", len);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: serial too short: %zd\n", len);
return 0;
}
/* debug */
for (i = 0; i < (int)len; i++) {
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Char: %#02x\n", buf[i]);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Char: %#02x\n", buf[i]);
}
if ('\x10' != buf[0]) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1, "Garmin: buf[0] not DLE\n");
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: buf[0] not DLE\n");
return 0;
}
n = 1;
@@ -1064,7 +1064,8 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
if ('\x10' == pkt_id) {
if ('\x10' != buf[n++]) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1, "Garmin: Bad pkt_id %#02x\n", pkt_id);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Bad pkt_id %#02x\n", pkt_id);
return 0;
}
}
@@ -1073,8 +1074,8 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
chksum += pkt_len;
if ('\x10' == pkt_len) {
if ('\x10' != buf[n++]) {
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Bad pkt_len %#02x\n", pkt_len);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Bad pkt_len %#02x\n", pkt_len);
Send_NAK();
return 0;
}
@@ -1087,9 +1088,9 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
break;
}
if (len < n + i) {
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Packet too short %zd < %zd\n",
- len, n + i);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Packet too short %zd < %zd\n",
+ len, n + i);
Send_NAK();
return 0;
}
@@ -1098,8 +1099,8 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
got_dle = 0;
if ('\x10' != c) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Bad DLE %#02x\n", c);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Bad DLE %#02x\n", c);
return 0;
}
} else {
@@ -1113,9 +1114,9 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
/* get checksum */
if (len < n + i) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: No checksum, Packet too short %zd < %zd\n", len,
- n + i);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: No checksum, Packet too short %zd < %zd\n", len,
+ n + i);
return 0;
}
c = buf[n + i++];
@@ -1123,45 +1124,46 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
/* get final DLE */
if (len < n + i) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: No final DLE, Packet too short %zd < %zd\n", len,
- n + i);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: No final DLE, Packet too short %zd < %zd\n", len,
+ n + i);
return 0;
}
c = buf[n + i++];
if ('\x10' != c) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1, "Garmin: Final DLE not DLE\n");
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Final DLE not DLE\n");
return 0;
}
/* get final ETX */
if (len < n + i) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: No final ETX, Packet too short %zd < %zd\n", len,
- n + i);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: No final ETX, Packet too short %zd < %zd\n", len,
+ n + i);
return 0;
}
/* we used to say n++ here, but scan-build complains */
c = buf[n + i];
if ('\x03' != c) {
Send_NAK();
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Final ETX not ETX\n");
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Final ETX not ETX\n");
return 0;
}
/* debug */
/*@ -usedef -compdef @*/
for (i = 0; i < data_index; i++) {
- gpsd_report(&session->context->errout, LOG_RAW + 1,
- "Garmin: Char: %#02x\n", data_buf[i]);
+ gpsd_log(&session->context->errout, LOG_RAW + 1,
+ "Garmin: Char: %#02x\n", data_buf[i]);
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "Garmin: garmin_ser_parse() Type: %#02x, Len: %#02x, chksum: %#02x\n",
- pkt_id, pkt_len, chksum);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: garmin_ser_parse() Type: %#02x, Len: %#02x, chksum: %#02x\n",
+ pkt_id, pkt_len, chksum);
mask = PrintSERPacket(session, pkt_id, pkt_len, data_buf);
// sending ACK too soon might hang the session
@@ -1169,7 +1171,8 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session)
(void)usleep(300);
Send_ACK();
/*@ +usedef +compdef @*/
- gpsd_report(&session->context->errout, LOG_DATA, "Garmin: garmin_ser_parse( )\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Garmin: garmin_ser_parse( )\n");
return mask;
}
@@ -1197,12 +1200,12 @@ static void garmin_switcher(struct gps_device_t *session, int mode)
ssize_t status = gpsd_write(session, switcher, sizeof(switcher));
/*@ -charint @*/
if (status == (ssize_t)sizeof(switcher)) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin: => GPS: turn off binary %02x %02x %02x... \n",
- switcher[0], switcher[1], switcher[2]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: => GPS: turn off binary %02x %02x %02x... \n",
+ switcher[0], switcher[1], switcher[2]);
} else {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: => GPS: FAILED\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: => GPS: FAILED\n");
}
settle(); // wait 333mS, essential!
@@ -1285,7 +1288,7 @@ static int GetPacket(struct gps_device_t *session)
session->driver.garmin.BufferLen = 0;
session->lexer.outbuflen = 0;
- gpsd_report(&session->context->errout, LOG_DATA, "Garmin: GetPacket()\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "Garmin: GetPacket()\n");
for (cnt = 0; cnt < 10; cnt++) {
size_t pkt_size;
@@ -1306,20 +1309,20 @@ static int GetPacket(struct gps_device_t *session)
if (0 > theBytesReturned) {
// read error...
// or EAGAIN, but O_NONBLOCK is never set
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: GetPacket() read error=%d, errno=%d\n",
- theBytesReturned, errno);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: GetPacket() read error=%d, errno=%d\n",
+ theBytesReturned, errno);
continue;
}
- gpsd_report(&session->context->errout, LOG_RAW,
- "Garmin: got %d bytes\n", theBytesReturned);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Garmin: got %d bytes\n", theBytesReturned);
session->driver.garmin.BufferLen += theBytesReturned;
if (256 <= session->driver.garmin.BufferLen) {
// really bad read error...
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: GetPacket() packet too long, %ld > 255 !\n",
- session->driver.garmin.BufferLen);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: GetPacket() packet too long, %ld > 255 !\n",
+ session->driver.garmin.BufferLen);
session->driver.garmin.BufferLen = 0;
break;
}
@@ -1328,9 +1331,9 @@ static int GetPacket(struct gps_device_t *session)
// have enough data to check packet size
if (session->driver.garmin.BufferLen > pkt_size) {
// wrong amount of data in buffer
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: GetPacket() packet size wrong! Packet: %ld, s/b %ld\n",
- session->driver.garmin.BufferLen, pkt_size);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: GetPacket() packet size wrong! Packet: %ld, s/b %ld\n",
+ session->driver.garmin.BufferLen, pkt_size);
session->driver.garmin.BufferLen = 0;
break;
}
@@ -1350,24 +1353,25 @@ static int GetPacket(struct gps_device_t *session)
}
// dump the individual bytes, debug only
// for ( x = 0; x < session->driver.garmin.BufferLen; x++ ) {
- // gpsd_report(&session->context->errout, LOG_RAW+1, "Garmin: p[%d] = %x\n", x, session->driver.garmin.Buffer[x]);
+ // gpsd_log(&session->context->errout, LOG_RAW+1, "Garmin: p[%d] = %x\n", x, session->driver.garmin.Buffer[x]);
// }
if (10 <= cnt) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Garmin: GetPacket() packet too long or too slow!\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Garmin: GetPacket() packet too long or too slow!\n");
return -1;
}
- gpsd_report(&session->context->errout, LOG_RAW,
- "Garmin: GotPacket() sz=%d \n",
- session->driver.garmin.BufferLen);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Garmin: GotPacket() sz=%d \n",
+ session->driver.garmin.BufferLen);
session->lexer.outbuflen = session->driver.garmin.BufferLen;
return 0;
}
static gps_mask_t garmin_usb_parse(struct gps_device_t *session)
{
- gpsd_report(&session->context->errout, LOG_PROG, "Garmin: garmin_usb_parse()\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin: garmin_usb_parse()\n");
return PrintUSBPacket(session,
(Packet_t *) session->driver.garmin.Buffer);
}
diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c
index 5d249909..adeaf361 100644
--- a/driver_garmin_txt.c
+++ b/driver_garmin_txt.c
@@ -153,13 +153,13 @@ static int gar_decode(const struct gps_context_t *context,
/* splint is buggy here, thinks buf can be a null pointer */
/*@ -mustdefine -nullderef -nullpass @*/
if (length >= sizeof(buf)) {
- gpsd_report(&context->errout, LOG_ERROR, "internal buffer too small\n");
+ gpsd_log(&context->errout, LOG_ERROR, "internal buffer too small\n");
return -1;
}
bzero(buf, (int)sizeof(buf));
(void)strlcpy(buf, data, length);
- gpsd_report(&context->errout, LOG_RAW + 2, "Decoded string: %s\n", buf);
+ gpsd_log(&context->errout, LOG_RAW + 2, "Decoded string: %s\n", buf);
if (strchr(buf, '_') != NULL) {
/* value is not valid, ignore it */
@@ -186,14 +186,14 @@ static int gar_decode(const struct gps_context_t *context,
break;
}
}
- gpsd_report(&context->errout, LOG_WARN,
- "Unexpected char \"%c\" in data \"%s\"\n",
- buf[0], buf);
+ gpsd_log(&context->errout, LOG_WARN,
+ "Unexpected char \"%c\" in data \"%s\"\n",
+ buf[0], buf);
return -1;
} while (0);
if (strspn(buf + offset, "0123456789") != length - offset) {
- gpsd_report(&context->errout, LOG_WARN, "Invalid value %s\n", buf);
+ gpsd_log(&context->errout, LOG_WARN, "Invalid value %s\n", buf);
return -1;
}
/*@ +mustdefine +nullderef +nullpass @*/
@@ -223,13 +223,13 @@ static int gar_int_decode(const struct gps_context_t *context,
/*@ -mustdefine @*/
if (length >= sizeof(buf)) {
- gpsd_report(&context->errout, LOG_ERROR, "internal buffer too small\n");
+ gpsd_log(&context->errout, LOG_ERROR, "internal buffer too small\n");
return -1;
}
bzero(buf, (int)sizeof(buf));
(void)strlcpy(buf, data, length);
- gpsd_report(&context->errout, LOG_RAW + 2, "Decoded string: %s\n", buf);
+ gpsd_log(&context->errout, LOG_RAW + 2, "Decoded string: %s\n", buf);
if (strchr(buf, '_') != NULL) {
/* value is not valid, ignore it */
@@ -238,7 +238,7 @@ static int gar_int_decode(const struct gps_context_t *context,
/*@ -nullpass @*//* splint bug */
if (strspn(buf, "0123456789") != length) {
- gpsd_report(&context->errout, LOG_WARN, "Invalid value %s\n", buf);
+ gpsd_log(&context->errout, LOG_WARN, "Invalid value %s\n", buf);
return -1;
}
@@ -247,9 +247,9 @@ static int gar_int_decode(const struct gps_context_t *context,
*result = res;
return 0; /* SUCCESS */
} else {
- gpsd_report(&context->errout, LOG_WARN,
- "Value %u out of range <%u, %u>\n", res, min,
- max);
+ gpsd_log(&context->errout, LOG_WARN,
+ "Value %u out of range <%u, %u>\n", res, min,
+ max);
return -1;
}
/*@ +mustdefine +nullpass @*/
@@ -268,14 +268,14 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
gps_mask_t mask = 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "Garmin Simple Text packet, len %zd: %s\n",
- session->lexer.outbuflen, (char*)session->lexer.outbuffer);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Garmin Simple Text packet, len %zd: %s\n",
+ session->lexer.outbuflen, (char*)session->lexer.outbuffer);
if (session->lexer.outbuflen < 54) {
/* trailing CR and LF can be ignored; ('@' + 54x 'DATA' + '\r\n') has length 57 */
- gpsd_report(&session->context->errout, LOG_WARN,
- "Message is too short, rejected.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Message is too short, rejected.\n");
return ONLINE_SET;
}
@@ -286,7 +286,7 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
do {
unsigned int result;
char *buf = (char *)session->lexer.outbuffer + 1;
- gpsd_report(&session->context->errout, LOG_PROG, "Timestamp: %.12s\n", buf);
+ gpsd_log(&session->context->errout, LOG_PROG, "Timestamp: %.12s\n", buf);
/* year */
if (0 != gar_int_decode(session->context,
@@ -460,14 +460,14 @@ gps_mask_t garmintxt_parse(struct gps_device_t * session)
mask |= CLIMB_SET;
} while (0);
- gpsd_report(&session->context->errout, LOG_DATA,
- "GTXT: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f exp=%.2f epy=%.2f mode=%d status=%d\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- session->newdata.climb, session->newdata.epx,
- session->newdata.epy, session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GTXT: time=%.2f, lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f climb=%.2f exp=%.2f epy=%.2f mode=%d status=%d\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ session->newdata.climb, session->newdata.epx,
+ session->newdata.epy, session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
diff --git a/driver_geostar.c b/driver_geostar.c
index 11e9ad78..03df4bc2 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -71,8 +71,8 @@ static int geostar_write(struct gps_device_t *session,
session->msgbuflen = len * 4;
- gpsd_report(&session->context->errout, LOG_PROG,
- "Sent GeoStar packet id 0x%x\n", id);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Sent GeoStar packet id 0x%x\n", id);
if (gpsd_write(session, session->msgbuf, session->msgbuflen) !=
(ssize_t) session->msgbuflen)
return -1;
@@ -110,8 +110,8 @@ static bool geostar_detect(struct gps_device_t *session)
break;
if (generic_get(session) >= 0) {
if (session->lexer.type == GEOSTAR_PACKET) {
- gpsd_report(&session->context->errout, LOG_RAW,
- "geostar_detect found\n");
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "geostar_detect found\n");
ret = true;
break;
}
@@ -134,9 +134,9 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
char buf2[BUFSIZ];
if (session->lexer.type != GEOSTAR_PACKET) {
- gpsd_report(&session->context->errout, LOG_INF,
- "geostar_analyze packet type %d\n",
- session->lexer.type);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "geostar_analyze packet type %d\n",
+ session->lexer.type);
return 0;
}
@@ -159,20 +159,20 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
id = (unsigned int)getleu16(session->lexer.outbuffer, OFFSET(0));
- gpsd_report(&session->context->errout, LOG_DATA,
- "GeoStar packet id 0x%02x length %d: %s\n", id, len, buf2);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GeoStar packet id 0x%02x length %d: %s\n", id, len, buf2);
session->cycle_end_reliable = true;
switch (id) {
case 0x10:
- gpsd_report(&session->context->errout, LOG_INF, "Raw measurements\n");
+ gpsd_log(&session->context->errout, LOG_INF, "Raw measurements\n");
break;
case 0x11:
- gpsd_report(&session->context->errout, LOG_INF, "GPS sub-frame data\n");
+ gpsd_log(&session->context->errout, LOG_INF, "GPS sub-frame data\n");
break;
case 0x12:
- gpsd_report(&session->context->errout, LOG_INF, "GLONASS sub-frame data\n");
+ gpsd_log(&session->context->errout, LOG_INF, "GLONASS sub-frame data\n");
break;
case 0x13:
d1 = getled64(buf, OFFSET(1));
@@ -180,8 +180,8 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
d3 = getled64(buf, OFFSET(5));
d4 = getled64(buf, OFFSET(29)); /* GPS time */
d5 = getled64(buf, OFFSET(31)); /* GLONASS time */
- gpsd_report(&session->context->errout, LOG_INF,
- "ECEF coordinates %g %g %g %f %f\n", d1, d2, d3, d4, d5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "ECEF coordinates %g %g %g %f %f\n", d1, d2, d3, d4, d5);
break;
case 0x20:
d1 = getled64(buf, OFFSET(1)); /* time */
@@ -213,30 +213,30 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
}
mask |= TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | DOP_SET | USED_IS | REPORT_IS;
- gpsd_report(&session->context->errout, LOG_INF,
- "Geographic coordinates %f %g %g %g %g %g\n",
- d1,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude,
- session->newdata.speed,
- session->newdata.track);
- gpsd_report(&session->context->errout, LOG_INF,
- "Dilution of precision %g %g %g %g %g\n",
- session->gpsdata.dop.gdop,
- session->gpsdata.dop.pdop,
- session->gpsdata.dop.tdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Geographic coordinates %f %g %g %g %g %g\n",
+ d1,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude,
+ session->newdata.speed,
+ session->newdata.track);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Dilution of precision %g %g %g %g %g\n",
+ session->gpsdata.dop.gdop,
+ session->gpsdata.dop.pdop,
+ session->gpsdata.dop.tdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop);
break;
case 0x21:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
uw1 = getleu16(buf, OFFSET(3));
uw2 = getleu16(buf, OFFSET(3) + 2);
- gpsd_report(&session->context->errout, LOG_INF,
- "Current receiver telemetry %x %d %d %d\n",
- ul1, ul2, uw1, uw2);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Current receiver telemetry %x %d %d %d\n",
+ ul1, ul2, uw1, uw2);
if(ul1 & (1<<3)) {
session->newdata.mode = MODE_2D;
}
@@ -255,7 +255,7 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
break;
case 0x22:
ul1 = getleu32(buf, OFFSET(1));
- gpsd_report(&session->context->errout, LOG_INF, "SVs in view %d\n", ul1);
+ gpsd_log(&session->context->errout, LOG_INF, "SVs in view %d\n", ul1);
session->gpsdata.satellites_visible = (int)ul1;
if(ul1 > GEOSTAR_CHANNELS) ul1 = GEOSTAR_CHANNELS;
for(i = 0; (uint32_t)i < ul1; i++) {
@@ -264,8 +264,8 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
s1 = getles16(buf, OFFSET(3) + i * 3 * 4);
s2 = getles16(buf, OFFSET(3) + 2 + i * 3 * 4);
s3 = getles16(buf, OFFSET(4) + 2 + i * 3 * 4);
- gpsd_report(&session->context->errout, LOG_INF, "ID %d Az %g El %g SNR %g\n",
- decode_channel_id(ul2), s1*0.001*RAD_2_DEG, s2*0.001*RAD_2_DEG, s3*0.1);
+ gpsd_log(&session->context->errout, LOG_INF, "ID %d Az %g El %g SNR %g\n",
+ decode_channel_id(ul2), s1*0.001*RAD_2_DEG, s2*0.001*RAD_2_DEG, s3*0.1);
session->gpsdata.skyview[i].PRN = (short)decode_channel_id(ul2);
session->gpsdata.skyview[i].azimuth = (short)round((double)s1*0.001 * RAD_2_DEG);
session->gpsdata.skyview[i].elevation = (short)round((double)s2*0.001 * RAD_2_DEG);
@@ -279,58 +279,58 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
ul3 = getleu32(buf, OFFSET(3));
- gpsd_report(&session->context->errout, LOG_INF,
- "Receiver power-up message %d %d %d\n", ul1, ul2, ul3);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Receiver power-up message %d %d %d\n", ul1, ul2, ul3);
break;
case 0x3f:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
- gpsd_report(&session->context->errout, LOG_WARN,
- "Negative acknowledge %x %d\n", ul1, ul2);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Negative acknowledge %x %d\n", ul1, ul2);
break;
case 0x40:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set initial parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set initial parameters\n");
break;
case 0x41:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set serial ports parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set serial ports parameters\n");
break;
case 0x42:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
ul3 = getleu32(buf, OFFSET(3));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set receiver operation mode %d %d %d\n",
- ul1, ul2, ul3);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set receiver operation mode %d %d %d\n",
+ ul1, ul2, ul3);
break;
case 0x43:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set navigation task solution parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set navigation task solution parameters\n");
break;
case 0x44:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set output data rate\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set output data rate\n");
break;
case 0x46:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Assign data protocol to communication port\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Assign data protocol to communication port\n");
break;
case 0x48:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set GPS almanac\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set GPS almanac\n");
break;
case 0x49:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set GLONASS almanac\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set GLONASS almanac\n");
break;
case 0x4a:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set GPS ephemeris\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set GPS ephemeris\n");
break;
case 0x4b:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set GLONASS ephemeris\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set GLONASS ephemeris\n");
break;
case 0x4c:
ul1 = getleu32(buf, OFFSET(1));
@@ -338,76 +338,76 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
ul3 = getleu32(buf, OFFSET(3));
ul4 = getleu32(buf, OFFSET(4));
ul5 = getleu32(buf, OFFSET(5));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Set PPS parameters %d %d %d %d %d\n",
- ul1, ul2, ul3, ul4, ul5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Set PPS parameters %d %d %d %d %d\n",
+ ul1, ul2, ul3, ul4, ul5);
break;
case 0x4d:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Enable/disable SV in position fix\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Enable/disable SV in position fix\n");
break;
case 0x4e:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Enable/disable NMEA messages\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Enable/disable NMEA messages\n");
break;
case 0x4f:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Enable/disable binary messages %x %x\n",
- ul1, ul2);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Enable/disable binary messages %x %x\n",
+ ul1, ul2);
break;
case 0x80:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query initial parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query initial parameters\n");
break;
case 0x81:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query serial ports parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query serial ports parameters\n");
break;
case 0x82:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
ul3 = getleu32(buf, OFFSET(3));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query receiver operation mode %d %d %d\n",
- ul1, ul2, ul3);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query receiver operation mode %d %d %d\n",
+ ul1, ul2, ul3);
break;
case 0x83:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query navigation task solution parameters\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query navigation task solution parameters\n");
break;
case 0x84:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query output data rate\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query output data rate\n");
break;
case 0x86:
session->driver.geostar.physical_port = (unsigned int)getleu32(buf, OFFSET(1));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query data protocol assignment to communication port\n");
- gpsd_report(&session->context->errout, LOG_INF,
- "Connected to physical port %d\n",
- session->driver.geostar.physical_port);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query data protocol assignment to communication port\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Connected to physical port %d\n",
+ session->driver.geostar.physical_port);
break;
case 0x88:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query GPS almanac\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query GPS almanac\n");
break;
case 0x89:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query GLONASS almanac\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query GLONASS almanac\n");
break;
case 0x8a:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query GPS ephemerides\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query GPS ephemerides\n");
break;
case 0x8b:
d1 = getled64(buf, OFFSET(23));
d2 = getled64(buf, OFFSET(25));
d3 = getled64(buf, OFFSET(27));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query GLONASS ephemerides %g %g %g\n",
- d1, d2, d3);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query GLONASS ephemerides %g %g %g\n",
+ d1, d2, d3);
break;
case 0x8c:
ul1 = getleu32(buf, OFFSET(1));
@@ -415,28 +415,28 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
ul3 = getleu32(buf, OFFSET(3));
ul4 = getleu32(buf, OFFSET(4));
ul5 = getleu32(buf, OFFSET(5));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query PPS parameters %d %d %d %d %d\n",
- ul1, ul2, ul3, ul4, ul5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query PPS parameters %d %d %d %d %d\n",
+ ul1, ul2, ul3, ul4, ul5);
break;
case 0x8d:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query enable/disable status of the SV in position fix\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query enable/disable status of the SV in position fix\n");
break;
case 0x8e:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query enable NMEA messages\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query enable NMEA messages\n");
break;
case 0x8f:
ul1 = getleu32(buf, OFFSET(1));
ul2 = getleu32(buf, OFFSET(2));
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Query enable binary messages %x %x\n",
- ul1, ul2);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Query enable binary messages %x %x\n",
+ ul1, ul2);
break;
case 0xc0:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Change operation mode command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Change operation mode command\n");
break;
case 0xc1:
ul4 = getleu32(buf, OFFSET(1));
@@ -447,34 +447,34 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
(void)snprintf(session->subtype, sizeof(session->subtype), "%d.%d %d.%d.%d %x %c-%d\n",
ul4>>16, ul4&0xFFFF, ul1>>9, (ul1>>5)&0xF, ul1&0x1F, ul2, ul3>>24, ul3&0x00FFFFFF);
/*@ +formattype @*/
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Request FW version command: %s\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Request FW version command: %s\n",
+ session->subtype);
mask |= DEVICEID_SET;
break;
case 0xc2:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Restart receiver command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Restart receiver command\n");
break;
case 0xc3:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Store parameters to Flash command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Store parameters to Flash command\n");
break;
case 0xd0:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Erase Flash sector command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Erase Flash sector command\n");
break;
case 0xd1:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Write data to Flash command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Write data to Flash command\n");
break;
case 0xd2:
- gpsd_report(&session->context->errout, LOG_INF,
- "Response to Store Serial Number command\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Response to Store Serial Number command\n");
break;
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "Unhandled GeoStar packet type 0x%02x\n", id);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Unhandled GeoStar packet type 0x%02x\n", id);
break;
}
@@ -600,7 +600,8 @@ static void geostar_mode(struct gps_device_t *session, int mode)
/* Switch to binary mode */
(void)nmea_send(session, "$GPSGG,SWPROT");
} else {
- gpsd_report(&session->context->errout, LOG_ERROR, "unknown mode %i requested\n", mode);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "unknown mode %i requested\n", mode);
}
/*@+shiftimplementation@*/
}
diff --git a/driver_italk.c b/driver_italk.c
index 051376c2..60883163 100644
--- a/driver_italk.c
+++ b/driver_italk.c
@@ -41,9 +41,9 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
double epx, epy, epz, evx, evy, evz, eph;
if (len != 296) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "ITALK: bad NAV_FIX (len %zu, should be 296)\n",
- len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "ITALK: bad NAV_FIX (len %zu, should be 296)\n",
+ len);
return -1;
}
@@ -106,15 +106,15 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session,
session->gpsdata.status = STATUS_FIX;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAV_FIX: time=%.2f, lat=%.2f lon=%.2f alt=%.f speed=%.2f track=%.2f climb=%.2f mode=%d status=%d gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- session->newdata.climb, session->newdata.mode,
- session->gpsdata.status, session->gpsdata.dop.gdop,
- session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAV_FIX: time=%.2f, lat=%.2f lon=%.2f alt=%.f speed=%.2f track=%.2f climb=%.2f mode=%d status=%d gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ session->newdata.climb, session->newdata.mode,
+ session->gpsdata.status, session->gpsdata.dop.gdop,
+ session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
return mask;
}
@@ -124,7 +124,8 @@ static gps_mask_t decode_itk_prnstatus(struct gps_device_t *session,
gps_mask_t mask;
if (len < 62) {
- gpsd_report(&session->context->errout, LOG_PROG, "ITALK: runt PRN_STATUS (len=%zu)\n", len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "ITALK: runt PRN_STATUS (len=%zu)\n", len);
mask = 0;
} else {
unsigned int i, nsv, nchan, st;
@@ -158,11 +159,11 @@ static gps_mask_t decode_itk_prnstatus(struct gps_device_t *session,
session->gpsdata.satellites_used = (int)nsv;
mask = USED_IS | SATELLITE_SET;;
- gpsd_report(&session->context->errout, LOG_DATA,
- "PRN_STATUS: time=%.2f visible=%d used=%d mask={USED|SATELLITE}\n",
- session->newdata.time,
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "PRN_STATUS: time=%.2f visible=%d used=%d mask={USED|SATELLITE}\n",
+ session->newdata.time,
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
}
return mask;
@@ -175,9 +176,9 @@ static gps_mask_t decode_itk_utcionomodel(struct gps_device_t *session,
unsigned short flags;
if (len != 64) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "ITALK: bad UTC_IONO_MODEL (len %zu, should be 64)\n",
- len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "ITALK: bad UTC_IONO_MODEL (len %zu, should be 64)\n",
+ len);
return 0;
}
@@ -192,9 +193,9 @@ static gps_mask_t decode_itk_utcionomodel(struct gps_device_t *session,
session->newdata.time = gpsd_gpstime_resolve(session,
(unsigned short) getleu16(buf, 7 + 36),
(unsigned int)getleu32(buf, 7 + 38) / 1000.0);
- gpsd_report(&session->context->errout, LOG_DATA,
- "UTC_IONO_MODEL: time=%.2f mask={TIME}\n",
- session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "UTC_IONO_MODEL: time=%.2f mask={TIME}\n",
+ session->newdata.time);
return TIME_SET | PPSTIME_IS;
}
@@ -206,19 +207,19 @@ static gps_mask_t decode_itk_subframe(struct gps_device_t *session,
uint32_t words[10];
if (len != 64) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "ITALK: bad SUBFRAME (len %zu, should be 64)\n", len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "ITALK: bad SUBFRAME (len %zu, should be 64)\n", len);
return 0;
}
flags = (unsigned short) getleu16(buf, 7 + 4);
prn = (unsigned short) getleu16(buf, 7 + 6);
sf = (unsigned short) getleu16(buf, 7 + 8);
- gpsd_report(&session->context->errout, LOG_PROG,
- "iTalk 50B SUBFRAME prn %u sf %u - decode %s %s\n",
- prn, sf,
- flags & SUBFRAME_WORD_FLAG_MASK ? "error" : "ok",
- flags & SUBFRAME_GPS_PREAMBLE_INVERTED ? "(inverted)" : "");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "iTalk 50B SUBFRAME prn %u sf %u - decode %s %s\n",
+ prn, sf,
+ flags & SUBFRAME_WORD_FLAG_MASK ? "error" : "ok",
+ flags & SUBFRAME_GPS_PREAMBLE_INVERTED ? "(inverted)" : "");
if (flags & SUBFRAME_WORD_FLAG_MASK)
return 0; // don't try decode an erroneous packet
@@ -239,17 +240,17 @@ static gps_mask_t decode_itk_pseudo(struct gps_device_t *session,
n = (unsigned short) getleu16(buf, 7 + 4);
if ((n < 1) || (n > MAXCHANNELS)){
- gpsd_report(&session->context->errout, LOG_INF,
- "ITALK: bad PSEUDO channel count\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "ITALK: bad PSEUDO channel count\n");
return 0;
}
if (len != (size_t)((n+1)*36)) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "ITALK: bad PSEUDO len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "ITALK: bad PSEUDO len %zu\n", len);
}
- gpsd_report(&session->context->errout, LOG_PROG, "iTalk PSEUDO [%u]\n", n);
+ gpsd_log(&session->context->errout, LOG_PROG, "iTalk PSEUDO [%u]\n", n);
flags = (unsigned short)getleu16(buf, 7 + 6);
if ((flags & 0x3) != 0x3)
return 0; // bail if measurement time not valid.
@@ -287,55 +288,55 @@ static gps_mask_t italk_parse(struct gps_device_t *session,
type = (uint) getub(buf, 4);
/* we may need to dump the raw packet */
- gpsd_report(&session->context->errout, LOG_RAW,
- "raw italk packet type 0x%02x\n", type);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "raw italk packet type 0x%02x\n", type);
session->cycle_end_reliable = true;
switch (type) {
case ITALK_NAV_FIX:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk NAV_FIX len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk NAV_FIX len %zu\n", len);
mask = decode_itk_navfix(session, buf, len) | (CLEAR_IS | REPORT_IS);
break;
case ITALK_PRN_STATUS:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk PRN_STATUS len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk PRN_STATUS len %zu\n", len);
mask = decode_itk_prnstatus(session, buf, len);
break;
case ITALK_UTC_IONO_MODEL:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk UTC_IONO_MODEL len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk UTC_IONO_MODEL len %zu\n", len);
mask = decode_itk_utcionomodel(session, buf, len);
break;
case ITALK_ACQ_DATA:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk ACQ_DATA len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk ACQ_DATA len %zu\n", len);
break;
case ITALK_TRACK:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk TRACK len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk TRACK len %zu\n", len);
break;
case ITALK_PSEUDO:
- gpsd_report(&session->context->errout,
- LOG_DATA, "iTalk PSEUDO len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk PSEUDO len %zu\n", len);
mask = decode_itk_pseudo(session, buf, len);
break;
case ITALK_RAW_ALMANAC:
- gpsd_report(&session->context->errout,
- LOG_DATA, "iTalk RAW_ALMANAC len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk RAW_ALMANAC len %zu\n", len);
break;
case ITALK_RAW_EPHEMERIS:
- gpsd_report(&session->context->errout,
- LOG_DATA, "iTalk RAW_EPHEMERIS len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk RAW_EPHEMERIS len %zu\n", len);
break;
case ITALK_SUBFRAME:
mask = decode_itk_subframe(session, buf, len);
break;
case ITALK_BIT_STREAM:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk BIT_STREAM len %zu\n", len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk BIT_STREAM len %zu\n", len);
break;
case ITALK_AGC:
@@ -369,14 +370,14 @@ static gps_mask_t italk_parse(struct gps_device_t *session,
case ITALK_PULL_FIX:
case ITALK_MEMCTRL:
case ITALK_STOP_TASK:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk not processing packet: id 0x%02x length %zu\n",
- type, len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk not processing packet: id 0x%02x length %zu\n",
+ type, len);
break;
default:
- gpsd_report(&session->context->errout, LOG_DATA,
- "iTalk unknown packet: id 0x%02x length %zu\n",
- type, len);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "iTalk unknown packet: id 0x%02x length %zu\n",
+ type, len);
}
return mask | ONLINE_SET;
diff --git a/driver_navcom.c b/driver_navcom.c
index 925b7b61..5554f03b 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -104,9 +104,9 @@ static void navcom_cmd_0x20(struct gps_device_t *session, uint8_t block_id,
putbyte(msg, 16, checksum(msg + 3, 13));
putbyte(msg, 17, 0x03);
(void)navcom_send_cmd(session, msg, 18);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: sent command 0x20 (Data Request) "
- "- data block id = %02x at rate %02x\n", block_id, rate);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: sent command 0x20 (Data Request) "
+ "- data block id = %02x at rate %02x\n", block_id, rate);
}
/*@ unused @*/
@@ -127,8 +127,8 @@ static void UNUSED navcom_cmd_0x3f(struct gps_device_t *session)
putbyte(msg, 10, checksum(msg + 3, 7));
putbyte(msg, 11, 0x03);
(void)navcom_send_cmd(session, msg, 12);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: sent command 0x3f (LED Configuration Block)\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: sent command 0x3f (LED Configuration Block)\n");
}
/* Test Support Block - Blinks the LEDs */
@@ -148,11 +148,11 @@ static void navcom_cmd_0x1c(struct gps_device_t *session, uint8_t mode,
putbyte(msg, 10, checksum(msg + 3, 7));
putbyte(msg, 11, 0x03);
(void)navcom_send_cmd(session, msg, 12);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: sent command 0x1c (Test Support Block)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: command 0x1c mode = %02x, length = %u\n",
- mode, length);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: sent command 0x1c (Test Support Block)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: command 0x1c mode = %02x, length = %u\n",
+ mode, length);
}
#ifdef RECONFIGURE_ENABLE
@@ -175,10 +175,10 @@ static void navcom_cmd_0x11(struct gps_device_t *session,
putbyte(msg, 10, checksum(msg + 3, 7));
putbyte(msg, 11, 0x03);
(void)navcom_send_cmd(session, msg, 12);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: sent command 0x11 (Serial Port Configuration)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: serial port selection: 0x%02x\n", port_selection);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: sent command 0x11 (Serial Port Configuration)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: serial port selection: 0x%02x\n", port_selection);
}
#endif /* RECONFIGURE_ENABLE */
@@ -276,29 +276,29 @@ static gps_mask_t handle_0x83(struct gps_device_t *session)
}
/*@ -relaxtypes -charint @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0x83 (Ionosphere and UTC Data)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: Scaled parameters follow:\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: GPS Week: %u, GPS Time of Week: %u (GPS Time: %f)\n",
- week, tow, week * 604800 + tow / 1000.0);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: a0: %12.4E, a1: %12.4E, a2: %12.4E, a3: %12.4E, "
- "b0: %12.4E, b1: %12.4E, b2: %12.4E, b3: %12.4E\n",
- (double)alpha0 * SF_ALPHA0, (double)alpha1 * SF_ALPHA1,
- (double)alpha2 * SF_ALPHA2, (double)alpha3 * SF_ALPHA3,
- (double)beta0 * SF_BETA0, (double)beta1 * SF_BETA1,
- (double)beta2 * SF_BETA2, (double)beta3 * SF_BETA3);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: A0: %19.12E, A1: %19.12E\n", (double)a0 * SF_A0,
- (double)a1 * SF_A1);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: UTC Ref. Time: %lu, UTC Ref. Week: %u, dTls: %d\n",
- (unsigned long)tot * SF_TOT, wnt, dtls);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: Week of leap seconds: %u, Day number of leap seconds: %u, dTlsf: %d\n",
- wnlsf, dn, dtlsf);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0x83 (Ionosphere and UTC Data)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: Scaled parameters follow:\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: GPS Week: %u, GPS Time of Week: %u (GPS Time: %f)\n",
+ week, tow, week * 604800 + tow / 1000.0);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: a0: %12.4E, a1: %12.4E, a2: %12.4E, a3: %12.4E, "
+ "b0: %12.4E, b1: %12.4E, b2: %12.4E, b3: %12.4E\n",
+ (double)alpha0 * SF_ALPHA0, (double)alpha1 * SF_ALPHA1,
+ (double)alpha2 * SF_ALPHA2, (double)alpha3 * SF_ALPHA3,
+ (double)beta0 * SF_BETA0, (double)beta1 * SF_BETA1,
+ (double)beta2 * SF_BETA2, (double)beta3 * SF_BETA3);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: A0: %19.12E, A1: %19.12E\n", (double)a0 * SF_A0,
+ (double)a1 * SF_A1);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: UTC Ref. Time: %lu, UTC Ref. Week: %u, dTls: %d\n",
+ (unsigned long)tot * SF_TOT, wnt, dtls);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: Week of leap seconds: %u, Day number of leap seconds: %u, dTlsf: %d\n",
+ wnlsf, dn, dtlsf);
return 0; /* No flag for update of leap seconds (Not part of a fix) */
@@ -322,12 +322,12 @@ static gps_mask_t handle_0x06(struct gps_device_t *session)
uint8_t cmd_id = getub(buf, 3);
uint8_t port = getub(buf, 4);
session->driver.navcom.physical_port = port; /* This tells us which serial port was used last */
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0x06 (Acknowledgement (without error))\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0x06 (Acknowledgement (without error))\n");
/*@ -type @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: acknowledged command id 0x%02x on port %c\n",
- cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: acknowledged command id 0x%02x on port %c\n",
+ cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
/*@ +type @*/
return 0; /* Nothing updated */
}
@@ -340,19 +340,19 @@ static gps_mask_t handle_0x15(struct gps_device_t *session)
size_t msg_len = (size_t) getleu16(buf, 1);
/*@ -type @*/
uint8_t port, cmd_id = getub(buf, 3);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0x15 (Negative Acknowledge)\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0x15 (Negative Acknowledge)\n");
for (n = 4; n < (msg_len - 2); n += 2) {
uint8_t err_id = getub(buf, n);
uint8_t err_desc = getub(buf, n + 1);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: error id = 0x%02x, error description = 0x%02x\n",
- err_id, err_desc);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: error id = 0x%02x, error description = 0x%02x\n",
+ err_id, err_desc);
}
port = getub(buf, n);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: negative acknowledge was for command id 0x%02x on port %c\n",
- cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: negative acknowledge was for command id 0x%02x on port %c\n",
+ cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
/*@ -type @*/
return 0; /* Nothing updated */
}
@@ -483,22 +483,22 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
if (tdop != DOP_UNDEFINED)
session->gpsdata.dop.tdop = tdop / 10.0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0xb1 (PVT Report)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: navigation mode %s (0x%02x) - %s - %s\n",
- ((-nav_mode & 0x80)!='\0' ? "invalid" : "valid"), nav_mode,
- ((nav_mode & 0x40)!='\0' ? "3D" : "2D"),
- ((nav_mode & 0x03)!='\0' ? "DGPS" : "GPS"));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0xb1 (PVT Report)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: navigation mode %s (0x%02x) - %s - %s\n",
+ ((-nav_mode & 0x80)!='\0' ? "invalid" : "valid"), nav_mode,
+ ((nav_mode & 0x40)!='\0' ? "3D" : "2D"),
+ ((nav_mode & 0x03)!='\0' ? "DGPS" : "GPS"));
/*@ +type @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: latitude = %f, longitude = %f, altitude = %f, geoid = %f\n",
- session->newdata.latitude, session->newdata.longitude,
- session->newdata.altitude, session->gpsdata.separation);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: velocities: north = %f, east = %f, up = %f (track = %f, speed = %f)\n",
- vel_north * VEL_RES, vel_east * VEL_RES, vel_up * VEL_RES,
- session->newdata.track, session->newdata.speed);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: latitude = %f, longitude = %f, altitude = %f, geoid = %f\n",
+ session->newdata.latitude, session->newdata.longitude,
+ session->newdata.altitude, session->gpsdata.separation);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: velocities: north = %f, east = %f, up = %f (track = %f, speed = %f)\n",
+ vel_north * VEL_RES, vel_east * VEL_RES, vel_up * VEL_RES,
+ session->newdata.track, session->newdata.speed);
#undef D_RES
#undef LL_RES
#undef LL_FRAC_RES
@@ -510,29 +510,29 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
| STATUS_SET | MODE_SET | USED_IS | HERR_SET | VERR_SET
| TIMERR_SET | DOP_SET
| TIME_SET | PPSTIME_IS;
- gpsd_report(&session->context->errout, 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 "
- "gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f "
- "mask={LATLON|ALTITUDE|CLIMB|SPEED|TRACK|TIME|STATUS|MODE|"
- "USED|HERR|VERR|TIMERR|DOP}\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude,
- session->newdata.speed,
- session->newdata.track,
- session->newdata.climb,
- session->newdata.mode,
- session->gpsdata.status,
- session->newdata.epx,
- session->newdata.epy,
- session->newdata.epv,
- session->gpsdata.dop.gdop,
- session->gpsdata.dop.pdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, 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 "
+ "gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f "
+ "mask={LATLON|ALTITUDE|CLIMB|SPEED|TRACK|TIME|STATUS|MODE|"
+ "USED|HERR|VERR|TIMERR|DOP}\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude,
+ session->newdata.speed,
+ session->newdata.track,
+ session->newdata.climb,
+ session->newdata.mode,
+ session->gpsdata.status,
+ session->newdata.epx,
+ session->newdata.epy,
+ session->newdata.epv,
+ session->gpsdata.dop.gdop,
+ session->gpsdata.dop.pdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
return mask;
}
@@ -636,41 +636,42 @@ static gps_mask_t handle_0x81(struct gps_device_t *session)
session->context->gps_week = (unsigned short)wn;
session->context->gps_tow = (double)(toc * SF_TOC);
/* leap second? */
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0x81 (Packed Ephemeris Data)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: PRN: %u, Week: %u, TOW: %.3f SV clock bias/drift/drift rate: %#19.12E/%#19.12E/%#19.12E\n",
- prn,
- session->context->gps_week,
- session->context->gps_tow,
- ((double)af0) * SF_AF0,
- ((double)af1) * SF_AF1, ((double)af2) * SF_AF2);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: IODE (!AODE): %u Crs: %19.12e, Delta n: %19.12e, M0: %19.12e\n",
- iode, (double)crs * SF_CRS,
- (double)delta_n * SF_DELTA_N * GPS_PI,
- (double)m0 * SF_M0 * GPS_PI);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: Cuc: %19.12e, Eccentricity: %19.12e, Cus: %19.12e, A^1/2: %19.12e\n",
- (double)cuc * SF_CUC, (double)e * SF_E, (double)cus * SF_CUS,
- (double)sqrt_a * SF_SQRT_A);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: TOE: %u, Cic: %19.12e, Omega %19.12e, Cis: %19.12e\n",
- toe * SF_TOE, (double)cic * SF_CIC,
- (double)Omega0 * SF_OMEGA0 * GPS_PI, (double)cis * SF_CIS);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: i0: %19.12e, Crc: %19.12e, omega: %19.12e, Omega dot: %19.12e\n",
- (double)i0 * SF_I0 * GPS_PI, (double)crc * SF_CRC,
- (double)omega * SF_OMEGA * GPS_PI,
- (double)Omegadot * SF_OMEGADOT * GPS_PI);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: IDOT: %19.12e, Codes on L2: 0x%x, GPS Week: %u, L2 P data flag: %x\n",
- (double)idot * SF_IDOT * GPS_PI, cl2,
- week - (week % 1024) + wn, l2pd);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: SV accuracy: 0x%x, SV health: 0x%x, TGD: %f, IODC (!AODC): %u\n",
- ura, svh, (double)tgd * SF_TGD, iodc);
- gpsd_report(&session->context->errout, LOG_DATA, "Navcom: Transmission time: %u\n", tow);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0x81 (Packed Ephemeris Data)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: PRN: %u, Week: %u, TOW: %.3f SV clock bias/drift/drift rate: %#19.12E/%#19.12E/%#19.12E\n",
+ prn,
+ session->context->gps_week,
+ session->context->gps_tow,
+ ((double)af0) * SF_AF0,
+ ((double)af1) * SF_AF1, ((double)af2) * SF_AF2);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: IODE (!AODE): %u Crs: %19.12e, Delta n: %19.12e, M0: %19.12e\n",
+ iode, (double)crs * SF_CRS,
+ (double)delta_n * SF_DELTA_N * GPS_PI,
+ (double)m0 * SF_M0 * GPS_PI);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: Cuc: %19.12e, Eccentricity: %19.12e, Cus: %19.12e, A^1/2: %19.12e\n",
+ (double)cuc * SF_CUC, (double)e * SF_E, (double)cus * SF_CUS,
+ (double)sqrt_a * SF_SQRT_A);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: TOE: %u, Cic: %19.12e, Omega %19.12e, Cis: %19.12e\n",
+ toe * SF_TOE, (double)cic * SF_CIC,
+ (double)Omega0 * SF_OMEGA0 * GPS_PI, (double)cis * SF_CIS);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: i0: %19.12e, Crc: %19.12e, omega: %19.12e, Omega dot: %19.12e\n",
+ (double)i0 * SF_I0 * GPS_PI, (double)crc * SF_CRC,
+ (double)omega * SF_OMEGA * GPS_PI,
+ (double)Omegadot * SF_OMEGADOT * GPS_PI);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: IDOT: %19.12e, Codes on L2: 0x%x, GPS Week: %u, L2 P data flag: %x\n",
+ (double)idot * SF_IDOT * GPS_PI, cl2,
+ week - (week % 1024) + wn, l2pd);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: SV accuracy: 0x%x, SV health: 0x%x, TGD: %f, IODC (!AODC): %u\n",
+ ura, svh, (double)tgd * SF_TGD, iodc);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: Transmission time: %u\n", tow);
#undef SF_TGD
#undef SF_TOC
@@ -736,10 +737,10 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
}
/*@ -predboolothers @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: engine status = 0x%x, almanac = %s, time = 0x%x, pos = 0x%x\n",
- eng_status & 0x07, (eng_status & 0x08 ? "valid" : "invalid"),
- eng_status & 0x30 >> 4, eng_status & 0xc0 >> 6);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: engine status = 0x%x, almanac = %s, time = 0x%x, pos = 0x%x\n",
+ eng_status & 0x07, (eng_status & 0x08 ? "valid" : "invalid"),
+ eng_status & 0x30 >> 4, eng_status & 0xc0 >> 6);
/*@ +predboolothers @*/
/* Satellite details */
@@ -748,8 +749,8 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
uint8_t prn, ele, ca_snr, p2_snr, log_channel, hw_channel, s, stat;
uint16_t azm, dgps_age;
if (i >= MAXCHANNELS) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Navcom: packet type 0x86: too many satellites!\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Navcom: packet type 0x86: too many satellites!\n");
gpsd_zero_satellites(&session->gpsdata);
return 0;
}
@@ -800,26 +801,26 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
nsu++;
}
session->gpsdata.satellites_used = (int)nsu;
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: prn = %3u, ele = %02u, azm = %03u, snr = %d (%s), "
- "dgps age = %.1fs, log ch = %d, hw ch = 0x%02x\n",
- prn, ele, azm, s, (p2_snr ? "P2" : "C/A"),
- (double)dgps_age * 0.1, log_channel & 0x3f, hw_channel);
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: sol. valid = %c, clock = %s, pos. = %s, "
- "height = %s, err. code = 0x%x\n",
- (sol_status & 0x01 ? 'Y' : 'N'),
- (sol_status & 0x02 ? "stable" : "unstable"),
- (sol_status & 0x04 ? "dgps" : "unaided"),
- (sol_status & 0x08 ? "solved" : "constrained"),
- (sol_status & 0x01 ? 0x00 : sol_status & 0x0f00 >> 8));
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: prn = %3u, ele = %02u, azm = %03u, snr = %d (%s), "
+ "dgps age = %.1fs, log ch = %d, hw ch = 0x%02x\n",
+ prn, ele, azm, s, (p2_snr ? "P2" : "C/A"),
+ (double)dgps_age * 0.1, log_channel & 0x3f, hw_channel);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: sol. valid = %c, clock = %s, pos. = %s, "
+ "height = %s, err. code = 0x%x\n",
+ (sol_status & 0x01 ? 'Y' : 'N'),
+ (sol_status & 0x02 ? "stable" : "unstable"),
+ (sol_status & 0x04 ? "dgps" : "unaided"),
+ (sol_status & 0x08 ? "solved" : "constrained"),
+ (sol_status & 0x01 ? 0x00 : sol_status & 0x0f00 >> 8));
/*@ +predboolothers -charint @*/
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "CS 0x86: visible=%d, used=%d, mask={SATELLITE|STATUS}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "CS 0x86: visible=%d, used=%d, mask={SATELLITE|STATUS}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | STATUS_SET;
}
@@ -839,17 +840,17 @@ static gps_mask_t handle_0xb0(struct gps_device_t *session)
session->context->gps_week = (unsigned short)week;
session->context->gps_tow = (double)tow / 1000.0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0xb0 (Raw Meas. Data Block)\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0xb0 (Raw Meas. Data Block)\n");
/*@ -predboolothers @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: week = %u, tow = %.3f, time slew accumulator = %u (1/1023mS), status = 0x%02x "
- "(%sclock %s - %u blocks follow)\n",
- session->context->gps_week,
- session->context->gps_tow,
- tm_slew_acc, status,
- (status & 0x80 ? "channel time set - " : ""),
- (status & 0x40 ? "stable" : "not stable"), status & 0x0f);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: week = %u, tow = %.3f, time slew accumulator = %u (1/1023mS), status = 0x%02x "
+ "(%sclock %s - %u blocks follow)\n",
+ session->context->gps_week,
+ session->context->gps_tow,
+ tm_slew_acc, status,
+ (status & 0x80 ? "channel time set - " : ""),
+ (status & 0x40 ? "stable" : "not stable"), status & 0x0f);
/*@ +predboolothers @*/
for (n = 11; n < msg_len - 1; n += 16) {
uint8_t sv_status = getub(buf, n);
@@ -880,19 +881,19 @@ static gps_mask_t handle_0xb0(struct gps_device_t *session)
double p2 =
(sv_status & 0x20 ? c1 +
(double)p2_ca_pseudorange / 16.0 * LAMBDA_L1 : NAN);
- gpsd_report(&session->context->errout, LOG_DATA + 1,
- "Navcom: >> sv status = 0x%02x (PRN %u - C/A & L1 %s - P1 %s - P2 & L2 %s)\n",
- sv_status, (sv_status & 0x1f),
- (sv_status & 0x80 ? "valid" : "invalid"),
- (sv_status & 0x40 ? "valid" : "invalid"),
- (sv_status & 0x20 ? "valid" : "invalid"));
- gpsd_report(&session->context->errout, LOG_DATA + 1,
- "Navcom: >>> ch status = 0x%02x (Logical channel: %u - CA C/No: %u dBHz) "
- "sL1: %u, sL2: %u\n", ch_status, ch_status & 0x0f,
- ((ch_status & 0xf0) >> 4) + 35, l1_slips, l2_slips);
- gpsd_report(&session->context->errout, LOG_DATA + 1,
- "Navcom: >>> C1: %14.3f, L1: %14.3f, L2: %14.3f, P1: %14.3f, P2: %14.3f\n",
- c1, l1, l2, p1, p2);
+ gpsd_log(&session->context->errout, LOG_DATA + 1,
+ "Navcom: >> sv status = 0x%02x (PRN %u - C/A & L1 %s - P1 %s - P2 & L2 %s)\n",
+ sv_status, (sv_status & 0x1f),
+ (sv_status & 0x80 ? "valid" : "invalid"),
+ (sv_status & 0x40 ? "valid" : "invalid"),
+ (sv_status & 0x20 ? "valid" : "invalid"));
+ gpsd_log(&session->context->errout, LOG_DATA + 1,
+ "Navcom: >>> ch status = 0x%02x (Logical channel: %u - CA C/No: %u dBHz) "
+ "sL1: %u, sL2: %u\n", ch_status, ch_status & 0x0f,
+ ((ch_status & 0xf0) >> 4) + 35, l1_slips, l2_slips);
+ gpsd_log(&session->context->errout, LOG_DATA + 1,
+ "Navcom: >>> C1: %14.3f, L1: %14.3f, L2: %14.3f, P1: %14.3f, P2: %14.3f\n",
+ c1, l1, l2, p1, p2);
/*@ +predboolothers -charint @*/
}
#undef LAMBDA_L1
@@ -931,17 +932,17 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
session->newdata.time = gpsd_gpstime_resolve(session,
(unsigned short)week,
(double)tow / 1000.0f);
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0xb5 (Pseudorange Noise Statistics)\n");
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: epe = %f\n", session->gpsdata.epe);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0xb5 (Pseudorange Noise Statistics)\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: epe = %f\n", session->gpsdata.epe);
return mask;
} else {
/* Ignore this message block */
if (!session->driver.navcom.warned) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "Navcom: received packet type 0xb5 (Pseudorange Noise Statistics) ignored "
- " - sizeof(double) == 64 bits required\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Navcom: received packet type 0xb5 (Pseudorange Noise Statistics) ignored "
+ " - sizeof(double) == 64 bits required\n");
session->driver.navcom.warned = true;
}
return 0; /* Block ignored - wrong sizeof(double) */
@@ -1062,22 +1063,22 @@ static gps_mask_t handle_0xae(struct gps_device_t *session)
asicstr = "?";
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0xae (Identification Block)\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0xae (Identification Block)\n");
if (msg_len == 0x0037) {
- gpsd_report(&session->context->errout, LOG_INF, "Navcom: ID Data: "
- "%s %s Ver. %u.%u.%u, DC S/N: %u.%u, RF S/N: %u.%u, "
- "Build ID: %s, Boot software: %s\n",
- engconfstr, asicstr, swvermaj, swvermin, slsbn, dcser,
- dcclass, rfcser, rfcclass, softtm, bootstr);
+ gpsd_log(&session->context->errout, LOG_INF, "Navcom: ID Data: "
+ "%s %s Ver. %u.%u.%u, DC S/N: %u.%u, RF S/N: %u.%u, "
+ "Build ID: %s, Boot software: %s\n",
+ engconfstr, asicstr, swvermaj, swvermin, slsbn, dcser,
+ dcclass, rfcser, rfcclass, softtm, bootstr);
} else {
- gpsd_report(&session->context->errout, LOG_INF, "Navcom: ID Data: "
- "%s %s Ver. %u.%u.%u, DC S/N: %u.%u, RF S/N: %u.%u, "
- "Build ID: %s, Boot software: %s, "
- "IOP Ver.: %u.%u.%u, PIC: %u, IOP Build ID: %s\n",
- engconfstr, asicstr, swvermaj, swvermin, slsbn, dcser,
- dcclass, rfcser, rfcclass, softtm, bootstr, iopvermaj,
- iopvermin, iopsbn, picver, ioptm);
+ gpsd_log(&session->context->errout, LOG_INF, "Navcom: ID Data: "
+ "%s %s Ver. %u.%u.%u, DC S/N: %u.%u, RF S/N: %u.%u, "
+ "Build ID: %s, Boot software: %s, "
+ "IOP Ver.: %u.%u.%u, PIC: %u, IOP Build ID: %s\n",
+ engconfstr, asicstr, swvermaj, swvermin, slsbn, dcser,
+ dcclass, rfcser, rfcclass, softtm, bootstr, iopvermaj,
+ iopvermin, iopsbn, picver, ioptm);
}
/*@ -formattype @*/
@@ -1115,14 +1116,14 @@ static gps_mask_t handle_0xef(struct gps_device_t *session)
osc_filter_drift_est = NAN;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "Navcom: oscillator temp. = %d, nav. status = 0x%02x, "
- "nav. clock offset = %f, nav. clock drift = %f, "
- "osc. filter drift est. = %f, acc.time slew value = %d\n",
- osc_temp, nav_status, nav_clock_offset, nav_clock_drift,
- osc_filter_drift_est, time_slew);
- gpsd_report(&session->context->errout, LOG_DATA,
- "CDO 0xef: time=%.2f mask={TIME}\n", session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "Navcom: oscillator temp. = %d, nav. status = 0x%02x, "
+ "nav. clock offset = %f, nav. clock drift = %f, "
+ "osc. filter drift est. = %f, acc.time slew value = %d\n",
+ osc_temp, nav_status, nav_clock_offset, nav_clock_drift,
+ osc_filter_drift_est, time_slew);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "CDO 0xef: time=%.2f mask={TIME}\n", session->newdata.time);
return 0;
}
@@ -1142,7 +1143,8 @@ gps_mask_t navcom_parse(struct gps_device_t * session, unsigned char *buf,
msg_len = (uint) getleu16(buf, 4);
/*@ -usedef -compdef @*/
- gpsd_report(&session->context->errout, LOG_RAW, "Navcom: packet type 0x%02x\n", cmd_id);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Navcom: packet type 0x%02x\n", cmd_id);
/*@ +usedef +compdef @*/
session->cycle_end_reliable = true;
@@ -1171,9 +1173,9 @@ gps_mask_t navcom_parse(struct gps_device_t * session, unsigned char *buf,
case 0xef:
return handle_0xef(session);
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "Navcom: received packet type 0x%02x, length %d - unknown or unimplemented\n",
- cmd_id, msg_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Navcom: received packet type 0x%02x, length %d - unknown or unimplemented\n",
+ cmd_id, msg_len);
return 0;
}
}
diff --git a/driver_nmea0183.c b/driver_nmea0183.c
index 0abb7e8c..f67ec350 100644
--- a/driver_nmea0183.c
+++ b/driver_nmea0183.c
@@ -83,15 +83,15 @@ static void merge_ddmmyy(char *ddmmyy, struct gps_device_t *session)
year = (session->context->century + yy);
if ( (1 > mon ) || (12 < mon ) ) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "merge_ddmmyy(%s), malformed month\n", ddmmyy);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "merge_ddmmyy(%s), malformed month\n", ddmmyy);
} else if ( (1 > mday ) || (31 < mday ) ) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "merge_ddmmyy(%s), malformed day\n", ddmmyy);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "merge_ddmmyy(%s), malformed day\n", ddmmyy);
} else {
- gpsd_report(&session->context->errout, LOG_DATA,
- "merge_ddmmyy(%s) sets year %d\n",
- ddmmyy, year);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "merge_ddmmyy(%s) sets year %d\n",
+ ddmmyy, year);
session->nmea.date.tm_year = year - 1900;
session->nmea.date.tm_mon = mon - 1;
session->nmea.date.tm_mday = mday;
@@ -120,9 +120,9 @@ static void register_fractional_time(const char *tag, const char *fld,
session->nmea.this_frac_time;
session->nmea.this_frac_time = safe_atof(fld);
session->nmea.latch_frac_time = true;
- gpsd_report(&session->context->errout, LOG_DATA,
- "%s: registers fractional time %.2f\n",
- tag, session->nmea.this_frac_time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "%s: registers fractional time %.2f\n",
+ tag, session->nmea.this_frac_time);
}
}
@@ -211,16 +211,16 @@ static gps_mask_t processRMC(int count, char *field[],
}
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "RMC: ddmmyy=%s hhmmss=%s lat=%.2f lon=%.2f "
- "speed=%.2f track=%.2f mode=%d status=%d\n",
- field[9], field[1],
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.speed,
- session->newdata.track,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "RMC: ddmmyy=%s hhmmss=%s lat=%.2f lon=%.2f "
+ "speed=%.2f track=%.2f mode=%d status=%d\n",
+ field[9], field[1],
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.speed,
+ session->newdata.track,
+ session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
@@ -267,8 +267,8 @@ static gps_mask_t processGLL(int count, char *field[],
merge_hhmmss(field[5], session);
register_fractional_time(field[0], field[5], session);
if (session->nmea.date.tm_year == 0)
- gpsd_report(&session->context->errout, LOG_WARN,
- "can't use GLL time until after ZDA or RMC has supplied a year.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "can't use GLL time until after ZDA or RMC has supplied a year.\n");
else {
mask = TIME_SET;
}
@@ -297,13 +297,13 @@ static gps_mask_t processGLL(int count, char *field[],
mask |= STATUS_SET;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "GLL: hhmmss=%s lat=%.2f lon=%.2f mode=%d status=%d\n",
- field[5],
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GLL: hhmmss=%s lat=%.2f lon=%.2f mode=%d status=%d\n",
+ field[5],
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
@@ -357,8 +357,8 @@ static gps_mask_t processGGA(int c UNUSED, char *field[],
merge_hhmmss(field[1], session);
register_fractional_time(field[0], field[1], session);
if (session->nmea.date.tm_year == 0)
- gpsd_report(&session->context->errout, LOG_WARN,
- "can't use GGA time until after ZDA or RMC has supplied a year.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "can't use GGA time until after ZDA or RMC has supplied a year.\n");
else {
mask |= TIME_SET;
}
@@ -399,14 +399,14 @@ static gps_mask_t processGGA(int c UNUSED, char *field[],
session->newdata.longitude);
}
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "GGA: hhmmss=%s lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
- field[1],
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GGA: hhmmss=%s lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
+ field[1],
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude,
+ session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
@@ -442,16 +442,16 @@ static gps_mask_t processGST(int count, char *field[], struct gps_device_t *sess
#undef PARSE_FIELD
register_fractional_time(field[0], field[1], session);
- gpsd_report(&session->context->errout, LOG_DATA,
- "GST: utc = %.2f, rms = %.2f, maj = %.2f, min = %.2f, ori = %.2f, lat = %.2f, lon = %.2f, alt = %.2f\n",
- 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);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GST: utc = %.2f, rms = %.2f, maj = %.2f, min = %.2f, ori = %.2f, lat = %.2f, lon = %.2f, alt = %.2f\n",
+ 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 GST_SET | ONLINE_SET;
}
@@ -532,8 +532,8 @@ static gps_mask_t processGSA(int count, char *field[],
* Alarmingly, it's possible this error may be generic to SiRFstarIII.
*/
if (count < 17) {
- gpsd_report(&session->context->errout, LOG_DATA,
- "GPGSA: malformed, setting ONLINE_SET only.\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GPGSA: malformed, setting ONLINE_SET only.\n");
mask = ONLINE_SET;
} else if (session->nmea.latch_mode) {
/* last GGA had a non-advancing timestamp; don't trust this GSA */
@@ -550,8 +550,8 @@ static gps_mask_t processGSA(int count, char *field[],
mask = 0;
else
mask = MODE_SET;
- gpsd_report(&session->context->errout, LOG_PROG,
- "GPGSA sets mode %d\n", session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "GPGSA sets mode %d\n", session->newdata.mode);
if (field[15][0] != '\0')
session->gpsdata.dop.pdop = safe_atof(field[15]);
if (field[16][0] != '\0')
@@ -568,13 +568,13 @@ static gps_mask_t processGSA(int count, char *field[],
(unsigned short)prn;
}
mask |= DOP_SET | USED_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "GPGSA: mode=%d used=%d pdop=%.2f hdop=%.2f vdop=%.2f\n",
- session->newdata.mode,
- session->gpsdata.satellites_used,
- session->gpsdata.dop.pdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GPGSA: mode=%d used=%d pdop=%.2f hdop=%.2f vdop=%.2f\n",
+ session->newdata.mode,
+ session->gpsdata.satellites_used,
+ session->gpsdata.dop.pdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop);
}
return mask;
}
@@ -606,17 +606,17 @@ static gps_mask_t processGSV(int count, char *field[],
*/
int n, fldnum;
if (count <= 3) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "malformed GPGSV - fieldcount %d <= 3\n",
- count);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed GPGSV - fieldcount %d <= 3\n",
+ count);
gpsd_zero_satellites(&session->gpsdata);
session->gpsdata.satellites_visible = 0;
return ONLINE_SET;
}
if (count % 4 != 0) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "malformed GPGSV - fieldcount %d %% 4 != 0\n",
- count);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed GPGSV - fieldcount %d %% 4 != 0\n",
+ count);
gpsd_zero_satellites(&session->gpsdata);
session->gpsdata.satellites_visible = 0;
return ONLINE_SET;
@@ -624,7 +624,8 @@ static gps_mask_t processGSV(int count, char *field[],
session->nmea.await = atoi(field[1]);
if ((session->nmea.part = atoi(field[2])) < 1) {
- gpsd_report(&session->context->errout, LOG_WARN, "malformed GPGSV - bad part\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed GPGSV - bad part\n");
gpsd_zero_satellites(&session->gpsdata);
return ONLINE_SET;
} else if (session->nmea.part == 1) {
@@ -647,9 +648,9 @@ static gps_mask_t processGSV(int count, char *field[],
for (fldnum = 4; fldnum < count;) {
struct satellite_t *sp;
if (session->gpsdata.satellites_visible >= MAXCHANNELS) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "internal error - too many satellites [%d]!\n",
- session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "internal error - too many satellites [%d]!\n",
+ session->gpsdata.satellites_visible);
gpsd_zero_satellites(&session->gpsdata);
break;
}
@@ -676,15 +677,15 @@ static gps_mask_t processGSV(int count, char *field[],
}
if (session->nmea.part == session->nmea.await
&& atoi(field[3]) != session->gpsdata.satellites_visible)
- gpsd_report(&session->context->errout, LOG_WARN,
- "GPGSV field 3 value of %d != actual count %d\n",
- atoi(field[3]), session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "GPGSV field 3 value of %d != actual count %d\n",
+ atoi(field[3]), session->gpsdata.satellites_visible);
/* not valid data until we've seen a complete set of parts */
if (session->nmea.part < session->nmea.await) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Partial satellite data (%d of %d).\n",
- session->nmea.part, session->nmea.await);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Partial satellite data (%d of %d).\n",
+ session->nmea.part, session->nmea.await);
return ONLINE_SET;
}
/*
@@ -698,16 +699,16 @@ static gps_mask_t processGSV(int count, char *field[],
for (n = 0; n < session->gpsdata.satellites_visible; n++)
if (session->gpsdata.skyview[n].azimuth != 0)
goto sane;
- gpsd_report(&session->context->errout, LOG_WARN,
- "Satellite data no good (%d of %d).\n",
- session->nmea.part, session->nmea.await);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Satellite data no good (%d of %d).\n",
+ session->nmea.part, session->nmea.await);
gpsd_zero_satellites(&session->gpsdata);
return ONLINE_SET;
sane:
session->gpsdata.skyview_time = NAN;
- gpsd_report(&session->context->errout, LOG_DATA,
- "GSV: Satellite data OK (%d of %d).\n",
- session->nmea.part, session->nmea.await);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GSV: Satellite data OK (%d of %d).\n",
+ session->nmea.part, session->nmea.await);
/* assumes GLGSV or BDGSV group, if present, is emitted after the GPGSV */
if ((session->nmea.seen_glgsv || session->nmea.seen_bdgsv || session->nmea.seen_qzss) && GSV_TALKER == 'P')
@@ -752,11 +753,11 @@ static gps_mask_t processPGRME(int c UNUSED, char *field[],
mask = HERR_SET | VERR_SET | PERR_IS;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "PGRME: epx=%.2f epy=%.2f epv=%.2f\n",
- session->newdata.epx,
- session->newdata.epy,
- session->newdata.epv);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "PGRME: epx=%.2f epy=%.2f epv=%.2f\n",
+ session->newdata.epx,
+ session->newdata.epy,
+ session->newdata.epv);
return mask;
}
@@ -787,15 +788,15 @@ static gps_mask_t processGBS(int c UNUSED, char *field[],
session->newdata.epy = safe_atof(field[2]);
session->newdata.epx = safe_atof(field[3]);
session->newdata.epv = safe_atof(field[4]);
- gpsd_report(&session->context->errout, LOG_DATA,
- "GBS: epx=%.2f epy=%.2f epv=%.2f\n",
- session->newdata.epx,
- session->newdata.epy,
- session->newdata.epv);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "GBS: epx=%.2f epy=%.2f epv=%.2f\n",
+ session->newdata.epx,
+ session->newdata.epy,
+ session->newdata.epv);
return HERR_SET | VERR_SET;
} else {
- gpsd_report(&session->context->errout, LOG_PROG,
- "second in $GPGBS error estimates doesn't match.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "second in $GPGBS error estimates doesn't match.\n");
return 0;
}
}
@@ -822,7 +823,7 @@ static gps_mask_t processZDA(int c UNUSED, char *field[],
if (field[1][0] == '\0' || field[2][0] == '\0' || field[3][0] == '\0'
|| field[4][0] == '\0') {
- gpsd_report(&session->context->errout, LOG_WARN, "ZDA fields are empty\n");
+ gpsd_log(&session->context->errout, LOG_WARN, "ZDA fields are empty\n");
} else {
int year, mon, mday, century;
@@ -838,14 +839,14 @@ static gps_mask_t processZDA(int c UNUSED, char *field[],
mday = atoi(field[2]);
century = year - year % 100;
if ( (1900 > year ) || (2200 < year ) ) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "malformed ZDA year: %s\n", field[4]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed ZDA year: %s\n", field[4]);
} else if ( (1 > mon ) || (12 < mon ) ) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "malformed ZDA month: %s\n", field[3]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed ZDA month: %s\n", field[3]);
} else if ( (1 > mday ) || (31 < mday ) ) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "malformed ZDA day: %s\n", field[2]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "malformed ZDA day: %s\n", field[2]);
} else {
gpsd_century_update(session, century);
session->nmea.date.tm_year = year - 1900;
@@ -895,10 +896,10 @@ static gps_mask_t processHDT(int c UNUSED, char *field[],
session->gpsdata.attitude.depth = NAN;
mask |= (ATTITUDE_SET);
- gpsd_report(&session->context->errout, LOG_RAW,
- "time %.3f, heading %lf.\n",
- session->newdata.time,
- session->gpsdata.attitude.heading);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "time %.3f, heading %lf.\n",
+ session->newdata.time,
+ session->gpsdata.attitude.heading);
return mask;
}
@@ -943,10 +944,10 @@ static gps_mask_t processDBT(int c UNUSED, char *field[],
* no better place to put it. Should work in practice as nobody is
* likely to be operating a depth sounder at varying altitudes.
*/
- gpsd_report(&session->context->errout, LOG_RAW,
- "mode %d, depth %lf.\n",
- session->newdata.mode,
- session->newdata.altitude);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "mode %d, depth %lf.\n",
+ session->newdata.mode,
+ session->newdata.altitude);
return mask;
}
@@ -1010,11 +1011,11 @@ static gps_mask_t processTNTHTM(int c UNUSED, char *field[],
session->gpsdata.attitude.depth = NAN;
mask |= (ATTITUDE_SET);
- gpsd_report(&session->context->errout, LOG_RAW,
- "time %.3f, heading %lf (%c).\n",
- session->newdata.time,
- session->gpsdata.attitude.heading,
- session->gpsdata.attitude.mag_st);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "time %.3f, heading %lf (%c).\n",
+ session->newdata.time,
+ session->gpsdata.attitude.heading,
+ session->gpsdata.attitude.mag_st);
return mask;
}
#endif /* TNT_ENABLE */
@@ -1069,8 +1070,8 @@ static gps_mask_t processOHPR(int c UNUSED, char *field[],
session->gpsdata.attitude.gyro_y = safe_atof(field[16]);
mask |= (ATTITUDE_SET);
- gpsd_report(&session->context->errout, LOG_RAW,
- "Heading %lf.\n", session->gpsdata.attitude.heading);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Heading %lf.\n", session->gpsdata.attitude.heading);
return mask;
}
#endif /* OCEANSERVER_ENABLE */
@@ -1085,9 +1086,9 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
if (0 == strcmp("RID", field[1])) { /* Receiver ID */
(void)snprintf(session->subtype, sizeof(session->subtype) - 1,
"%s ver %s", field[2], field[3]);
- gpsd_report(&session->context->errout, LOG_DATA,
- "PASHR,RID: subtype=%s mask={}\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "PASHR,RID: subtype=%s mask={}\n",
+ session->subtype);
return mask;
} else if (0 == strcmp("POS", field[1])) { /* 3D Position */
mask |= MODE_SET | STATUS_SET | CLEAR_IS;
@@ -1118,15 +1119,15 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
mask |= (TIME_SET | LATLON_SET | ALTITUDE_SET);
mask |= (SPEED_SET | TRACK_SET | CLIMB_SET);
mask |= DOP_SET;
- gpsd_report(&session->context->errout, 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\n",
- field[4], session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- 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_log(&session->context->errout, 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\n",
+ field[4], session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ 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);
}
} else if (0 == strcmp("SAT", field[1])) { /* Satellite Status */
struct satellite_t *sp;
@@ -1143,9 +1144,9 @@ static gps_mask_t processPASHR(int c UNUSED, char *field[],
session->gpsdata.satellites_used++;
}
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "PASHR,SAT: used=%d\n",
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "PASHR,SAT: used=%d\n",
+ session->gpsdata.satellites_used);
session->gpsdata.skyview_time = NAN;
mask |= SATELLITE_SET | USED_IS;
}
@@ -1220,8 +1221,8 @@ static gps_mask_t processMTK3301(int c UNUSED, char *field[],
case 001: /* ACK / NACK */
reason = atoi(field[2]);
if (atoi(field[1]) == -1)
- gpsd_report(&session->context->errout, LOG_WARN,
- "MTK NACK: unknown sentence\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "MTK NACK: unknown sentence\n");
else if (reason < 3) {
const char *mtk_reasons[] = {
"Invalid",
@@ -1229,14 +1230,13 @@ static gps_mask_t processMTK3301(int c UNUSED, char *field[],
"Valid but Failed",
"Valid success"
};
- gpsd_report(&session->context->errout, LOG_WARN,
- "MTK NACK: %s, reason: %s\n",
- field[1],
- mtk_reasons[reason]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "MTK NACK: %s, reason: %s\n",
+ field[1], mtk_reasons[reason]);
}
else
- gpsd_report(&session->context->errout, LOG_WARN,
- "MTK ACK: %s\n", field[1]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "MTK ACK: %s\n", field[1]);
return ONLINE_SET;
default:
return ONLINE_SET; /* ignore */
@@ -1325,9 +1325,9 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
* packets. This may be a generic bug of all Garmin chipsets.
*/
if (strlen(sentence) > NMEA_MAX) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "Overlong packet of %zd chars rejected.\n",
- strlen(sentence));
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Overlong packet of %zd chars rejected.\n",
+ strlen(sentence));
return ONLINE_SET;
}
@@ -1406,15 +1406,15 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
* WARNING: This assumes time is always field 0, and that field 0
* is a timestamp whenever TIME_SET is set.
*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "%s time is %2f = %d-%02d-%02dT%02d:%02d:%02.2fZ\n",
- session->nmea.field[0], session->newdata.time,
- 1900 + session->nmea.date.tm_year,
- session->nmea.date.tm_mon + 1,
- session->nmea.date.tm_mday,
- session->nmea.date.tm_hour,
- session->nmea.date.tm_min,
- session->nmea.date.tm_sec + session->nmea.subseconds);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "%s time is %2f = %d-%02d-%02dT%02d:%02d:%02.2fZ\n",
+ session->nmea.field[0], session->newdata.time,
+ 1900 + session->nmea.date.tm_year,
+ session->nmea.date.tm_mon + 1,
+ session->nmea.date.tm_mday,
+ session->nmea.date.tm_hour,
+ session->nmea.date.tm_min,
+ session->nmea.date.tm_sec + session->nmea.subseconds);
/*
* If we have time and PPS is available, assume we have good time.
* Because this is a generic driver we don't really have enough
@@ -1436,18 +1436,18 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
* mid-cycle, as in the Garmin eXplorist 210; those might jitter.
*/
if (session->nmea.latch_frac_time) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "%s sentence timestamped %.2f.\n",
- session->nmea.field[0],
- session->nmea.this_frac_time);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "%s sentence timestamped %.2f.\n",
+ session->nmea.field[0],
+ session->nmea.this_frac_time);
if (!GPS_TIME_EQUAL
(session->nmea.this_frac_time,
session->nmea.last_frac_time)) {
uint lasttag = session->nmea.lasttag;
retval |= CLEAR_IS;
- gpsd_report(&session->context->errout, LOG_PROG,
- "%s starts a reporting cycle.\n",
- session->nmea.field[0]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "%s starts a reporting cycle.\n",
+ session->nmea.field[0]);
/*
* Have we seen a previously timestamped NMEA tag?
* If so, designate as end-of-cycle marker.
@@ -1458,21 +1458,21 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
&& (session->nmea.cycle_enders & (1 << lasttag)) == 0
&& !session->nmea.cycle_continue) {
session->nmea.cycle_enders |= (1 << lasttag);
- gpsd_report(&session->context->errout, LOG_PROG,
- "tagged %s as a cycle ender.\n",
- nmea_phrase[lasttag - 1].name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "tagged %s as a cycle ender.\n",
+ nmea_phrase[lasttag - 1].name);
}
}
} else {
/* extend the cycle to an un-timestamped sentence? */
if ((session->nmea.lasttag & session->nmea.cycle_enders) != 0)
- gpsd_report(&session->context->errout, LOG_PROG,
- "%s is just after a cycle ender.\n",
- session->nmea.field[0]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "%s is just after a cycle ender.\n",
+ session->nmea.field[0]);
if (session->nmea.cycle_continue) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "%s extends the reporting cycle.\n",
- session->nmea.field[0]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "%s extends the reporting cycle.\n",
+ session->nmea.field[0]);
session->nmea.cycle_enders &=~ (1 << session->nmea.lasttag);
session->nmea.cycle_enders |= (1 << thistag);
}
@@ -1480,9 +1480,9 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
/* here's where we check for end-of-cycle */
if ((session->nmea.latch_frac_time || session->nmea.cycle_continue)
&& (session->nmea.cycle_enders & (1 << thistag))!=0) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "%s ends a reporting cycle.\n",
- session->nmea.field[0]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "%s ends a reporting cycle.\n",
+ session->nmea.field[0]);
retval |= REPORT_IS;
}
if (session->nmea.latch_frac_time)
diff --git a/driver_nmea2000.c b/driver_nmea2000.c
index 0f8e6c2e..309708b3 100644
--- a/driver_nmea2000.c
+++ b/driver_nmea2000.c
@@ -86,7 +86,7 @@ static void print_data(struct gps_context_t *context,
ptr += l2;
for (l1=0;l1<len;l1++) {
if (((l1 % 20) == 0) && (l1 != 0)) {
- gpsd_report(&context->errout, LOG_IO,"%s\n", bu);
+ gpsd_log(&context->errout, LOG_IO,"%s\n", bu);
ptr = 0;
l2 = sprintf(&bu[ptr], " : ");
ptr += l2;
@@ -94,7 +94,7 @@ static void print_data(struct gps_context_t *context,
l2 = sprintf(&bu[ptr], "%02ux ", (unsigned int)buffer[l1]);
ptr += l2;
}
- gpsd_report(&context->errout, LOG_IO,"%s\n", bu);
+ gpsd_log(&context->errout, LOG_IO,"%s\n", bu);
}
/*@+bufferoverflowhigh@*/
#else
@@ -129,21 +129,17 @@ static int decode_ais_header(struct gps_context_t *context,
ais->repeat = (unsigned int) ((bu[0] >> 6) & 0x03);
ais->mmsi = (unsigned int) getleu32(bu, 1);
ais->mmsi &= mask;
- gpsd_report(&context->errout, LOG_INF,
- "NMEA2000 AIS message type %u, MMSI %09d:\n",
- ais->type, ais->mmsi);
- printf("NMEA2000 AIS message type %2u, MMSI %09u:\n",
- ais->type, ais->mmsi);
+ gpsd_log(&context->errout, LOG_INF,
+ "NMEA2000 AIS message type %u, MMSI %09d:\n",
+ ais->type, ais->mmsi);
return(1);
} else {
ais->type = 0;
ais->repeat = 0;
ais->mmsi = 0;
- gpsd_report(&context->errout, LOG_ERROR,
- "NMEA2000 AIS message type %u, too short message.\n",
- ais->type);
- printf("NMEA2000 AIS message type %u, too short message.\n",
- ais->type);
+ gpsd_log(&context->errout, LOG_ERROR,
+ "NMEA2000 AIS message type %u, too short message.\n",
+ ais->type);
}
return(0);
}
@@ -202,8 +198,8 @@ static double ais_direction(unsigned int val, double scale)
static gps_mask_t hnd_059392(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -214,8 +210,8 @@ static gps_mask_t hnd_059392(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_060928(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -226,8 +222,8 @@ static gps_mask_t hnd_060928(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_126208(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -238,8 +234,8 @@ static gps_mask_t hnd_126208(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_126464(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -250,8 +246,8 @@ static gps_mask_t hnd_126464(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_126996(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -262,8 +258,8 @@ static gps_mask_t hnd_126996(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_127258(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -274,8 +270,8 @@ static gps_mask_t hnd_127258(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_129025(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
/*@-type@*//* splint has a bug here */
session->newdata.latitude = getles32(bu, 0) * 1e-7;
@@ -292,8 +288,8 @@ static gps_mask_t hnd_129025(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_129026(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
session->driver.nmea2000.sid[0] = bu[0];
@@ -315,8 +311,8 @@ static gps_mask_t hnd_126992(unsigned char *bu, int len, PGN *pgn, struct gps_de
//uint8_t source;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
//sid = bu[0];
//source = bu[1] & 0x0f;
@@ -342,8 +338,8 @@ static gps_mask_t hnd_129539(unsigned char *bu, int len, PGN *pgn, struct gps_de
unsigned int act_mode;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
mask = 0;
session->driver.nmea2000.sid[1] = bu[0];
@@ -367,14 +363,14 @@ static gps_mask_t hnd_129539(unsigned char *bu, int len, PGN *pgn, struct gps_de
/*@+type@*/
mask |= DOP_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d): sid:%02x hdop:%5.2f vdop:%5.2f tdop:%5.2f\n",
- pgn->pgn,
- session->driver.nmea2000.unit,
- session->driver.nmea2000.sid[1],
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop,
- session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d): sid:%02x hdop:%5.2f vdop:%5.2f tdop:%5.2f\n",
+ pgn->pgn,
+ session->driver.nmea2000.unit,
+ session->driver.nmea2000.sid[1],
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop,
+ session->gpsdata.dop.tdop);
return mask | get_mode(session);
}
@@ -388,8 +384,8 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_de
int l1;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
session->driver.nmea2000.sid[2] = bu[0];
session->gpsdata.satellites_visible = (int)bu[2];
@@ -429,8 +425,8 @@ static gps_mask_t hnd_129029(unsigned char *bu, int len, PGN *pgn, struct gps_de
gps_mask_t mask;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
mask = 0;
session->driver.nmea2000.sid[3] = bu[0];
@@ -499,8 +495,8 @@ static gps_mask_t hnd_129038(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
ais->type1.lon = (int) scale_int(getles32(bu, 5), (int64_t)(SHIFT32 *.06L));
@@ -532,8 +528,8 @@ static gps_mask_t hnd_129039(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
ais->type18.lon = (int) scale_int(getles32(bu, 5), (int64_t)(SHIFT32 *.06L));
@@ -571,8 +567,8 @@ static gps_mask_t hnd_129040(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
uint16_t length, beam, to_bow, to_starboard;
@@ -629,8 +625,8 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
uint16_t length, beam, to_bow, to_starboard, date;
@@ -726,8 +722,8 @@ static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
ais->type9.lon = (int) scale_int(getles32(bu, 5), (int64_t)(SHIFT32 *.06L));
@@ -761,8 +757,8 @@ static gps_mask_t hnd_129802(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0x3fffffff) != 0) {
int l;
@@ -789,17 +785,17 @@ static gps_mask_t hnd_129809(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
int l;
int index = session->driver.aivdm.context[0].type24_queue.index;
struct ais_type24a_t *saveptr = &session->driver.aivdm.context[0].type24_queue.ships[index];
- gpsd_report(&session->context->errout, LOG_PROG,
- "NMEA2000: AIS message 24A from %09u stashed.\n",
- ais->mmsi);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "NMEA2000: AIS message 24A from %09u stashed.\n",
+ ais->mmsi);
for (l=0;l<AIS_SHIPNAME_MAXLEN;l++) {
ais->type24.shipname[l] = (char) bu[ 5+l];
@@ -832,8 +828,8 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, struct gps_de
ais = &session->gpsdata.ais;
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
if (decode_ais_header(session->context, bu, len, ais, 0xffffffffU) != 0) {
int l, i;
@@ -883,8 +879,8 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, struct gps_de
}
ais->type24.shipname[AIS_SHIPNAME_MAXLEN] = (char) 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "NMEA2000: AIS 24B from %09u matches a 24A.\n",
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "NMEA2000: AIS 24B from %09u matches a 24A.\n",
ais->mmsi);
/* prevent false match if a 24B is repeated */
session->driver.aivdm.context[0].type24_queue.ships[i].mmsi = 0;
@@ -929,8 +925,8 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_127506(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -941,8 +937,8 @@ static gps_mask_t hnd_127506(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_127508(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -953,8 +949,8 @@ static gps_mask_t hnd_127508(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_127513(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -965,8 +961,8 @@ static gps_mask_t hnd_127513(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_127245(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1015,8 +1011,8 @@ static gps_mask_t hnd_127250(unsigned char *bu, int len, PGN *pgn, struct gps_de
session->gpsdata.attitude.temp = NAN;
session->gpsdata.attitude.depth = NAN;
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(ONLINE_SET | ATTITUDE_SET);
}
@@ -1027,8 +1023,8 @@ static gps_mask_t hnd_127250(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_128259(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1061,8 +1057,8 @@ static gps_mask_t hnd_128267(unsigned char *bu, int len, PGN *pgn, struct gps_de
session->gpsdata.attitude.temp = NAN;
/*@i@*/session->gpsdata.attitude.depth = getleu32(bu, 1) *.01;
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(ONLINE_SET | ATTITUDE_SET);
}
@@ -1073,8 +1069,8 @@ static gps_mask_t hnd_128267(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_128275(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1085,8 +1081,8 @@ static gps_mask_t hnd_128275(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_129283(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1097,8 +1093,8 @@ static gps_mask_t hnd_129283(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_129284(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1109,8 +1105,8 @@ static gps_mask_t hnd_129284(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_129285(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1121,8 +1117,8 @@ static gps_mask_t hnd_129285(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_130306(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1133,8 +1129,8 @@ static gps_mask_t hnd_130306(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_130310(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1145,8 +1141,8 @@ static gps_mask_t hnd_130310(unsigned char *bu, int len, PGN *pgn, struct gps_de
static gps_mask_t hnd_130311(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session)
{
print_data(session->context, bu, len, pgn);
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit);
return(0);
}
@@ -1290,8 +1286,8 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session)
session->driver.nmea2000.workpgn = NULL;
can_net = session->driver.nmea2000.can_net;
if (can_net > (NMEA2000_NETS-1)) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 find_pgn: Invalid can network %d.\n", can_net);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 find_pgn: Invalid can network %d.\n", can_net);
return;
}
@@ -1396,8 +1392,8 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session)
if (work->fast == 0) {
size_t l2;
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d:%s \n", work->pgn, work->name);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d:%s \n", work->pgn, work->name);
session->driver.nmea2000.workpgn = (void *) work;
/*@i1@*/session->lexer.outbuflen = frame->can_dlc & 0x0f;
for (l2=0;l2<session->lexer.outbuflen;l2++) {
@@ -1410,20 +1406,20 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session)
/*@i2@*/session->driver.nmea2000.fast_packet_len = frame->data[1];
/*@i2@*/session->driver.nmea2000.idx = frame->data[0];
#if NMEA2000_FAST_DEBUG
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Set idx %2x %2x %2x %6d\n",
- frame->data[0],
- session->driver.nmea2000.unit,
- frame->data[1],
- source_pgn);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Set idx %2x %2x %2x %6d\n",
+ frame->data[0],
+ session->driver.nmea2000.unit,
+ frame->data[1],
+ source_pgn);
#endif /* of #if NMEA2000_FAST_DEBUG */
session->lexer.inbuflen = 0;
session->driver.nmea2000.idx += 1;
for (l2=2;l2<8;l2++) {
/*@i3@*/session->lexer.inbuffer[session->lexer.inbuflen++] = frame->data[l2];
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "pgn %6d:%s \n", work->pgn, work->name);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "pgn %6d:%s \n", work->pgn, work->name);
}
/*@i2@*/else if (frame->data[0] == session->driver.nmea2000.idx) {
unsigned int l2;
@@ -1435,9 +1431,9 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session)
}
if (session->lexer.inbuflen == session->driver.nmea2000.fast_packet_len) {
#if NMEA2000_FAST_DEBUG
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Fast done %2x %2x %2x %2x %6d\n",
- session->driver.nmea2000.idx,
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Fast done %2x %2x %2x %2x %6d\n",
+ session->driver.nmea2000.idx,
/*@i1@*/frame->data[0],
session->driver.nmea2000.unit,
(unsigned int) session->driver.nmea2000.fast_packet_len,
@@ -1453,18 +1449,18 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session)
session->driver.nmea2000.idx += 1;
}
} else {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Fast error %2x %2x %2x %2x %6d\n",
- session->driver.nmea2000.idx,
- /*@i2@*/frame->data[0],
- session->driver.nmea2000.unit,
- (unsigned int) session->driver.nmea2000.fast_packet_len,
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Fast error %2x %2x %2x %2x %6d\n",
+ session->driver.nmea2000.idx,
+ /*@i2@*/frame->data[0],
+ session->driver.nmea2000.unit,
+ (unsigned int) session->driver.nmea2000.fast_packet_len,
source_pgn);
}
} else {
- gpsd_report(&session->context->errout, LOG_WARN,
- "PGN not found %08d %08x \n",
- source_pgn, source_pgn);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "PGN not found %08d %08x \n",
+ source_pgn, source_pgn);
}
} else {
// we got a unknown unit number
@@ -1557,8 +1553,8 @@ int nmea2000_open(struct gps_device_t *session)
}
if (unit_ptr != NULL) {
if (isdigit(interface_name[l]) == 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: Invalid character in unit number.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: Invalid character in unit number.\n");
return -1;
}
}
@@ -1567,8 +1563,8 @@ int nmea2000_open(struct gps_device_t *session)
if (unit_ptr != NULL) {
unit_number = atoi(unit_ptr);
if ((unit_number < 0) || (unit_number > (NMEA2000_UNITS-1))) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: Unit number out of range.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: Unit number out of range.\n");
return -1;
}
for (l = 0; l < NMEA2000_NETS; l++) {
@@ -1580,8 +1576,8 @@ int nmea2000_open(struct gps_device_t *session)
}
}
if (can_net < 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: CAN device not open: %s .\n", interface_name);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: CAN device not open: %s .\n", interface_name);
return -1;
}
} else {
@@ -1589,7 +1585,7 @@ int nmea2000_open(struct gps_device_t *session)
if (strncmp(can_interface_name[l],
interface_name,
MIN(sizeof(interface_name), sizeof(can_interface_name[l]))) == 0) {
- gpsd_report(&session->context->errout, LOG_ERROR, "NMEA2000 open: CAN device duplicate open: %s .\n", interface_name);
+ gpsd_log(&session->context->errout, LOG_ERROR, "NMEA2000 open: CAN device duplicate open: %s .\n", interface_name);
return -1;
}
}
@@ -1600,8 +1596,8 @@ int nmea2000_open(struct gps_device_t *session)
}
}
if (can_net < 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: Too many CAN networks open.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: Too many CAN networks open.\n");
return -1;
}
}
@@ -1610,15 +1606,15 @@ int nmea2000_open(struct gps_device_t *session)
sock = socket(PF_CAN, SOCK_RAW, CAN_RAW);
if (BAD_SOCKET(sock)) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: can not get socket.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: can not get socket.\n");
return -1;
}
status = fcntl(sock, F_SETFL, O_NONBLOCK);
if (status != 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: can not set socket to O_NONBLOCK.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: can not set socket to O_NONBLOCK.\n");
close(sock);
return -1;
}
@@ -1629,8 +1625,8 @@ int nmea2000_open(struct gps_device_t *session)
* with that device's index */
if (status != 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "NMEA2000 open: can not find CAN device.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: can not find CAN device.\n");
close(sock);
return -1;
}
@@ -1640,7 +1636,8 @@ int nmea2000_open(struct gps_device_t *session)
addr.can_ifindex = ifr.ifr_ifindex;
status = bind(sock, (struct sockaddr*)&addr, sizeof(addr) );
if (status != 0) {
- gpsd_report(&session->context->errout, LOG_ERROR, "NMEA2000 open: bind failed.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "NMEA2000 open: bind failed.\n");
close(sock);
return -1;
}
@@ -1675,9 +1672,9 @@ int nmea2000_open(struct gps_device_t *session)
void nmea2000_close(struct gps_device_t *session)
{
if (!BAD_SOCKET(session->gpsdata.gps_fd)) {
- gpsd_report(&session->context->errout, LOG_SPIN,
- "close(%d) in nmea2000_close(%s)\n",
- session->gpsdata.gps_fd, session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "close(%d) in nmea2000_close(%s)\n",
+ session->gpsdata.gps_fd, session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
INVALIDATE_SOCKET(session->gpsdata.gps_fd);
}
diff --git a/driver_oncore.c b/driver_oncore.c
index 8cea6e7c..a14ad7bf 100644
--- a/driver_oncore.c
+++ b/driver_oncore.c
@@ -75,8 +75,8 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
return 0;
mask = ONLINE_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore NAVSOL - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore NAVSOL - navigation data\n");
flags = (unsigned char)getub(buf, 72);
@@ -88,8 +88,8 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.status = STATUS_FIX;
session->newdata.mode = MODE_2D;
} else {
- gpsd_report(&session->context->errout, LOG_WARN,
- "oncore NAVSOL no fix - flags 0x%02x\n", flags);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "oncore NAVSOL no fix - flags 0x%02x\n", flags);
session->newdata.mode = MODE_NO_FIX;
session->gpsdata.status = STATUS_NO_FIX;
}
@@ -117,11 +117,11 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
session->newdata.time = (timestamp_t)mkgmtime(&unpacked_date) + nsec * 1e-9;
/*@ +unrecog */
mask |= TIME_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore NAVSOL - time: %04d-%02d-%02d %02d:%02d:%02d.%09d\n",
- unpacked_date.tm_year + 1900, unpacked_date.tm_mon + 1,
- unpacked_date.tm_mday, unpacked_date.tm_hour,
- unpacked_date.tm_min, unpacked_date.tm_sec, nsec);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore NAVSOL - time: %04d-%02d-%02d %02d:%02d:%02d.%09d\n",
+ unpacked_date.tm_year + 1900, unpacked_date.tm_mon + 1,
+ unpacked_date.tm_mday, unpacked_date.tm_hour,
+ unpacked_date.tm_min, unpacked_date.tm_sec, nsec);
}
/*@-type@*/
@@ -133,10 +133,10 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
dop = getbeu16(buf, 35) / 10.0f;
/*@+type@*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore NAVSOL - %lf %lf %.2lfm-%.2lfm | %.2fm/s %.1fdeg dop=%.1f\n",
- lat, lon, alt, wgs84_separation(lat, lon), speed, track,
- (float)dop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore NAVSOL - %lf %lf %.2lfm-%.2lfm | %.2fm/s %.1fdeg dop=%.1f\n",
+ lat, lon, alt, wgs84_separation(lat, lon), speed, track,
+ (float)dop);
session->newdata.latitude = lat;
session->newdata.longitude = lon;
@@ -163,8 +163,8 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
sn = (int)getub(buf, off + 2);
status = (int)getub(buf, off + 3);
- gpsd_report(&session->context->errout, LOG_DATA,
- "%2d %2d %2d %3d %02x\n", i, sv, mode, sn, status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "%2d %2d %2d %3d %02x\n", i, sv, mode, sn, status);
if (sn) {
session->gpsdata.skyview[st].PRN = (short)sv;
@@ -222,14 +222,14 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf,
(void)oncore_control_send(session, (char *)pollBo, sizeof(pollBo));
(void)oncore_control_send(session, (char *)pollEn, sizeof(pollEn));
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVSOL: time=%.2f lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f mode=%d status=%d visible=%d used=%d\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- session->newdata.mode, session->gpsdata.status,
- session->gpsdata.satellites_used,
- session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVSOL: time=%.2f lat=%.2f lon=%.2f alt=%.2f speed=%.2f track=%.2f mode=%d status=%d visible=%d used=%d\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ session->newdata.mode, session->gpsdata.status,
+ session->gpsdata.satellites_used,
+ session->gpsdata.satellites_visible);
return mask;
}
@@ -245,8 +245,8 @@ oncore_msg_utc_offset(struct gps_device_t *session, unsigned char *buf,
if (data_len != 8)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore UTCTIME - leap seconds\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore UTCTIME - leap seconds\n");
utc_offset = (int)getub(buf, 4);
if (utc_offset == 0)
return 0; /* that part of almanac not received yet */
@@ -268,7 +268,7 @@ oncore_msg_pps_offset(struct gps_device_t *session, unsigned char *buf,
if (data_len != 11)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA, "oncore PPS offset\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "oncore PPS offset\n");
pps_offset_ns = (int)getbes32(buf, 4);
session->driver.oncore.pps_offset_ns = pps_offset_ns;
@@ -288,11 +288,11 @@ oncore_msg_svinfo(struct gps_device_t *session, unsigned char *buf,
if (data_len != 92)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore SVINFO - satellite data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore SVINFO - satellite data\n");
nchan = (unsigned int)getub(buf, 4);
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore SVINFO - %d satellites:\n", nchan);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore SVINFO - %d satellites:\n", nchan);
/* Then we clamp the value to not read outside the table. */
if (nchan > 12)
nchan = 12;
@@ -305,8 +305,8 @@ oncore_msg_svinfo(struct gps_device_t *session, unsigned char *buf,
int el = (int)getub(buf, off + 3);
int az = (int)getbeu16(buf, off + 4);
- gpsd_report(&session->context->errout, LOG_DATA,
- "%2d %2d %2d %3d\n", i, sv, el, az);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "%2d %2d %2d %3d\n", i, sv, el, az);
/* Store for use when Ea messages come. */
session->driver.oncore.PRN[i] = sv;
@@ -320,8 +320,8 @@ oncore_msg_svinfo(struct gps_device_t *session, unsigned char *buf,
}
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "SVINFO: mask={SATELLITE}\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SVINFO: mask={SATELLITE}\n");
return SATELLITE_SET;
}
@@ -338,8 +338,8 @@ oncore_msg_time_raim(struct gps_device_t *session UNUSED,
return 0;
sawtooth_ns = (int)getub(buf, 25);
- gpsd_report(&session->context->errout, LOG_DATA,
- "oncore PPS sawtooth: %d\n",sawtooth_ns);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "oncore PPS sawtooth: %d\n",sawtooth_ns);
/* session->driver.oncore.traim_sawtooth_ns = sawtooth_ns; */
@@ -373,8 +373,8 @@ gps_mask_t oncore_dispatch(struct gps_device_t * session, unsigned char *buf,
type = ONCTYPE(buf[2], buf[3]);
/* we may need to dump the raw packet */
- gpsd_report(&session->context->errout, LOG_RAW,
- "raw Oncore packet type 0x%04x\n", type);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "raw Oncore packet type 0x%04x\n", type);
session->cycle_end_reliable = true;
@@ -398,9 +398,9 @@ gps_mask_t oncore_dispatch(struct gps_device_t * session, unsigned char *buf,
default:
/* FIX-ME: This gets noisy in a hurry. Change once your driver works */
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown packet id @@%c%c length %zd\n",
- type >> 8, type & 0xff, len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown packet id @@%c%c length %zd\n",
+ type >> 8, type & 0xff, len);
return 0;
}
}
@@ -433,8 +433,8 @@ static ssize_t oncore_control_send(struct gps_device_t *session,
session->msgbuf[msglen + 4] = '\n';
session->msgbuflen = msglen + 5;
- gpsd_report(&session->context->errout, LOG_PROG,
- "writing oncore control type %c%c\n", msg[0], msg[1]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "writing oncore control type %c%c\n", msg[0], msg[1]);
return gpsd_write(session, session->msgbuf, session->msgbuflen);
}
diff --git a/driver_proto.c b/driver_proto.c
index bbbd7c0d..1b44990a 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -72,8 +72,8 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
if (data_len != _PROTO__NAVSOL_MSG_LEN)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ NAVSOL - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ NAVSOL - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SOLUTION_VALID) == 0)
@@ -121,14 +121,14 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
* the fields it potentially set and the transfer mask. Doing this
* makes it relatively easy to track down data-management problems.
*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVSOL: time=%.2f, lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVSOL: time=%.2f, lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude,
+ session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
@@ -144,8 +144,8 @@ _proto__msg_utctime(struct gps_device_t *session, unsigned char *buf, size_t dat
if (data_len != UTCTIME_MSG_LEN)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ UTCTIME - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ UTCTIME - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__TIME_VALID) == 0)
@@ -171,8 +171,8 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
if (data_len != SVINFO_MSG_LEN )
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ SVINFO - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ SVINFO - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SVINFO_VALID) == 0)
@@ -187,8 +187,8 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
*/
nchan = GET_NUMBER_OF_CHANNELS();
if ((nchan < 1) || (nchan > MAXCHANNELS)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "too many channels reported\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "too many channels reported\n");
return 0;
}
gpsd_zero_satellites(&session->gpsdata);
@@ -212,10 +212,10 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
session->gpsdata.skyview_time = NaN;
session->gpsdata.satellites_used = nsv;
session->gpsdata.satellites_visible = st;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | USED_IS;
}
@@ -231,8 +231,8 @@ _proto__msg_raw(struct gps_device_t *session, unsigned char *buf, size_t data_le
if (data_len != RAW_MSG_LEN )
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ RAW - raw measurements\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ RAW - raw measurements\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SVINFO_VALID) == 0)
@@ -247,8 +247,8 @@ _proto__msg_raw(struct gps_device_t *session, unsigned char *buf, size_t data_le
*/
nchan = GET_NUMBER_OF_CHANNELS();
if ((nchan < 1) || (nchan > MAXCHANNELS)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "too many channels reported\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "too many channels reported\n");
return 0;
}
@@ -292,16 +292,16 @@ gps_mask_t _proto__dispatch(struct gps_device_t *session, unsigned char *buf, si
type = GET_MESSAGE_TYPE();
/* we may need to dump the raw packet */
- gpsd_report(&session->context->errout, LOG_RAW,
- "raw _proto_ packet type 0x%02x\n", type);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "raw _proto_ packet type 0x%02x\n", type);
switch (type)
{
/* Deliver message to specific decoder based on message type */
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown packet id %d length %d\n", type, len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown packet id %d length %d\n", type, len);
return 0;
}
}
@@ -351,7 +351,7 @@ static ssize_t _proto__control_send(struct gps_device_t *session,
/* we may need to dump the message */
return gpsd_write(session, session->msgbuf, session->msgbuflen);
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"writing _proto_ control type %02x\n");
return gpsd_write(session, session->msgbuf, session->msgbuflen);
}
diff --git a/driver_rtcm3.c b/driver_rtcm3.c
index ffae5260..11bc504d 100644
--- a/driver_rtcm3.c
+++ b/driver_rtcm3.c
@@ -97,8 +97,8 @@ void rtcm3_unpack(const struct gps_context_t *context,
rtcm->length = (uint)ugrab(10);
rtcm->type = (uint)ugrab(12);
- gpsd_report(&context->errout, LOG_RAW, "RTCM3: type %d payload length %d\n",
- rtcm->type, rtcm->length);
+ gpsd_log(&context->errout, LOG_RAW, "RTCM3: type %d payload length %d\n",
+ rtcm->type, rtcm->length);
switch (rtcm->type) {
case 1001: /* GPS Basic RTK, L1 Only */
diff --git a/driver_sirf.c b/driver_sirf.c
index 20e7b513..b2cf575d 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -256,9 +256,9 @@ static bool sirf_write(struct gps_device_t *session, unsigned char *msg)
*/
/* can also be false because ACK was received after last send */
if (session->driver.sirf.need_ack > 0) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "SiRF: warning, write of control type %02x while awaiting ACK for %02x.\n",
- type, session->driver.sirf.need_ack);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "SiRF: warning, write of control type %02x while awaiting ACK for %02x.\n",
+ type, session->driver.sirf.need_ack);
}
len = (size_t) ((msg[2] << 8) | msg[3]);
@@ -273,8 +273,8 @@ static bool sirf_write(struct gps_device_t *session, unsigned char *msg)
msg[len + 4] = (unsigned char)((crc & 0xff00) >> 8);
msg[len + 5] = (unsigned char)(crc & 0x00ff);
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Writing control type %02x:\n", type);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Writing control type %02x:\n", type);
ok = (gpsd_write(session, (const char *)msg, len+8) == (ssize_t) (len+8));
session->driver.sirf.need_ack = type;
@@ -321,12 +321,12 @@ static bool sirfbin_speed(struct gps_device_t *session, speed_t speed, char pari
0x00, 0x00, 0xb0, 0xb3
};
/*@ -charint @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: sirf_speed(%u,%c,%d)\n",
- (unsigned int)speed, parity, stopbits);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: sirf_speed(%u,%c,%d)\n",
+ (unsigned int)speed, parity, stopbits);
if (9600 >= speed) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "SiRF may lag at 9600bps or less.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "SiRF may lag at 9600bps or less.\n");
}
switch (parity) {
@@ -376,9 +376,9 @@ static bool sirf_to_nmea(struct gps_device_t *session, speed_t speed)
/*@ -charint @*/
if (speed >= 0xffff) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "SiRF: can't switch from SiRF to NMEA because current speed %u is big.",
- (unsigned int)speed);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "SiRF: can't switch from SiRF to NMEA because current speed %u is big.",
+ (unsigned int)speed);
return false;
}
@@ -430,8 +430,8 @@ static gps_mask_t sirf_msg_debug(struct gps_device_t *device,
if (0xe1 == buf[0]) { /* Development statistics messages */
for (i = 2; i < (int)len; i++)
str_appendf(msgbuf, sizeof(msgbuf), "%c", buf[i] ^ 0xff);
- gpsd_report(&device->context->errout, LOG_PROG,
- "SiRF: DEV 0xe1: %s\n", msgbuf);
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "SiRF: DEV 0xe1: %s\n", msgbuf);
} else if (0xff == (unsigned char)buf[0]) { /* Debug messages */
for (i = 1; i < (int)len; i++)
if (isprint(buf[i]))
@@ -439,8 +439,8 @@ static gps_mask_t sirf_msg_debug(struct gps_device_t *device,
else
str_appendf(msgbuf, sizeof(msgbuf),
"\\x%02x", (unsigned int)buf[i]);
- gpsd_report(&device->context->errout, LOG_PROG,
- "SiRF: DBG 0xff: %s\n", msgbuf);
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "SiRF: DBG 0xff: %s\n", msgbuf);
}
/*@ -charint @*/
return 0;
@@ -452,20 +452,20 @@ static gps_mask_t sirf_msg_errors(struct gps_device_t *device,
{
switch (getbeu16(buf, 1)) {
case 2:
- gpsd_report(&device->context->errout, LOG_PROG,
- "SiRF: EID 0x0a type 2: Subframe %u error on PRN %u\n",
- getbeu32(buf, 9), getbeu32(buf, 5));
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "SiRF: EID 0x0a type 2: Subframe %u error on PRN %u\n",
+ getbeu32(buf, 9), getbeu32(buf, 5));
break;
case 4107:
- gpsd_report(&device->context->errout, LOG_PROG,
- "SiRF: EID 0x0a type 4107: neither KF nor LSQ fix.\n");
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "SiRF: EID 0x0a type 4107: neither KF nor LSQ fix.\n");
break;
default:
- gpsd_report(&device->context->errout, LOG_PROG,
- "SiRF: EID 0x0a: Error MID %d\n",
- getbeu16(buf, 1));
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "SiRF: EID 0x0a: Error MID %d\n",
+ getbeu16(buf, 1));
break;
}
return 0;
@@ -485,9 +485,9 @@ static gps_mask_t sirf_msg_nlmd(struct gps_device_t *session,
* different double orders, neither IEEE754 */
/* FIXME - decode the time, since this is the first MID with a
* good time stamp this will be good for ntpshm time */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: MID 0x1c, NLMD, gps_tow: %f\n",
- (double)gps_tow);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: MID 0x1c, NLMD, gps_tow: %f\n",
+ (double)gps_tow);
return 0;
}
@@ -518,17 +518,17 @@ static gps_mask_t sirf_msg_swversion(struct gps_device_t *session,
session->driver.sirf.driverstate |= SIRF_GE_232;
}
if (strstr((char *)(buf + 1), "ES"))
- gpsd_report(&session->context->errout, LOG_INF,
- "SiRF: Firmware has XTrac capability\n");
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: fv: %0.2f, Driver state flags are: %0x\n",
- fv, session->driver.sirf.driverstate);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "SiRF: Firmware has XTrac capability\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: fv: %0.2f, Driver state flags are: %0x\n",
+ fv, session->driver.sirf.driverstate);
#ifdef TIMEHINT_ENABLE
session->driver.sirf.time_seen = 0;
#endif /* TIMEHINT_ENABLE */
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: FV MID 0x06: subtype='%s' mask={DEVICEID}\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: FV MID 0x06: subtype='%s' mask={DEVICEID}\n",
+ session->subtype);
return DEVICEID_SET;
}
@@ -548,15 +548,15 @@ static gps_mask_t sirf_msg_navdata(struct gps_device_t *session,
words[i] = (uint32_t)getbeu32(buf, 4 * i + 3);
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: NavData chan %u svid %u\n",chan,svid);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: NavData chan %u svid %u\n",chan,svid);
#ifdef RECONFIGURE_ENABLE
/* SiRF recommends at least 57600 for SiRF IV nav data */
if (!session->context->readonly && session->gpsdata.dev.baudrate < 57600) {
/* some USB are also too slow, no way to tell which ones */
- gpsd_report(&session->context->errout, LOG_WARN,
- "WARNING: SiRF: link too slow, disabling subframes.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "WARNING: SiRF: link too slow, disabling subframes.\n");
(void)sirf_write(session, disablesubframe);
}
#endif /* RECONFIGURE_ENABLE */
@@ -599,12 +599,12 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session,
session->gpsdata.skyview[st].azimuth != 0 &&
session->gpsdata.skyview[st].elevation != 0;
#ifdef __UNUSED__
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: PRN=%2d El=%3.2f Az=%3.2f ss=%3d stat=%04x %c\n",
- prn,
- getub(buf, off + 2) / 2.0,
- (getub(buf, off + 1) * 3) / 2.0,
- cn / 10, stat, good ? '*' : ' ');
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: PRN=%2d El=%3.2f Az=%3.2f ss=%3d stat=%04x %c\n",
+ prn,
+ getub(buf, off + 2) / 2.0,
+ (getub(buf, off + 1) * 3) / 2.0,
+ cn / 10, stat, good ? '*' : ' ');
#endif /* UNUSED */
if (good != 0) {
st += 1;
@@ -624,20 +624,20 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session,
}
#ifdef TIMEHINT_ENABLE
if (st < 3) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD not enough satellites seen: %d\n", st);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD not enough satellites seen: %d\n", st);
} else {
/* SiRF says if 3 sats in view the time is good */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD valid time MID 0x04, seen=0x%02x, time:%.2lf, leap:%d\n",
- session->driver.sirf.time_seen,
- session->gpsdata.skyview_time,
- session->context->leap_seconds);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD valid time MID 0x04, seen=0x%02x, time:%.2lf, leap:%d\n",
+ session->driver.sirf.time_seen,
+ session->gpsdata.skyview_time,
+ session->context->leap_seconds);
}
#endif /* TIMEHINT_ENABLE */
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: MTD 0x04: visible=%d mask={SATELLITE}\n",
- session->gpsdata.satellites_visible);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: MTD 0x04: visible=%d mask={SATELLITE}\n",
+ session->gpsdata.satellites_visible);
return SATELLITE_SET;
}
@@ -735,23 +735,23 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session,
session->newdata.mode = MODE_2D;
if (session->newdata.mode == MODE_3D)
mask |= ALTITUDE_SET | CLIMB_SET;
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: MND 0x02: Navtype = 0x%0x, Status = %d, mode = %d\n",
- navtype, session->gpsdata.status, session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: MND 0x02: Navtype = 0x%0x, Status = %d, mode = %d\n",
+ navtype, session->gpsdata.status, session->newdata.mode);
/* byte 20 is HDOP, see below */
/* byte 21 is "mode 2", not clear how to interpret that */
session->newdata.time = gpsd_gpstime_resolve(session,
(unsigned short)getbes16(buf, 22), (double)getbeu32(buf, 24) * 1e-2);
#ifdef TIMEHINT_ENABLE
if (session->newdata.mode <= MODE_NO_FIX) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD no fix, mode: %d\n",
- session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD no fix, mode: %d\n",
+ session->newdata.mode);
} else {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD valid time MID 0x02, seen=0x%02x, time;%.2lf, leap:%d\n",
- session->driver.sirf.time_seen,
- session->newdata.time, session->context->leap_seconds);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD valid time MID 0x02, seen=0x%02x, time;%.2lf, leap:%d\n",
+ session->driver.sirf.time_seen,
+ session->newdata.time, session->context->leap_seconds);
}
#endif /* TIMEHINT_ENABLE */
/* fix quality data */
@@ -762,13 +762,13 @@ static gps_mask_t sirf_msg_navsol(struct gps_device_t *session,
if ( 3 <= session->gpsdata.satellites_visible ) {
mask |= PPSTIME_IS;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: MND 0x02: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f mode=%d status=%d hdop=%.2f used=%d\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.track, session->newdata.speed,
- session->newdata.mode, session->gpsdata.status,
- session->gpsdata.dop.hdop, session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: MND 0x02: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f mode=%d status=%d hdop=%.2f used=%d\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.track, session->newdata.speed,
+ session->newdata.mode, session->gpsdata.status,
+ session->gpsdata.dop.hdop, session->gpsdata.satellites_used);
return mask;
}
@@ -821,9 +821,9 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
session->newdata.mode = MODE_3D;
else if (session->gpsdata.status)
session->newdata.mode = MODE_2D;
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: GND 0x29: Navtype = 0x%0x, Status = %d, mode = %d\n",
- navtype, session->gpsdata.status, session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: GND 0x29: Navtype = 0x%0x, Status = %d, mode = %d\n",
+ navtype, session->gpsdata.status, session->newdata.mode);
mask |= STATUS_SET | MODE_SET;
session->newdata.latitude = getbes32(buf, 23) * 1e-7;
@@ -893,22 +893,22 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
/*@ -compdef -unrecog */
session->newdata.time = (timestamp_t)mkgmtime(&unpacked_date) + subseconds;
/*@ +compdef +unrecog */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: GND 0x29 UTC: %lf\n",
- session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: GND 0x29 UTC: %lf\n",
+ session->newdata.time);
#ifdef TIMEHINT_ENABLE
if (session->newdata.mode <= MODE_NO_FIX) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD no fix, mode: $d\n",
- session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD no fix, mode: $d\n",
+ session->newdata.mode);
} else if (0 == unpacked_date.tm_year) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD no year\n",
- session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD no year\n",
+ session->newdata.mode);
} else {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD valid time MID 0x29, seen=0x%02x\n",
- session->driver.sirf.time_seen);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD valid time MID 0x29, seen=0x%02x\n",
+ session->driver.sirf.time_seen);
}
if ( 3 <= session->gpsdata.satellites_visible ) {
mask |= PPSTIME_IS;
@@ -926,8 +926,8 @@ static gps_mask_t sirf_msg_geodetic(struct gps_device_t *session,
if (session->newdata.mode == MODE_3D)
mask |= ALTITUDE_SET | CLIMB_SET;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: GND 0x29: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f mode=%d status=%d\n",
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: GND 0x29: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f mode=%d status=%d\n",
session->newdata.time,
session->newdata.latitude,
session->newdata.longitude,
@@ -1001,9 +1001,9 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
session->newdata.mode = MODE_3D;
else if (session->gpsdata.status)
session->newdata.mode = MODE_2D;
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: EMND 0x62: Navtype = 0x%0x, Status = %d, mode = %d\n",
- navtype, session->gpsdata.status, session->newdata.mode);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: EMND 0x62: Navtype = 0x%0x, Status = %d, mode = %d\n",
+ navtype, session->gpsdata.status, session->newdata.mode);
if (navtype & 0x40) { /* UTC corrected timestamp? */
struct tm unpacked_date;
@@ -1028,12 +1028,12 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
/*@ +compdef */
#ifdef TIMEHINT_ENABLE
if (0 == (session->driver.sirf.time_seen & TIME_SEEN_UTC_2)) {
- gpsd_report(&session->context->errout, LOG_RAW,
- "SiRF: NTPD just SEEN_UTC_2\n");
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "SiRF: NTPD just SEEN_UTC_2\n");
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD valid time MID 0x62, seen=0x%02x\n",
- session->driver.sirf.time_seen);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD valid time MID 0x62, seen=0x%02x\n",
+ session->driver.sirf.time_seen);
session->driver.sirf.time_seen |= TIME_SEEN_UTC_2;
#endif /* TIMEHINT_ENABLE */
session->context->valid |= LEAP_SECOND_VALID;
@@ -1045,15 +1045,15 @@ static gps_mask_t sirf_msg_ublox(struct gps_device_t *session,
session->gpsdata.dop.vdop = (int)getub(buf, 37) / 5.0;
session->gpsdata.dop.tdop = (int)getub(buf, 38) / 5.0;
session->driver.sirf.driverstate |= UBLOX;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SiRF: EMD 0x62: time=%.2f lat=%.2f lon=%.2f alt=%.f speed=%.2f track=%.2f climb=%.2f mode=%d status=%d gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f\n",
- session->newdata.time, session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude,
- session->newdata.speed, session->newdata.track,
- session->newdata.climb, session->newdata.mode,
- session->gpsdata.status, session->gpsdata.dop.gdop,
- session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SiRF: EMD 0x62: time=%.2f lat=%.2f lon=%.2f alt=%.f speed=%.2f track=%.2f climb=%.2f mode=%d status=%d gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f\n",
+ session->newdata.time, session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude,
+ session->newdata.speed, session->newdata.track,
+ session->newdata.climb, session->newdata.mode,
+ session->gpsdata.status, session->gpsdata.dop.gdop,
+ session->gpsdata.dop.pdop, session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop, session->gpsdata.dop.tdop);
return mask;
}
@@ -1065,9 +1065,9 @@ static gps_mask_t sirf_msg_ppstime(struct gps_device_t *session,
if (len != 19)
return 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: PPS 0x34: Status = 0x%02x\n",
- getub(buf, 14));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: PPS 0x34: Status = 0x%02x\n",
+ getub(buf, 14));
if (((int)getub(buf, 14) & 0x07) == 0x07) { /* valid UTC time? */
struct tm unpacked_date;
unpacked_date.tm_hour = (int)getub(buf, 1);
@@ -1084,13 +1084,13 @@ static gps_mask_t sirf_msg_ppstime(struct gps_device_t *session,
session->context->valid |= LEAP_SECOND_VALID;
#ifdef TIMEHINT_ENABLE
if (0 == (session->driver.sirf.time_seen & TIME_SEEN_UTC_2)) {
- gpsd_report(&session->context->errout, LOG_RAW,
- "SiRF: NTPD just SEEN_UTC_2\n");
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "SiRF: NTPD just SEEN_UTC_2\n");
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NTPD valid time MID 0x34, seen=0x%02x, leap=%d\n",
- session->driver.sirf.time_seen,
- session->context->leap_seconds);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NTPD valid time MID 0x34, seen=0x%02x, leap=%d\n",
+ session->driver.sirf.time_seen,
+ session->context->leap_seconds);
session->driver.sirf.time_seen |= TIME_SEEN_UTC_2;
#endif /* TIMEHINT_ENABLE */
mask |= TIME_SET;
@@ -1110,49 +1110,49 @@ static gps_mask_t sirf_msg_nl(struct gps_device_t *session,
switch ( buf[1] ) {
case 1:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 1, GPS Data\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 1, GPS Data\n");
break;
case 2:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 2, EE Integrity\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 2, EE Integrity\n");
break;
case 3:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 3, EE Integrity\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 3, EE Integrity\n");
break;
case 4:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, EE Clock Bias\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, EE Clock Bias\n");
break;
case 5:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, 50bps\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, 50bps\n");
break;
case 32:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, ECLM ACK/NACK\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, ECLM ACK/NACK\n");
break;
case 33:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, ECLM EE Age\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, ECLM EE Age\n");
break;
case 34:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, ECLM SGEE Age\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, ECLM SGEE Age\n");
break;
case 35:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, SubID: 4, ECLM Download Intiate\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, SubID: 4, ECLM Download Intiate\n");
break;
case 255:
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"SiRF IV: unused EE 0x38, SubID: 4, EE ACK\n");
break;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused EE 0x38, unknown SubID: %d\n",
- buf[1]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused EE 0x38, unknown SubID: %d\n",
+ buf[1]);
}
return 0;
@@ -1167,18 +1167,18 @@ static gps_mask_t sirf_msg_ee(struct gps_device_t *session,
switch ( buf[1] ) {
case 1:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused NL 0x40, SubID: 1\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused NL 0x40, SubID: 1\n");
break;
case 2:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused NL 0x40, SubID: 2, PRN: %d\n",
- buf[2]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused NL 0x40, SubID: 2, PRN: %d\n",
+ buf[2]);
break;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused NL 0x40, unknown SubID: %d\n",
- buf[1]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused NL 0x40, unknown SubID: %d\n",
+ buf[1]);
}
return 0;
@@ -1194,8 +1194,8 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
buf += 4;
len -= 8;
- gpsd_report(&session->context->errout, LOG_RAW,
- "SiRF: Raw packet type 0x%02x\n", buf[0]);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "SiRF: Raw packet type 0x%02x\n", buf[0]);
session->driver.sirf.lastid = buf[0];
/* could change if the set of messages we enable does */
@@ -1207,23 +1207,23 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
return sirf_msg_navsol(session, buf,
len) | (CLEAR_IS | REPORT_IS);
else {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: MND 0x02 skipped, u-blox flag is on.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: MND 0x02 skipped, u-blox flag is on.\n");
return 0;
}
case 0x04: /* Measured tracker data out MID 4 */
return sirf_msg_svinfo(session, buf, len);
case 0x05: /* Raw Tracker Data Out MID 5 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: unused Raw Tracker Data 0x05\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: unused Raw Tracker Data 0x05\n");
return 0;
case 0x06: /* Software Version String MID 6 */
return sirf_msg_swversion(session, buf, len);
case 0x07: /* Clock Status Data MID 7 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused CLK 0x07\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused CLK 0x07\n");
return 0;
case 0x08: /* subframe data MID 8 */
@@ -1241,49 +1241,48 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
return sirf_msg_navdata(session, buf, len);
case 0x09: /* CPU Throughput MID 9 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: THR 0x09: SegStatMax=%.3f, SegStatLat=%3.f, AveTrkTime=%.3f, Last MS=%u\n",
- (float)getbeu16(buf, 1) / 186, (float)getbeu16(buf,
- 3) / 186,
- (float)getbeu16(buf, 5) / 186, getbeu16(buf, 7));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: THR 0x09: SegStatMax=%.3f, SegStatLat=%3.f, AveTrkTime=%.3f, Last MS=%u\n",
+ (float)getbeu16(buf, 1) / 186, (float)getbeu16(buf, 3) / 186,
+ (float)getbeu16(buf, 5) / 186, getbeu16(buf, 7));
return 0;
case 0x0a: /* Error ID Data MID 10 */
return sirf_msg_errors(session, buf, len);
case 0x0b: /* Command Acknowledgement MID 11 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: ACK 0x0b: %02x\n", getub(buf, 1));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: ACK 0x0b: %02x\n", getub(buf, 1));
session->driver.sirf.need_ack = 0;
return 0;
case 0x0c: /* Command NAcknowledgement MID 12 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: NAK 0x0c: %02x\n", getub(buf, 1));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: NAK 0x0c: %02x\n", getub(buf, 1));
/* ugh -- there's no alternative but silent failure here */
session->driver.sirf.need_ack = 0;
return 0;
case 0x0d: /* Visible List MID 13 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused VIS 0x0d\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused VIS 0x0d\n");
return 0;
case 0x0e: /* Almanac Data MID 14 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused ALM 0x0e\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused ALM 0x0e\n");
return 0;
case 0x0f: /* Ephemeris Data MID 15 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused EPH 0x0f\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused EPH 0x0f\n");
return 0;
case 0x11: /* Differential Corrections MID 17 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused DIFF 0x11\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused DIFF 0x11\n");
return 0;
case 0x12: /* OK To Send MID 18 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: OTS 0x12: send indicator = %d\n",
- getub(buf, 1));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: OTS 0x12: send indicator = %d\n",
+ getub(buf, 1));
return 0;
case 0x13: /* Navigation Parameters MID 19 */
@@ -1296,23 +1295,23 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
return sirf_msg_nlmd(session, buf, len);
case 0x1d: /* Navigation Library DGPS Data MID 29 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused NLDG 0x1d\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused NLDG 0x1d\n");
return 0;
case 0x1e: /* Navigation Library SV State Data MID 30 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused NLSV 0x1e\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused NLSV 0x1e\n");
return 0;
case 0x1f: /* Navigation Library Initialization Data MID 31 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused NLID 0x1f\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused NLID 0x1f\n");
return 0;
case 0x29: /* Geodetic Navigation Data MID 41 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused GND 0x29\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused GND 0x29\n");
return 0;
case 0x32: /* SBAS corrections MID 50 */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unused SBAS 0x32\n");
+ gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused SBAS 0x32\n");
return 0;
case 0x34: /* PPS Time MID 52 */
@@ -1346,29 +1345,29 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
return sirf_msg_nl(session, buf, len);
case 0x47: /* Hardware Config MID 71 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused Hardware Config 0x47\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused Hardware Config 0x47\n");
return 0;
case 0x5c: /* CW Controller Output MID 92 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused CW Controller Output 0x5c\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused CW Controller Output 0x5c\n");
return 0;
case 0x5d: /* TCXO Output MID 93 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF IV: unused TCXO Output 0x5d, SubID: %d\n",
- buf[1]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF IV: unused TCXO Output 0x5d, SubID: %d\n",
+ buf[1]);
return 0;
case 0x62: /* u-blox Extended Measured Navigation Data MID 98 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: u-blox EMND 0x62\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: u-blox EMND 0x62\n");
return sirf_msg_ublox(session, buf, len) | (CLEAR_IS | REPORT_IS);
case 0x80: /* Initialize Data Source MID 128 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: unused INIT 0x80\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: unused INIT 0x80\n");
return 0;
case 0xe1: /* Development statistics messages MID 225 */
@@ -1378,9 +1377,9 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf,
return 0;
default:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Unknown packet id %d length %zd\n",
- buf[0], len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Unknown packet id %d length %zd\n",
+ buf[0], len);
return 0;
}
}
@@ -1400,8 +1399,8 @@ static gps_mask_t sirfbin_parse_input(struct gps_device_t *session)
static void sirfbin_init_query(struct gps_device_t *session)
{
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Probing for firmware version.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Probing for firmware version.\n");
(void)sirf_write(session, versionprobe);
}
@@ -1412,8 +1411,8 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
if (event == event_identified || event == event_reactivate) {
if (session->lexer.type == NMEA_PACKET) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Switching chip mode to binary.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Switching chip mode to binary.\n");
(void)nmea_send(session,
"$PSRF100,0,%d,8,1,0",
session->gpsdata.dev.baudrate);
@@ -1435,7 +1434,8 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
case 1:
#ifdef RECONFIGURE_ENABLE
/* unset MID 0x40 = 64 first since there is a flood of them */
- gpsd_report(&session->context->errout, LOG_PROG,"SiRF: unset MID 64.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: unset MID 64.\n");
putbyte(unsetmidXX, 6, 0x40);
(void)sirf_write(session, unsetmidXX);
break;
@@ -1445,54 +1445,54 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
* The response to this request will save the navigation
* parameters so they can be reverted before close.
*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Requesting navigation parameters.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Requesting navigation parameters.\n");
(void)sirf_write(session, navparams);
break;
case 3:
/* unset GND (0x29 = 41), it's not reliable on SiRF II */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: unset MID 64.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: unset MID 64.\n");
putbyte(unsetmidXX, 6, 0x29);
(void)sirf_write(session, unsetmidXX);
break;
case 4:
if (!session->context->readonly) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Setting Navigation Parameters.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Setting Navigation Parameters.\n");
(void)sirf_write(session, modecontrol);
}
break;
case 5:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Requesting periodic ecef reports.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Requesting periodic ecef reports.\n");
(void)sirf_write(session, requestecef);
break;
case 6:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Requesting periodic tracker reports.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Requesting periodic tracker reports.\n");
(void)sirf_write(session, requesttracker);
break;
case 7:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Setting DGPS control to use SBAS.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Setting DGPS control to use SBAS.\n");
(void)sirf_write(session, dgpscontrol);
break;
case 8:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Setting SBAS to auto/integrity mode.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Setting SBAS to auto/integrity mode.\n");
(void)sirf_write(session, sbasparams);
break;
case 9:
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Enabling PPS message.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Enabling PPS message.\n");
(void)sirf_write(session, enablemid52);
break;
@@ -1500,13 +1500,13 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
/* SiRF recommends at least 57600 for SiRF IV nav data */
if (session->gpsdata.dev.baudrate >= 57600) {
/* fast enough, turn on nav data */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Enabling subframe transmission.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Enabling subframe transmission.\n");
(void)sirf_write(session, enablesubframe);
} else {
/* too slow, turn off nav data */
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Disabling subframe transmission.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Disabling subframe transmission.\n");
(void)sirf_write(session, disablesubframe);
}
break;
@@ -1516,8 +1516,8 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
* Disable navigation debug messages (the value 5 is magic)
* must be done *after* subframe enable.
*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: disable MID 7, 28, 29, 30, 31.\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: disable MID 7, 28, 29, 30, 31.\n");
putbyte(unsetmidXX, 5, 0x05);
(void)sirf_write(session, unsetmidXX);
break;
@@ -1555,8 +1555,8 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
putbyte(moderevert, 16, session->driver.sirf.dr_timeout);
putbyte(moderevert, 17, session->driver.sirf.track_smooth_mode);
/*@ +shiftimplementation @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "SiRF: Reverting navigation parameters...\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "SiRF: Reverting navigation parameters...\n");
(void)sirf_write(session, moderevert);
}
}
diff --git a/driver_superstar2.c b/driver_superstar2.c
index 94cc3320..e46d2df5 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -57,10 +57,9 @@ superstar2_msg_ack(struct gps_device_t *session,
unsigned char *buf, size_t data_len)
{
if (data_len == 11)
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #126 - "
- "ACK %d %d %d %d %d\n",
- buf[5], buf[6], buf[7], buf[8], buf[9]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #126 - ACK %d %d %d %d %d\n",
+ buf[5], buf[6], buf[7], buf[8], buf[9]);
return 0;
}
@@ -83,8 +82,8 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
if (data_len != 77)
return 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #20 - user navigation data\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #20 - user navigation data\n");
mask = 0;
/*@ +charint @*/
@@ -146,20 +145,22 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
}
mask |= MODE_SET | STATUS_SET;
- gpsd_report(&session->context->errout, 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\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,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, 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\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,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop,
+ session->gpsdata.satellites_used);
return mask;
}
@@ -175,8 +176,8 @@ superstar2_msg_svinfo(struct gps_device_t *session,
if (data_len != 67)
return 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #33 - satellite data\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #33 - satellite data\n");
nchan = 12;
gpsd_zero_satellites(&session->gpsdata);
@@ -206,10 +207,10 @@ superstar2_msg_svinfo(struct gps_device_t *session,
session->gpsdata.skyview_time = NAN;
session->gpsdata.satellites_used = nsv;
session->gpsdata.satellites_visible = st;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | USED_IS;
}
@@ -231,14 +232,13 @@ superstar2_msg_version(struct gps_device_t *session,
(void)snprintf(boot_sw, 15, "%s", (char *)buf + 36);
(void)snprintf(ser_num, 14, "%s", (char *)buf + 73);
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #45 - "
- "hw part %s boot sw %s main sw %s ser num %s\n",
- hw_part, boot_sw, main_sw, ser_num);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #45 - hw part %s boot sw %s main sw %s ser num %s\n",
+ hw_part, boot_sw, main_sw, ser_num);
(void)strlcpy(session->subtype, main_sw, sizeof(session->subtype));
- gpsd_report(&session->context->errout, LOG_DATA,
- "VERSION: subtype='%s' mask={DEVEICEID}\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "VERSION: subtype='%s' mask={DEVEICEID}\n",
+ session->subtype);
return DEVICEID_SET;
}
@@ -255,8 +255,8 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf,
if (data_len != 65)
return 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #113 - timing status\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #113 - timing status\n");
/*@ +charint @*/
if ((getub(buf, 55) & 0x30) != 0)
mask = 0;
@@ -278,9 +278,9 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf,
session->context->leap_seconds = (int)getsb(buf, 20);
mask = TIME_SET | PPSTIME_IS;
}
- gpsd_report(&session->context->errout, LOG_DATA,
- "TIMING: time=%.2f mask={TIME}\n",
- session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "TIMING: time=%.2f mask={TIME}\n",
+ session->newdata.time);
return mask;
}
@@ -295,13 +295,13 @@ superstar2_msg_measurement(struct gps_device_t *session, unsigned char *buf,
int i, n;
double t;
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #23 - measurement block\n");
-
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #23 - measurement block\n");
+
n = (int)getub(buf, 6); /* number of measurements */
if ((n < 1) || (n > MAXCHANNELS)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "too many measurements\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "too many measurements\n");
return 0;
}
t = getled64((char *)buf, 7); /* measurement time */
@@ -341,9 +341,9 @@ superstar2_msg_iono_utc(struct gps_device_t *session, unsigned char *buf,
i = (unsigned int)getub(buf, 12);
u = (unsigned int)getub(buf, 21);
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #75 - ionospheric & utc data: iono %s utc %s\n",
- i ? "ok" : "bad", u ? "ok" : "bad");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #75 - ionospheric & utc data: iono %s utc %s\n",
+ i ? "ok" : "bad", u ? "ok" : "bad");
session->driver.superstar2.last_iono = time(NULL);
return 0;
@@ -359,8 +359,8 @@ superstar2_msg_ephemeris(struct gps_device_t *session, unsigned char *buf,
{
unsigned int prn;
prn = (unsigned int)(getub(buf, 4) & 0x1f);
- gpsd_report(&session->context->errout, LOG_PROG,
- "superstar2 #22 - ephemeris data - prn %u\n", prn);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "superstar2 #22 - ephemeris data - prn %u\n", prn);
/* ephemeris data updates fairly slowly, but when it does, poll UTC */
if ((time(NULL) - session->driver.superstar2.last_iono) > 60)
@@ -382,9 +382,9 @@ superstar2_write(struct gps_device_t *session, char *msg, size_t msglen)
c += 0x100;
msg[(int)msg[3] + 4] = (char)((c >> 8) & 0xff);
msg[(int)msg[3] + 5] = (char)(c & 0xff);
- gpsd_report(&session->context->errout, LOG_PROG,
- "writing superstar2 control type %d len %zu\n",
- (int)msg[1] & 0x7f, msglen);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "writing superstar2 control type %d len %zu\n",
+ (int)msg[1] & 0x7f, msglen);
return gpsd_write(session, msg, msglen);
}
@@ -423,9 +423,9 @@ superstar2_dispatch(struct gps_device_t * session, unsigned char *buf,
return superstar2_msg_ephemeris(session, buf, len);
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown superstar2 packet id 0x%02x length %zd\n",
- type, len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown superstar2 packet id 0x%02x length %zd\n",
+ type, len);
return 0;
}
}
diff --git a/driver_tsip.c b/driver_tsip.c
index 6134e3d9..6e503841 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -58,8 +58,8 @@ static int tsip_write(struct gps_device_t *session,
*ep++ = '\x03';
session->msgbuflen = (size_t) (ep - session->msgbuf);
/*@ -charint @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "Sent TSIP packet id 0x%02x\n", id);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Sent TSIP packet id 0x%02x\n", id);
if (gpsd_write(session, session->msgbuf, session->msgbuflen) !=
(ssize_t) session->msgbuflen)
return -1;
@@ -107,8 +107,8 @@ static bool tsip_detect(struct gps_device_t *session)
break;
if (generic_get(session) >= 0) {
if (session->lexer.type == TSIP_PACKET) {
- gpsd_report(&session->context->errout, LOG_RAW,
- "tsip_detect found\n");
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "tsip_detect found\n");
ret = true;
break;
}
@@ -139,8 +139,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
char buf2[BUFSIZ];
if (session->lexer.type != TSIP_PACKET) {
- gpsd_report(&session->context->errout, LOG_INF, "tsip_analyze packet type %d\n",
- session->lexer.type);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "tsip_analyze packet type %d\n",
+ session->lexer.type);
return 0;
}
@@ -163,9 +164,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
/*@ -charint @*/
id = (unsigned)session->lexer.outbuffer[1];
- gpsd_report(&session->context->errout, LOG_DATA,
- "TSIP packet id 0x%02x length %d: %s\n",
- id, len, buf2);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "TSIP packet id 0x%02x length %d: %s\n",
+ id, len, buf2);
(void)time(&now);
session->cycle_end_reliable = true;
@@ -173,12 +174,12 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
case 0x13: /* Packet Received */
u1 = getub(buf, 0);
u2 = getub(buf, 1);
- gpsd_report(&session->context->errout, LOG_WARN,
- "Received packet of type %02x cannot be parsed\n", u1);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Received packet of type %02x cannot be parsed\n", u1);
#if USE_SUPERPACKET
if ((int)u1 == 0x8e && (int)u2 == 0x23) { /* no Compact Super Packet */
- gpsd_report(&session->context->errout, LOG_WARN,
- "No Compact Super Packet, use LFwEI\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "No Compact Super Packet, use LFwEI\n");
/* Request LFwEI Super Packet */
putbyte(buf, 0, 0x20);
@@ -212,9 +213,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
"sw %u %u %u %02u.%02u.%04u %s",
u2, u3, u4, u6, u5, s1, buf2);
/*@ +formattype @*/
- gpsd_report(&session->context->errout, LOG_INF,
- "Software version: %s\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Software version: %s\n",
+ session->subtype);
mask |= DEVICEID_SET;
}
@@ -235,16 +236,16 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
(void)snprintf(session->subtype, sizeof(session->subtype),
"hw %u %02u.%02u.%04u %02u %u %s",
ul1, u2, u3, s1, u4, s2, buf2);
- gpsd_report(&session->context->errout, LOG_INF,
- "Hardware version: %s\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Hardware version: %s\n",
+ session->subtype);
mask |= DEVICEID_SET;
/* Detecting device by Hardware Code */
if (s2 == 3001) {
- gpsd_report(&session->context->errout, LOG_INF,
- "This device is Accutime Gold\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "This device is Accutime Gold\n");
session->driver.tsip.subtype = TSIP_ACCUTIME_GOLD;
configuration_packets_accutime_gold(session);
}
@@ -268,8 +269,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
gpsd_gpstime_resolve(session, (unsigned short)s1, (double)f1);
mask |= TIME_SET | PPSTIME_IS;
}
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS Time %f %d %f\n", f1, s1, f2);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS Time %f %d %f\n", f1, s1, f2);
break;
case 0x42: /* Single-Precision Position Fix, XYZ ECEF */
if (len != 16)
@@ -278,8 +279,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
f2 = getbef32((char *)buf, 4); /* Y */
f3 = getbef32((char *)buf, 8); /* Z */
f4 = getbef32((char *)buf, 12); /* time-of-fix */
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS Position XYZ %f %f %f %f\n", f1, f2, f3, f4);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS Position XYZ %f %f %f %f\n", f1, f2, f3, f4);
break;
case 0x43: /* Velocity Fix, XYZ ECEF */
if (len != 20)
@@ -289,9 +290,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
f3 = getbef32((char *)buf, 8); /* Z velocity */
f4 = getbef32((char *)buf, 12); /* bias rate */
f5 = getbef32((char *)buf, 16); /* time-of-fix */
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS Velocity XYZ %f %f %f %f %f\n", f1, f2, f3,
- f4, f5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS Velocity XYZ %f %f %f %f %f\n", f1, f2, f3,
+ f4, f5);
break;
case 0x45: /* Software Version Information */
if (len != 10)
@@ -310,8 +311,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
getub(buf, 7),
getub(buf, 8));
/*@ +formattype @*/
- gpsd_report(&session->context->errout, LOG_INF,
- "Software version: %s\n", session->subtype);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Software version: %s\n", session->subtype);
mask |= DEVICEID_SET;
break;
case 0x46: /* Health of Receiver */
@@ -329,8 +330,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
mask |= STATUS_SET;
}
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "Receiver health %02x %02x\n", u1, u2);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Receiver health %02x %02x\n", u1, u2);
break;
case 0x47: /* Signal Levels for all Satellites */
gpsd_zero_satellites(&session->gpsdata);
@@ -349,14 +350,14 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
}
str_appendf(buf2, sizeof(buf2), " %d=%.1f", (int)u1, f1);
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "Signal Levels (%d):%s\n", count, buf2);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Signal Levels (%d):%s\n", count, buf2);
mask |= SATELLITE_SET;
break;
case 0x48: /* GPS System Message */
buf[len] = '\0';
- gpsd_report(&session->context->errout, LOG_PROG,
- "GPS System Message: %s\n", buf);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "GPS System Message: %s\n", buf);
break;
case 0x49: /* Almanac Health Page */
break;
@@ -376,12 +377,12 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
mask |= TIME_SET | PPSTIME_IS;
}
mask |= LATLON_SET | ALTITUDE_SET | CLEAR_IS | REPORT_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SPPLLA 0x4a time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SPPLLA 0x4a time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude);
break;
case 0x4b: /* Machine/Code ID and Additional Status */
if (len != 3)
@@ -389,12 +390,12 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
u1 = getub(buf, 0); /* Machine ID */
u2 = getub(buf, 1); /* Status 1 */
u3 = getub(buf, 2); /* Status 2 */
- gpsd_report(&session->context->errout, LOG_INF,
- "Machine ID %02x %02x %02x\n", u1, u2, u3);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Machine ID %02x %02x %02x\n", u1, u2, u3);
#if USE_SUPERPACKET
if ((u3 & 0x01) != (uint8_t) 0 && !session->driver.tsip.superpkt) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Switching to Super Packet mode\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Switching to Super Packet mode\n");
/* set new I/O Options for Super Packet output */
putbyte(buf, 0, 0x2c); /* Position: SP, MSL */
@@ -417,8 +418,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
u2 = getub(buf, 1); /* Velocity */
u3 = getub(buf, 2); /* Timing */
u4 = getub(buf, 3); /* Aux */
- gpsd_report(&session->context->errout, LOG_INF,
- "IO Options %02x %02x %02x %02x\n", u1, u2, u3, u4);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "IO Options %02x %02x %02x %02x\n", u1, u2, u3, u4);
#if USE_SUPERPACKET
if ((u1 & 0x20) != (uint8_t) 0) { /* Output Super Packets? */
/* No LFwEI Super Packet */
@@ -448,16 +449,16 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
/*@ +evalorder @*/
if ((session->newdata.track = atan2(f1, f2) * RAD_2_DEG) < 0)
session->newdata.track += 360.0;
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS Velocity ENU %f %f %f %f %f\n", f1, f2, f3,
- f4, f5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS Velocity ENU %f %f %f %f %f\n", f1, f2, f3,
+ f4, f5);
mask |= SPEED_SET | TRACK_SET | CLIMB_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "VFENU 0x56 time=%.2f speed=%.2f track=%.2f climb=%.2f\n",
- session->newdata.time,
- session->newdata.speed,
- session->newdata.track,
- session->newdata.climb);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "VFENU 0x56 time=%.2f speed=%.2f track=%.2f climb=%.2f\n",
+ session->newdata.time,
+ session->newdata.speed,
+ session->newdata.track,
+ session->newdata.climb);
break;
case 0x57: /* Information About Last Computed Fix */
if (len != 8)
@@ -470,8 +471,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
if (getub(buf, 0) == 0x01) /* good current fix? */
(void)gpsd_gpstime_resolve(session, (unsigned short)s1, (double)f1);
/*@ -charint @*/
- gpsd_report(&session->context->errout, LOG_INF,
- "Fix info %02x %02x %d %f\n", u1, u2, s1, f1);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Fix info %02x %02x %d %f\n", u1, u2, s1, f1);
break;
case 0x58: /* Satellite System Data/Acknowledge from Receiver */
break;
@@ -484,9 +485,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
f2 = getbef32((char *)buf, 9); /* Code phase */
f3 = getbef32((char *)buf, 13); /* Doppler */
d1 = getbed64((char *)buf, 17); /* Time of Measurement */
- gpsd_report(&session->context->errout, LOG_PROG,
- "Raw Measurement Data %d %f %f %f %f\n",
- getub(buf, 0), f1, f2, f3, d1);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Raw Measurement Data %d %f %f %f %f\n",
+ getub(buf, 0), f1, f2, f3, d1);
break;
case 0x5b: /* Satellite Ephemeris Status */
break;
@@ -502,9 +503,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
d1 = getbef32((char *)buf, 12) * RAD_2_DEG; /* Elevation */
d2 = getbef32((char *)buf, 16) * RAD_2_DEG; /* Azimuth */
i = (int)(u2 >> 3); /* channel number */
- gpsd_report(&session->context->errout, LOG_INF,
- "Satellite Tracking Status: Ch %2d PRN %3d Res %d Acq %d Eph %2d SNR %4.1f LMT %.04f El %4.1f Az %5.1f\n",
- i, u1, u2 & 7, u3, u4, f1, f2, d1, d2);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Satellite Tracking Status: Ch %2d PRN %3d Res %d Acq %d Eph %2d SNR %4.1f LMT %.04f El %4.1f Az %5.1f\n",
+ i, u1, u2 & 7, u3, u4, f1, f2, d1, d2);
if (i < TSIP_CHANNELS) {
if (d1 >= 0.0) {
session->gpsdata.skyview[i].PRN = (short)u1;
@@ -582,16 +583,16 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
" %d", session->driver.tsip.sats_used[i] =
(short)getub(buf, 17 + i));
/*@ -charint @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "AIVSS: 0x6d status=%d used=%d "
- "pdop=%.1f hdop=%.1f vdop=%.1f tdop=%.1f gdup=%.1f\n",
- session->gpsdata.status,
- session->gpsdata.satellites_used,
- session->gpsdata.dop.pdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop,
- session->gpsdata.dop.tdop,
- session->gpsdata.dop.gdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "AIVSS: 0x6d status=%d used=%d "
+ "pdop=%.1f hdop=%.1f vdop=%.1f tdop=%.1f gdup=%.1f\n",
+ session->gpsdata.status,
+ session->gpsdata.satellites_used,
+ session->gpsdata.dop.pdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop,
+ session->gpsdata.dop.tdop,
+ session->gpsdata.dop.gdop);
mask |= DOP_SET | STATUS_SET | USED_IS;
break;
case 0x6e: /* Synchronized Measurements */
@@ -620,8 +621,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
mask |= STATUS_SET;
}
/*@ -charint @*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "DPFM 0x82 status=%d\n", session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "DPFM 0x82 status=%d\n", session->gpsdata.status);
break;
case 0x83: /* Double-Precision XYZ Position Fix and Bias Information */
if (len != 36)
@@ -631,8 +632,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
d3 = getbed64((char *)buf, 16); /* Z */
d4 = getbed64((char *)buf, 24); /* clock bias */
f1 = getbef32((char *)buf, 32); /* time-of-fix */
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS Position XYZ %f %f %f %f %f\n", d1, d2, d3, d4, f1);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS Position XYZ %f %f %f %f %f\n", d1, d2, d3, d4, f1);
break;
case 0x84: /* Double-Precision LLA Position Fix and Bias Information */
if (len != 36)
@@ -649,18 +650,18 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
(double)f1);
mask |= TIME_SET | PPSTIME_IS;
}
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS DP LLA %f %f %f %f\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude, session->newdata.altitude);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS DP LLA %f %f %f %f\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude, session->newdata.altitude);
mask |= LATLON_SET | ALTITUDE_SET | CLEAR_IS | REPORT_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "DPPLLA 0x84 time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "DPPLLA 0x84 time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude);
break;
case 0x8f: /* Super Packet. Well... */
/*@ +charint @*/
@@ -676,9 +677,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
d3 = getbed64((char *)buf, 19); /* DZ */
d4 = getbed64((char *)buf, 27); /* A-axis */
d5 = getbed64((char *)buf, 35); /* Eccentricity Squared */
- gpsd_report(&session->context->errout, LOG_INF,
- "Current Datum %d %f %f %f %f %f\n", s1, d1,
- d2, d3, d4, d5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Current Datum %d %f %f %f %f %f\n", s1, d1,
+ d2, d3, d4, d5);
break;
case 0x20: /* Last Fix with Extra Information (binary fixed point) */
@@ -698,9 +699,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
u4 = getub(buf, 29); /* utc offset */
s4 = getbes16(buf, 30); /* tsip.gps_week */
/* PRN/IODE data follows */
- gpsd_report(&session->context->errout, LOG_RAW,
- "LFwEI %d %d %d %u %d %u %u %x %x %u %u %d\n", s1, s2,
- s3, ul1, sl1, ul2, sl2, u1, u2, u3, u4, s4);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "LFwEI %d %d %d %u %d %u %u %x %x %u %u %d\n", s1, s2,
+ s3, ul1, sl1, ul2, sl2, u1, u2, u3, u4, s4);
if ((u1 & 0x01) != (uint8_t) 0) /* check velocity scaling */
d5 = 0.02;
@@ -746,15 +747,15 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET |
TRACK_SET | CLIMB_SET | STATUS_SET | MODE_SET | CLEAR_IS |
REPORT_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SP-LFEI 0x20: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
- "speed=%.2f track=%.2f climb=%.2f "
- "mode=%d status=%d\n",
- session->newdata.time,
- session->newdata.latitude, session->newdata.longitude,
- session->newdata.altitude, session->newdata.speed,
- session->newdata.track, session->newdata.climb,
- session->newdata.mode, session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SP-LFEI 0x20: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
+ "speed=%.2f track=%.2f climb=%.2f "
+ "mode=%d status=%d\n",
+ session->newdata.time,
+ session->newdata.latitude, session->newdata.longitude,
+ session->newdata.altitude, session->newdata.speed,
+ session->newdata.track, session->newdata.climb,
+ session->newdata.mode, session->gpsdata.status);
break;
case 0x23: /* Compact Super Packet */
session->driver.tsip.req_compact = 0;
@@ -771,8 +772,9 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
s2 = getbes16(buf, 21); /* east velocity */
s3 = getbes16(buf, 23); /* north velocity */
s4 = getbes16(buf, 25); /* up velocity */
- gpsd_report(&session->context->errout, LOG_INF, "CSP %u %d %u %u %d %u %d %d %d %d\n", ul1,
- s1, u1, u2, sl1, ul2, sl3, s2, s3, s4);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "CSP %u %d %u %u %d %u %d %d %d %d\n", ul1,
+ s1, u1, u2, sl1, ul2, sl3, s2, s3, s4);
if ((int)u1 > 10) {
session->context->leap_seconds = (int)u1;
session->context->valid |= LEAP_SECOND_VALID;
@@ -817,19 +819,19 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | SPEED_SET |
TRACK_SET |CLIMB_SET | STATUS_SET | MODE_SET | CLEAR_IS |
REPORT_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SP-CSP 0x23: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
- "speed=%.2f track=%.2f climb=%.2f mode=%d status=%d\n",
- session->newdata.time,
- session->newdata.latitude, session->newdata.longitude,
- session->newdata.altitude, session->newdata.speed,
- session->newdata.track, session->newdata.climb,
- session->newdata.mode, session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SP-CSP 0x23: time=%.2f lat=%.2f lon=%.2f alt=%.2f "
+ "speed=%.2f track=%.2f climb=%.2f mode=%d status=%d\n",
+ session->newdata.time,
+ session->newdata.latitude, session->newdata.longitude,
+ session->newdata.altitude, session->newdata.speed,
+ session->newdata.track, session->newdata.climb,
+ session->newdata.mode, session->gpsdata.status);
break;
case 0xab: /* Thunderbolt Timing Superpacket */
if (len != 17) {
- gpsd_report(&session->context->errout, 4, "pkt 0xab len=%d\n", len);
+ gpsd_log(&session->context->errout, 4, "pkt 0xab len=%d\n", len);
break;
}
session->driver.tsip.last_41 = now; /* keep timestamp for request */
@@ -843,19 +845,19 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
session->newdata.time =
gpsd_gpstime_resolve(session, (unsigned short)s1, (double)ul1);
mask |= TIME_SET | PPSTIME_IS | CLEAR_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SP-TTS 0xab time=%.2f mask={TIME}\n",
- session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SP-TTS 0xab time=%.2f mask={TIME}\n",
+ session->newdata.time);
}
- gpsd_report(&session->context->errout, 4,
- "GPS Time %u %d %d\n", ul1, s1, s2);
+ gpsd_log(&session->context->errout, 4,
+ "GPS Time %u %d %d\n", ul1, s1, s2);
break;
case 0xac: /* Thunderbolt Position Superpacket */
if (len != 68) {
- gpsd_report(&session->context->errout, 4, "pkt 0xac len=%d\n", len);
+ gpsd_log(&session->context->errout, 4, "pkt 0xac len=%d\n", len);
break;
}
@@ -921,18 +923,18 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
}
mask |= LATLON_SET | ALTITUDE_SET | MODE_SET | REPORT_IS;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SP-TPS 0xac time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SP-TPS 0xac time=%.2f lat=%.2f lon=%.2f alt=%.2f\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude);
break;
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "Unhandled TSIP superpacket type 0x%02x\n",
- u1);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Unhandled TSIP superpacket type 0x%02x\n",
+ u1);
}
break;
case 0xbb: /* Navigation Configuration */
@@ -947,12 +949,13 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
f3 = getbef32((char *)buf, 13); /* DOP Mask */
f4 = getbef32((char *)buf, 17); /* DOP Switch */
u5 = getub(buf, 21); /* DGPS Age Limit (not in Accutime Gold) */
- gpsd_report(&session->context->errout, LOG_INF,
- "Navigation Configuration %u %u %u %u %f %f %f %f %u\n",
- u1, u2, u3, u4, f1, f2, f3, f4, u5);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "Navigation Configuration %u %u %u %u %f %f %f %f %u\n",
+ u1, u2, u3, u4, f1, f2, f3, f4, u5);
break;
default:
- gpsd_report(&session->context->errout, LOG_WARN, "Unhandled TSIP packet type 0x%02x\n", id);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Unhandled TSIP packet type 0x%02x\n", id);
break;
}
@@ -994,8 +997,8 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session)
((now - session->driver.tsip.req_compact) > 5)) {
/* Compact Superpacket requested but no response */
session->driver.tsip.req_compact = 0;
- gpsd_report(&session->context->errout, LOG_WARN,
- "No Compact Super Packet, use LFwEI\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "No Compact Super Packet, use LFwEI\n");
/* Request LFwEI Super Packet */
putbyte(buf, 0, 0x20);
@@ -1148,8 +1151,8 @@ static void tsip_mode(struct gps_device_t *session, int mode)
;
} else {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "unknown mode %i requested\n", mode);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "unknown mode %i requested\n", mode);
}
}
#endif /* RECONFIGURE_ENABLE */
diff --git a/driver_ubx.c b/driver_ubx.c
index ec5876c2..350f4990 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -148,18 +148,18 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.status = STATUS_FIX;
mask |= MODE_SET | STATUS_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVSOL: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d used=%d\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,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVSOL: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d used=%d\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,
+ session->gpsdata.satellites_used);
return mask;
}
@@ -196,13 +196,13 @@ ubx_msg_nav_dop(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.dop.tdop = (double)(getleu16(buf, 8) / 100.0);
session->gpsdata.dop.vdop = (double)(getleu16(buf, 10) / 100.0);
session->gpsdata.dop.hdop = (double)(getleu16(buf, 12) / 100.0);
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVDOP: gdop=%.2f pdop=%.2f "
- "hdop=%.2f vdop=%.2f tdop=%.2f mask={DOP}\n",
- session->gpsdata.dop.gdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop,
- session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVDOP: gdop=%.2f pdop=%.2f "
+ "hdop=%.2f vdop=%.2f tdop=%.2f mask={DOP}\n",
+ session->gpsdata.dop.gdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop,
+ session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
return DOP_SET;
}
@@ -227,9 +227,9 @@ ubx_msg_nav_timegps(struct gps_device_t *session, unsigned char *buf,
(unsigned short int)gw,
(double)tow / 1000.0);
- gpsd_report(&session->context->errout, LOG_DATA,
- "TIMEGPS: time=%.2f leap=%d, mask={TIME}\n",
- session->newdata.time, session->context->leap_seconds);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "TIMEGPS: time=%.2f leap=%d, mask={TIME}\n",
+ session->newdata.time, session->context->leap_seconds);
return TIME_SET | PPSTIME_IS;
}
@@ -243,16 +243,16 @@ ubx_msg_nav_svinfo(struct gps_device_t *session, unsigned char *buf,
unsigned int i, nchan, nsv, st;
if (data_len < 152) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "runt svinfo (datalen=%zd)\n", data_len);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "runt svinfo (datalen=%zd)\n", data_len);
return 0;
}
/*@ +charint @*/
nchan = (unsigned int)getub(buf, 4);
if (nchan > MAXCHANNELS) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "Invalid NAV SVINFO message, >%d reported visible",
- MAXCHANNELS);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "Invalid NAV SVINFO message, >%d reported visible",
+ MAXCHANNELS);
return 0;
}
/*@ -charint @*/
@@ -282,10 +282,10 @@ ubx_msg_nav_svinfo(struct gps_device_t *session, unsigned char *buf,
session->gpsdata.skyview_time = NAN;
session->gpsdata.satellites_visible = (int)st;
session->gpsdata.satellites_used = (int)nsv;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | USED_IS;
}
@@ -297,15 +297,16 @@ static void ubx_msg_sbas(struct gps_device_t *session, unsigned char *buf)
#ifdef __UNUSED_DEBUG__
unsigned int i, nsv;
- gpsd_report(&session->context->errout, LOG_WARN,
- "SBAS: %d %d %d %d %d\n",
- (int)getub(buf, 4), (int)getub(buf, 5), (int)getub(buf, 6),
- (int)getub(buf, 7), (int)getub(buf, 8));
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "SBAS: %d %d %d %d %d\n",
+ (int)getub(buf, 4), (int)getub(buf, 5), (int)getub(buf, 6),
+ (int)getub(buf, 7), (int)getub(buf, 8));
nsv = (int)getub(buf, 8);
for (i = 0; i < nsv; i++) {
int off = 12 + 12 * i;
- gpsd_report(&session->context->errout, LOG_WARN, "SBAS info on SV: %d\n", (int)getub(buf, off));
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "SBAS info on SV: %d\n", (int)getub(buf, off));
}
#endif /* __UNUSED_DEBUG__ */
/* really 'in_use' depends on the sats info, EGNOS is still in test */
@@ -323,8 +324,8 @@ static gps_mask_t ubx_msg_sfrb(struct gps_device_t *session, unsigned char *buf)
chan = (unsigned int)getub(buf, 0);
svid = (unsigned int)getub(buf, 1);
- gpsd_report(&session->context->errout, LOG_PROG,
- "UBX_RXM_SFRB: %u %u\n", chan, svid);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "UBX_RXM_SFRB: %u %u\n", chan, svid);
/* UBX does all the parity checking, but still bad data gets through */
for (i = 0; i < 10; i++) {
@@ -347,19 +348,19 @@ static void ubx_msg_inf(struct gps_device_t *session, unsigned char *buf, size_t
txtbuf[data_len] = '\0';
switch (msgid) {
case UBX_INF_DEBUG:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_INF_DEBUG: %s\n", txtbuf);
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_INF_DEBUG: %s\n", txtbuf);
break;
case UBX_INF_TEST:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_INF_TEST: %s\n", txtbuf);
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_INF_TEST: %s\n", txtbuf);
break;
case UBX_INF_NOTICE:
- gpsd_report(&session->context->errout, LOG_INF, "UBX_INF_NOTICE: %s\n", txtbuf);
+ gpsd_log(&session->context->errout, LOG_INF, "UBX_INF_NOTICE: %s\n", txtbuf);
break;
case UBX_INF_WARNING:
- gpsd_report(&session->context->errout, LOG_WARN, "UBX_INF_WARNING: %s\n", txtbuf);
+ gpsd_log(&session->context->errout, LOG_WARN, "UBX_INF_WARNING: %s\n", txtbuf);
break;
case UBX_INF_ERROR:
- gpsd_report(&session->context->errout, LOG_WARN, "UBX_INF_ERROR: %s\n", txtbuf);
+ gpsd_log(&session->context->errout, LOG_WARN, "UBX_INF_ERROR: %s\n", txtbuf);
break;
default:
break;
@@ -386,109 +387,109 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
data_len = (size_t) getles16(buf, 4);
switch (msgid) {
case UBX_NAV_POSECEF:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_POSECEF\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_POSECEF\n");
break;
case UBX_NAV_POSLLH:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_POSLLH\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_POSLLH\n");
mask = ubx_msg_nav_posllh(session, &buf[UBX_PREFIX_LEN], data_len);
break;
case UBX_NAV_STATUS:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_STATUS\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_STATUS\n");
break;
case UBX_NAV_DOP:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_NAV_DOP\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_NAV_DOP\n");
mask = ubx_msg_nav_dop(session, &buf[UBX_PREFIX_LEN], data_len);
break;
case UBX_NAV_SOL:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_NAV_SOL\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_NAV_SOL\n");
mask =
ubx_msg_nav_sol(session, &buf[UBX_PREFIX_LEN],
data_len) | (CLEAR_IS | REPORT_IS);
break;
case UBX_NAV_POSUTM:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_POSUTM\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_POSUTM\n");
break;
case UBX_NAV_VELECEF:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_VELECEF\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_VELECEF\n");
break;
case UBX_NAV_VELNED:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_VELNED\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_VELNED\n");
break;
case UBX_NAV_TIMEGPS:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_NAV_TIMEGPS\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_NAV_TIMEGPS\n");
mask = ubx_msg_nav_timegps(session, &buf[UBX_PREFIX_LEN], data_len);
break;
case UBX_NAV_TIMEUTC:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_TIMEUTC\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_TIMEUTC\n");
break;
case UBX_NAV_CLOCK:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_CLOCK\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_CLOCK\n");
break;
case UBX_NAV_SVINFO:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_NAV_SVINFO\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_NAV_SVINFO\n");
mask = ubx_msg_nav_svinfo(session, &buf[UBX_PREFIX_LEN], data_len);
break;
case UBX_NAV_DGPS:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_DGPS\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_DGPS\n");
break;
case UBX_NAV_SBAS:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_SBAS\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_SBAS\n");
ubx_msg_sbas(session, &buf[6]);
break;
case UBX_NAV_EKFSTATUS:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_NAV_EKFSTATUS\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_EKFSTATUS\n");
break;
case UBX_RXM_RAW:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_RXM_RAW\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_RAW\n");
break;
case UBX_RXM_SFRB:
mask = ubx_msg_sfrb(session, &buf[UBX_PREFIX_LEN]);
break;
case UBX_RXM_SVSI:
- gpsd_report(&session->context->errout, LOG_PROG, "UBX_RXM_SVSI\n");
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_RXM_SVSI\n");
break;
case UBX_RXM_ALM:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_RXM_ALM\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_ALM\n");
break;
case UBX_RXM_EPH:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_RXM_EPH\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_EPH\n");
break;
case UBX_RXM_POSREQ:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_RXM_POSREQ\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_POSREQ\n");
break;
case UBX_MON_SCHED:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_SCHED\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_SCHED\n");
break;
case UBX_MON_IO:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_IO\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_IO\n");
break;
case UBX_MON_IPC:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_IPC\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_IPC\n");
break;
case UBX_MON_VER:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_VER\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_VER\n");
(void)strlcpy(session->subtype,
(char *)&buf[UBX_MESSAGE_DATA_OFFSET + 0], 30);
break;
case UBX_MON_EXCEPT:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_EXCEPT\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_EXCEPT\n");
break;
case UBX_MON_MSGPP:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_MSGPP\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_MSGPP\n");
break;
case UBX_MON_RXBUF:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_RXBUF\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_RXBUF\n");
break;
case UBX_MON_TXBUF:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_TXBUF\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_TXBUF\n");
break;
case UBX_MON_HW:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_HW\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_HW\n");
break;
case UBX_MON_USB:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_MON_USB\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_MON_USB\n");
break;
case UBX_INF_DEBUG:
@@ -505,40 +506,40 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
case UBX_CFG_PRT:
session->driver.ubx.port_id = (unsigned char)buf[UBX_MESSAGE_DATA_OFFSET + 0];
- gpsd_report(&session->context->errout, LOG_INF, "UBX_CFG_PRT: port %d\n",
- session->driver.ubx.port_id);
+ gpsd_log(&session->context->errout, LOG_INF, "UBX_CFG_PRT: port %d\n",
+ session->driver.ubx.port_id);
break;
case UBX_TIM_TP:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_TIM_TP\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_TIM_TP\n");
break;
case UBX_TIM_TM:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_TIM_TM\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_TIM_TM\n");
break;
case UBX_TIM_TM2:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_TIM_TM2\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_TIM_TM2\n");
break;
case UBX_TIM_SVIN:
- gpsd_report(&session->context->errout, LOG_DATA, "UBX_TIM_SVIN\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_TIM_SVIN\n");
break;
case UBX_ACK_NAK:
- gpsd_report(&session->context->errout, LOG_DATA,
- "UBX_ACK_NAK, class: %02x, id: %02x\n",
- buf[UBX_CLASS_OFFSET],
- buf[UBX_TYPE_OFFSET]);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "UBX_ACK_NAK, class: %02x, id: %02x\n",
+ buf[UBX_CLASS_OFFSET],
+ buf[UBX_TYPE_OFFSET]);
break;
case UBX_ACK_ACK:
- gpsd_report(&session->context->errout, LOG_DATA,
- "UBX_ACK_ACK, class: %02x, id: %02x\n",
- buf[UBX_CLASS_OFFSET],
- buf[UBX_TYPE_OFFSET]);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "UBX_ACK_ACK, class: %02x, id: %02x\n",
+ buf[UBX_CLASS_OFFSET],
+ buf[UBX_TYPE_OFFSET]);
break;
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "UBX: unknown packet id 0x%04hx (length %zd)\n",
- msgid, len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "UBX: unknown packet id 0x%04hx (length %zd)\n",
+ msgid, len);
}
return mask | ONLINE_SET;
@@ -600,10 +601,10 @@ bool ubx_write(struct gps_device_t * session,
/*@ +type @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> GPS: UBX class: %02x, id: %02x, len: %zd, crc: %02x%02x\n",
- msg_class, msg_id, data_len,
- CK_A, CK_B);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> GPS: UBX class: %02x, id: %02x, len: %zd, crc: %02x%02x\n",
+ msg_class, msg_id, data_len,
+ CK_A, CK_B);
count = gpsd_write(session, session->msgbuf, session->msgbuflen);
ok = (count == (ssize_t) session->msgbuflen);
/*@ +nullderef @*/
@@ -638,7 +639,7 @@ static void ubx_event_hook(struct gps_device_t *session, event_t event)
else if (event == event_identified) {
unsigned char msg[32];
- gpsd_report(&session->context->errout, LOG_DATA, "UBX configure\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX configure\n");
/*@ -type @*/
msg[0] = 0x03; /* SBAS mode enabled, accept testbed mode */
@@ -669,7 +670,7 @@ static void ubx_event_hook(struct gps_device_t *session, event_t event)
}; /* reserved */
/*@ +type @*/
- gpsd_report(&session->context->errout, LOG_DATA, "UBX revert\n");
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX revert\n");
/* Reverting all in one fast and reliable reset */
(void)ubx_write(session, 0x06, 0x04, msg, 4); /* CFG-RST */
@@ -956,8 +957,8 @@ static bool ubx_rate(struct gps_device_t *session, double cycletime)
if (cycletime < 200.0)
cycletime = 200.0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "UBX rate change, report every %f secs\n", cycletime);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "UBX rate change, report every %f secs\n", cycletime);
s = (unsigned short)cycletime;
msg[0] = (unsigned char)(s >> 8);
msg[1] = (unsigned char)(s & 0xff);
diff --git a/driver_zodiac.c b/driver_zodiac.c
index 2a0e367e..d3fe0b7e 100644
--- a/driver_zodiac.c
+++ b/driver_zodiac.c
@@ -86,8 +86,8 @@ static ssize_t zodiac_spew(struct gps_device_t *session, unsigned short type,
if (end_write(session->gpsdata.gps_fd, &h, hlen) != (ssize_t) hlen ||
end_write(session->gpsdata.gps_fd, dat,
datlen) != (ssize_t) datlen) {
- gpsd_report(&session->context->errout, LOG_RAW,
- "Reconfigure write failed\n");
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Reconfigure write failed\n");
return -1;
}
}
@@ -98,8 +98,8 @@ static ssize_t zodiac_spew(struct gps_device_t *session, unsigned short type,
for (i = 0; i < dlen; i++)
str_appendf(buf, sizeof(buf), " %04x", dat[i]);
- gpsd_report(&session->context->errout, LOG_RAW,
- "Sent Zodiac packet: %s\n", buf);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Sent Zodiac packet: %s\n", buf);
return 0;
}
@@ -204,13 +204,13 @@ static gps_mask_t handle1000(struct gps_device_t *session)
mask =
TIME_SET | PPSTIME_IS | LATLON_SET | ALTITUDE_SET | CLIMB_SET | SPEED_SET |
TRACK_SET | STATUS_SET | MODE_SET;
- gpsd_report(&session->context->errout, LOG_DATA,
- "1000: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d\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_log(&session->context->errout, LOG_DATA,
+ "1000: time=%.2f lat=%.2f lon=%.2f alt=%.2f track=%.2f speed=%.2f climb=%.2f mode=%d status=%d\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);
return mask;
}
@@ -247,10 +247,10 @@ static gps_mask_t handle1002(struct gps_device_t *session)
session->gpsdata.skyview_time = gpsd_gpstime_resolve(session,
(unsigned short)gps_week,
(double)gps_seconds);
- gpsd_report(&session->context->errout, LOG_DATA,
- "1002: visible=%d used=%d mask={SATELLITE|USED}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "1002: visible=%d used=%d mask={SATELLITE|USED}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | USED_IS;
}
@@ -293,14 +293,14 @@ static gps_mask_t handle1003(struct gps_device_t *session)
}
}
session->gpsdata.skyview_time = NAN;
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVDOP: visible=%d gdop=%.2f pdop=%.2f "
- "hdop=%.2f vdop=%.2f tdop=%.2f mask={SATELLITE|DOP}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.dop.gdop,
- session->gpsdata.dop.hdop,
- session->gpsdata.dop.vdop,
- session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVDOP: visible=%d gdop=%.2f pdop=%.2f "
+ "hdop=%.2f vdop=%.2f tdop=%.2f mask={SATELLITE|DOP}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.dop.gdop,
+ session->gpsdata.dop.hdop,
+ session->gpsdata.dop.vdop,
+ session->gpsdata.dop.pdop, session->gpsdata.dop.tdop);
return SATELLITE_SET | DOP_SET;
}
@@ -328,9 +328,9 @@ static gps_mask_t handle1011(struct gps_device_t *session)
* The Zodiac is supposed to send one of these messages on startup.
*/
getstringz(session->subtype, session->lexer.outbuffer, 19, 28); /* software version field */
- gpsd_report(&session->context->errout, LOG_DATA,
- "1011: subtype=%s mask={DEVICEID}\n",
- session->subtype);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "1011: subtype=%s mask={DEVICEID}\n",
+ session->subtype);
return DEVICEID_SET;
}
@@ -353,9 +353,9 @@ static gps_mask_t zodiac_analyze(struct gps_device_t *session)
unsigned int id =
(unsigned int)((session->lexer.outbuffer[3] << 8) |
session->lexer.outbuffer[2]);
- gpsd_report(&session->context->errout, LOG_RAW,
- "Raw Zodiac packet type %d length %zd: %s\n",
- id, session->lexer.outbuflen, gpsd_prettydump(session));
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "Raw Zodiac packet type %d length %zd: %s\n",
+ id, session->lexer.outbuflen, gpsd_prettydump(session));
if (session->lexer.outbuflen < 10)
return 0;
diff --git a/drivers.c b/drivers.c
index 576ef574..bc49cf96 100644
--- a/drivers.c
+++ b/drivers.c
@@ -36,22 +36,22 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
char *sentence = (char *)session->lexer.outbuffer;
if (sentence[strlen(sentence)-1] != '\n')
- gpsd_report(&session->context->errout, LOG_IO,
- "<= GPS: %s\n", sentence);
+ gpsd_log(&session->context->errout, LOG_IO,
+ "<= GPS: %s\n", sentence);
else
- gpsd_report(&session->context->errout, LOG_IO,
- "<= GPS: %s", sentence);
+ gpsd_log(&session->context->errout, LOG_IO,
+ "<= GPS: %s", sentence);
if ((st=nmea_parse(sentence, session)) == 0) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown sentence: \"%s\"\n", sentence);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown sentence: \"%s\"\n", sentence);
}
for (dp = gpsd_drivers; *dp; dp++) {
char *trigger = (*dp)->trigger;
if (trigger!=NULL && str_starts_with(sentence, trigger)) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "found trigger string %s.\n", trigger);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "found trigger string %s.\n", trigger);
if (*dp != session->device_type) {
(void)gpsd_switch_driver(session, (*dp)->type_name);
if (session->device_type != NULL
@@ -65,9 +65,9 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
return st;
#endif /* NMEA_ENABLE */
} else {
- gpsd_report(&session->context->errout, LOG_SHOUT,
- "packet type %d fell through (should never happen): %s.\n",
- session->lexer.type, gpsd_prettydump(session));
+ gpsd_log(&session->context->errout, LOG_SHOUT,
+ "packet type %d fell through (should never happen): %s.\n",
+ session->lexer.type, gpsd_prettydump(session));
return 0;
}
}
@@ -149,8 +149,8 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
#ifdef NMEA_ENABLE
case 0:
/* probe for Garmin serial GPS -- expect $PGRMC followed by data */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for Garmin NMEA\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for Garmin NMEA\n");
(void)nmea_send(session, "$PGRMCE");
break;
#endif /* NMEA_ENABLE */
@@ -173,7 +173,8 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
* mode! Fix this if we ever find a nondisruptive probe
* string.
*/
- gpsd_report(&session->context->errout, LOG_PROG, "=> Probing for SiRF\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for SiRF\n");
(void)nmea_send(session,
"$PSRF100,0,%d,%d,%d,0",
session->gpsdata.dev.baudrate,
@@ -185,20 +186,21 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
#ifdef NMEA_ENABLE
case 2:
/* probe for the FV-18 -- expect $PFEC,GPint followed by data */
- gpsd_report(&session->context->errout, LOG_PROG, "=> Probing for FV-18\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for FV-18\n");
(void)nmea_send(session, "$PFEC,GPint");
break;
case 3:
/* probe for the Trimble Copernicus */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for Trimble Copernicus\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for Trimble Copernicus\n");
(void)nmea_send(session, "$PTNLSNM,0139,01");
break;
#endif /* NMEA_ENABLE */
#ifdef EVERMORE_ENABLE
case 4:
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for Evermore\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for Evermore\n");
/* Enable checksum and GGA(1s), GLL(0s), GSA(1s), GSV(1s), RMC(1s), VTG(0s), PEMT101(0s) */
/* EverMore will reply with: \x10\x02\x04\x38\x8E\xC6\x10\x03 */
(void)gpsd_write(session,
@@ -209,32 +211,32 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
#ifdef GPSCLOCK_ENABLE
case 5:
/* probe for Furuno Electric GH-79L4-N (GPSClock); expect $PFEC,GPssd */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for GPSClock\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for GPSClock\n");
(void)nmea_send(session, "$PFEC,GPsrq");
break;
#endif /* GPSCLOCK_ENABLE */
#ifdef ASHTECH_ENABLE
case 6:
/* probe for Ashtech -- expect $PASHR,RID */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for Ashtech\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for Ashtech\n");
(void)nmea_send(session, "$PASHQ,RID");
break;
#endif /* ASHTECH_ENABLE */
#ifdef UBLOX_ENABLE
case 7:
/* probe for UBX -- query port configuration */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for UBX\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for UBX\n");
(void)ubx_write(session, 0x06, 0x00, NULL, 0);
break;
#endif /* UBLOX_ENABLE */
#ifdef MTK3301_ENABLE
case 8:
/* probe for MTK-3301 -- expect $PMTK705 */
- gpsd_report(&session->context->errout, LOG_PROG,
- "=> Probing for MediaTek\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "=> Probing for MediaTek\n");
(void)nmea_send(session, "$PMTK605");
break;
#endif /* MTK3301_ENABLE */
@@ -514,8 +516,8 @@ static void gpsclock_event_hook(struct gps_device_t *session, event_t event)
* ignore the trailing PPS edge when extracting time from this chip.
*/
if (event == event_identified || event == event_reactivate) {
- gpsd_report(&session->context->errout, LOG_INF,
- "PPS trailing edge will be ignored\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "PPS trailing edge will be ignored\n");
session->nmea.ignore_trailing_edge = true;
}
}
@@ -687,8 +689,8 @@ static ssize_t tnt_control_send(struct gps_device_t *session,
}
#ifdef __UNUSED__
else {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Bad TNT sentence: '%s'\n", msg);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Bad TNT sentence: '%s'\n", msg);
}
#endif /* __UNUSED__ */
while (((c = *p) != '\0')) {
@@ -713,12 +715,12 @@ static bool tnt_send(struct gps_device_t *session, const char *fmt, ...)
va_end(ap);
sent = tnt_control_send(session, buf, strlen(buf));
if (sent == (ssize_t) strlen(buf)) {
- gpsd_report(&session->context->errout, LOG_IO,
- "=> GPS: %s\n", buf);
+ gpsd_log(&session->context->errout, LOG_IO,
+ "=> GPS: %s\n", buf);
return true;
} else {
- gpsd_report(&session->context->errout, LOG_WARN,
- "=> GPS: %s FAILED\n", buf);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "=> GPS: %s FAILED\n", buf);
return false;
}
}
@@ -811,10 +813,10 @@ static int oceanserver_send(struct gpsd_errout_t *errout,
status = (int)write(fd, buf, strlen(buf));
(void)tcdrain(fd);
if (status == (int)strlen(buf)) {
- gpsd_report(errout, LOG_IO, "=> GPS: %s\n", buf);
+ gpsd_log(errout, LOG_IO, "=> GPS: %s\n", buf);
return status;
} else {
- gpsd_report(errout, LOG_WARN, "=> GPS: %s FAILED\n", buf);
+ gpsd_log(errout, LOG_WARN, "=> GPS: %s FAILED\n", buf);
return -1;
}
}
@@ -944,12 +946,12 @@ static gps_mask_t rtcm104v2_analyze(struct gps_device_t *session)
rtcm2_unpack(&session->gpsdata.rtcm2, (char *)session->lexer.isgps.buf);
/* extra guard prevents expensive hexdump calls */
if (session->context->errout.debug >= LOG_RAW)
- gpsd_report(&session->context->errout, LOG_RAW,
- "RTCM 2.x packet type 0x%02x length %d words from %zd bytes: %s\n",
- session->gpsdata.rtcm2.type,
- session->gpsdata.rtcm2.length + 2,
- session->lexer.isgps.buflen,
- gpsd_hexdump(session->msgbuf, sizeof(session->msgbuf),
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "RTCM 2.x packet type 0x%02x length %d words from %zd bytes: %s\n",
+ session->gpsdata.rtcm2.type,
+ session->gpsdata.rtcm2.length + 2,
+ session->lexer.isgps.buflen,
+ gpsd_hexdump(session->msgbuf, sizeof(session->msgbuf),
(char *)session->lexer.isgps.buf,
(session->gpsdata.rtcm2.length +
2) * sizeof(isgps30bits_t)));
@@ -996,7 +998,7 @@ static gps_mask_t rtcm104v3_analyze(struct gps_device_t *session)
{
uint16_t type = getbeu16(session->lexer.inbuffer, 3) >> 4;
- gpsd_report(&session->context->errout, LOG_RAW, "RTCM 3.x packet %d\n", type);
+ gpsd_log(&session->context->errout, LOG_RAW, "RTCM 3.x packet %d\n", type);
rtcm3_unpack(session->context,
&session->gpsdata.rtcm3,
(char *)session->lexer.outbuffer);
@@ -1207,15 +1209,16 @@ static bool aivdm_decode(const char *buf, size_t buflen,
return false;
/* we may need to dump the raw packet */
- gpsd_report(&session->context->errout, LOG_PROG,
- "AIVDM packet length %zd: %s\n", buflen, buf);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "AIVDM packet length %zd: %s\n", buflen, buf);
/* first clear the result, making sure we don't return garbage */
memset(ais, 0, sizeof(*ais));
/* discard overlong sentences */
if (strlen(buf) > sizeof(fieldcopy)-1) {
- gpsd_report(&session->context->errout, LOG_ERROR, "overlong AIVDM packet.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "overlong AIVDM packet.\n");
return false;
}
@@ -1231,7 +1234,8 @@ static bool aivdm_decode(const char *buf, size_t buflen,
/* discard sentences with exiguous commas; catches run-ons */
if (nfields < 7) {
- gpsd_report(&session->context->errout, LOG_ERROR, "malformed AIVDM packet.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "malformed AIVDM packet.\n");
return false;
}
@@ -1243,15 +1247,15 @@ static bool aivdm_decode(const char *buf, size_t buflen,
* is going to break if there's ever an AIVDO type 24, though.
*/
if (!str_starts_with((const char *)field[0], "!AIVDO"))
- gpsd_report(&session->context->errout, LOG_INF,
- "invalid empty AIS channel. Assuming 'A'\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "invalid empty AIS channel. Assuming 'A'\n");
ais_context = &session->driver.aivdm.context[0];
session->driver.aivdm.ais_channel ='A';
break;
case '1':
if (strcmp((char *)field[4], (char *)"12") == 0) {
- gpsd_report(&session->context->errout, LOG_INF,
- "ignoring bogus AIS channel '12'.\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "ignoring bogus AIS channel '12'.\n");
return false;
}
/*@fallthrough@*/
@@ -1266,12 +1270,12 @@ static bool aivdm_decode(const char *buf, size_t buflen,
session->driver.aivdm.ais_channel ='B';
break;
case 'C':
- gpsd_report(&session->context->errout, LOG_INF,
- "ignoring AIS channel C (secure AIS).\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "ignoring AIS channel C (secure AIS).\n");
return false;
default:
- gpsd_report(&session->context->errout, LOG_ERROR,
- "invalid AIS channel 0x%0X .\n", field[4][0]);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "invalid AIS channel 0x%0X .\n", field[4][0]);
return false;
}
@@ -1279,17 +1283,17 @@ static bool aivdm_decode(const char *buf, size_t buflen,
ifrag = atoi((char *)field[2]); /* fragment id */
data = field[5];
pad = field[6][0]; /* number of padding bits */
- gpsd_report(&session->context->errout, LOG_PROG,
- "nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s\n",
- nfrags, ifrag, ais_context->decoded_frags, data);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s\n",
+ nfrags, ifrag, ais_context->decoded_frags, data);
/* assemble the binary data */
/* check fragment ordering */
if (ifrag != ais_context->decoded_frags + 1) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "invalid fragment #%d received, expected #%d.\n",
- ifrag, ais_context->decoded_frags + 1);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "invalid fragment #%d received, expected #%d.\n",
+ ifrag, ais_context->decoded_frags + 1);
if (ifrag != 1)
return false;
/* else, ifrag==1: Just discard all that was previously decoded and
@@ -1310,8 +1314,8 @@ static bool aivdm_decode(const char *buf, size_t buflen,
if (ch >= 40)
ch -= 8;
#ifdef __UNUSED_DEBUG__
- gpsd_report(&session->context->errout, LOG_RAW,
- "%c: %s\n", *cp, sixbits[ch]);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "%c: %s\n", *cp, sixbits[ch]);
#endif /* __UNUSED_DEBUG__ */
/*@ -shiftnegative @*/
for (i = 5; i >= 0; i--) {
@@ -1321,8 +1325,8 @@ static bool aivdm_decode(const char *buf, size_t buflen,
}
ais_context->bitlen++;
if (ais_context->bitlen > sizeof(ais_context->bits)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "overlong AIVDM payload truncated.\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "overlong AIVDM payload truncated.\n");
return false;
}
}
@@ -1336,10 +1340,10 @@ static bool aivdm_decode(const char *buf, size_t buflen,
if (ifrag == nfrags) {
if (debug >= LOG_INF) {
size_t clen = BITS_TO_BYTES(ais_context->bitlen);
- gpsd_report(&session->context->errout, LOG_INF,
- "AIVDM payload is %zd bits, %zd chars: %s\n",
- ais_context->bitlen, clen,
- gpsd_hexdump(session->msgbuf, sizeof(session->msgbuf),
+ gpsd_log(&session->context->errout, LOG_INF,
+ "AIVDM payload is %zd bits, %zd chars: %s\n",
+ ais_context->bitlen, clen,
+ gpsd_hexdump(session->msgbuf, sizeof(session->msgbuf),
(char *)ais_context->bits, clen));
}
@@ -1457,8 +1461,8 @@ static void path_rewrite(struct gps_device_t *session, char *prefix)
static gps_mask_t json_pass_packet(struct gps_device_t *session)
{
- gpsd_report(&session->context->errout, LOG_IO,
- "<= GPS: %s\n", (char *)session->lexer.outbuffer);
+ gpsd_log(&session->context->errout, LOG_IO,
+ "<= GPS: %s\n", (char *)session->lexer.outbuffer);
if (strstr(session->gpsdata.dev.path, ":/") != NULL && strstr(session->gpsdata.dev.path, "localhost") == NULL)
{
@@ -1485,9 +1489,9 @@ static gps_mask_t json_pass_packet(struct gps_device_t *session)
session->lexer.outbuflen = strlen((char *)session->lexer.outbuffer);
}
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "JSON, passing through %s\n",
- (char *)session->lexer.outbuffer);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "JSON, passing through %s\n",
+ (char *)session->lexer.outbuffer);
/*@-nullpass@*/
return PASSTHROUGH_IS;
}
diff --git a/gpsctl.c b/gpsctl.c
index 7f655959..4e6c241b 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -88,18 +88,18 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata,
(void)strlcat(buf, "\n", sizeof(buf));
/*@-usedef@*/
if (write(gpsdata->gps_fd, buf, strlen(buf)) <= 0) {
- gpsd_report(&context.errout, LOG_ERROR, "gps_query(), write failed\n");
+ gpsd_log(&context.errout, LOG_ERROR, "gps_query(), write failed\n");
return false;
}
/*@+usedef@*/
- gpsd_report(&context.errout, LOG_PROG, "gps_query(), wrote, %s\n", buf);
+ gpsd_log(&context.errout, LOG_PROG, "gps_query(), wrote, %s\n", buf);
FD_ZERO(&rfds);
starttime = time(NULL);
for (;;) {
FD_CLR(gpsdata->gps_fd, &rfds);
- gpsd_report(&context.errout, LOG_PROG, "waiting...\n");
+ gpsd_log(&context.errout, LOG_PROG, "waiting...\n");
/*@ -usedef -type -nullpass -compdef @*/
tv.tv_sec = 2;
@@ -107,16 +107,16 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata,
if (pselect(gpsdata->gps_fd + 1, &rfds, NULL, NULL, &tv, &oldset) == -1) {
if (errno == EINTR || !FD_ISSET(gpsdata->gps_fd, &rfds))
continue;
- gpsd_report(&context.errout, LOG_ERROR, "select %s\n", strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR, "select %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
/*@ +usedef +type +nullpass +compdef @*/
- gpsd_report(&context.errout, LOG_PROG, "reading...\n");
+ gpsd_log(&context.errout, LOG_PROG, "reading...\n");
(void)gps_read(gpsdata);
if (ERROR_SET & gpsdata->set) {
- gpsd_report(&context.errout, LOG_ERROR, "error '%s'\n", gpsdata->error);
+ gpsd_log(&context.errout, LOG_ERROR, "error '%s'\n", gpsdata->error);
return false;
}
@@ -124,9 +124,9 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata,
if ((expect == NON_ERROR) || (expect & gpsdata->set) != 0)
return true;
else if (timeout > 0 && (time(NULL) - starttime > timeout)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "timed out after %d seconds\n",
- timeout);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "timed out after %d seconds\n",
+ timeout);
return false;
}
/*@ -ignorequals @*/
@@ -138,10 +138,10 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata,
static void onsig(int sig)
{
if (sig == SIGALRM) {
- gpsd_report(&context.errout, LOG_ERROR, "packet recognition timed out.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "packet recognition timed out.\n");
exit(EXIT_FAILURE);
} else {
- gpsd_report(&context.errout, LOG_ERROR, "killed by signal %d\n", sig);
+ gpsd_log(&context.errout, LOG_ERROR, "killed by signal %d\n", sig);
exit(EXIT_SUCCESS);
}
}
@@ -206,8 +206,8 @@ int main(int argc, char **argv)
#ifdef RECONFIGURE_ENABLE
rate = optarg;
#else
- gpsd_report(&context.errout, LOG_ERROR,
- "cycle-change capability has been conditioned out.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "cycle-change capability has been conditioned out.\n");
#endif /* RECONFIGURE_ENABLE */
break;
case 'x': /* ship specified control string */
@@ -215,13 +215,13 @@ int main(int argc, char **argv)
control = optarg;
lowlevel = true;
if ((cooklen = hex_escapes(cooked, control)) <= 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "invalid escape string (error %d)\n", (int)cooklen);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "invalid escape string (error %d)\n", (int)cooklen);
exit(EXIT_FAILURE);
}
#else
- gpsd_report(&context.errout, LOG_ERROR,
- "control_send capability has been conditioned out.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "control_send capability has been conditioned out.\n");
#endif /* CONTROLSEND_ENABLE */
break;
case 'e': /* echo specified control string with wrapper */
@@ -260,8 +260,8 @@ int main(int argc, char **argv)
#ifdef RECONFIGURE_ENABLE
to_nmea = true;
#else
- gpsd_report(&context.errout, LOG_ERROR,
- "speed-change capability has been conditioned out.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "speed-change capability has been conditioned out.\n");
#endif /* RECONFIGURE_ENABLE */
break;
case 'r': /* force-switch to default mode */
@@ -269,16 +269,16 @@ int main(int argc, char **argv)
reset = true;
lowlevel = false; /* so we'll abort if the daemon is running */
#else
- gpsd_report(&context.errout, LOG_ERROR,
- "reset capability has been conditioned out.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "reset capability has been conditioned out.\n");
#endif /* RECONFIGURE_ENABLE */
break;
case 's': /* change output baud rate */
#ifdef RECONFIGURE_ENABLE
speed = optarg;
#else
- gpsd_report(&context.errout, LOG_ERROR,
- "speed-change capability has been conditioned out.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "speed-change capability has been conditioned out.\n");
#endif /* RECONFIGURE_ENABLE */
break;
case 't': /* force the device type */
@@ -289,15 +289,15 @@ int main(int argc, char **argv)
/*@-nullpass@*/
status = shmget(getenv("GPSD_SHM_KEY") ? (key_t)strtol(getenv("GPSD_SHM_KEY"), NULL, 0) : (key_t)GPSD_SHM_KEY, 0, 0);
if (status == -1) {
- gpsd_report(&context.errout, LOG_WARN,
- "GPSD SHM segment does not exist.\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "GPSD SHM segment does not exist.\n");
exit(1);
} else {
status = shmctl(status, IPC_RMID, NULL);
if (status == -1) {
- gpsd_report(&context.errout, LOG_ERROR,
- "shmctl failed, errno = %d (%s)\n",
- errno, strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "shmctl failed, errno = %d (%s)\n",
+ errno, strerror(errno));
exit(1);
}
}
@@ -337,22 +337,22 @@ int main(int argc, char **argv)
}
}
if (matchcount == 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "no driver type name matches '%s'.\n", devtype);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "no driver type name matches '%s'.\n", devtype);
else if (matchcount == 1) {
assert(forcetype != NULL);
- gpsd_report(&context.errout, LOG_PROG,
- "%s driver selected.\n", forcetype->type_name);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s driver selected.\n", forcetype->type_name);
} else {
forcetype = NULL;
- gpsd_report(&context.errout, LOG_ERROR,
- "%d driver type names match '%s'.\n",
- matchcount, devtype);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%d driver type names match '%s'.\n",
+ matchcount, devtype);
}
}
if (((int)to_nmea + (int)to_binary + (int)reset) > 1) {
- gpsd_report(&context.errout, LOG_ERROR, "make up your mind, would you?\n");
+ gpsd_log(&context.errout, LOG_ERROR, "make up your mind, would you?\n");
exit(EXIT_SUCCESS);
}
@@ -364,9 +364,9 @@ int main(int argc, char **argv)
if (!lowlevel) {
/* Try to open the stream to gpsd. */
if (gps_open(NULL, NULL, &gpsdata) != 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "no gpsd running or network error: %s.\n",
- gps_errstr(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "no gpsd running or network error: %s.\n",
+ gps_errstr(errno));
lowlevel = true;
}
}
@@ -380,22 +380,22 @@ int main(int argc, char **argv)
/* what devices have we available? */
if (!gps_query(&gpsdata, DEVICELIST_SET, (int)timeout, "?DEVICES;\n")) {
- gpsd_report(&context.errout, LOG_ERROR, "no DEVICES response received.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "no DEVICES response received.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
}
if (gpsdata.devices.ndevices == 0) {
- gpsd_report(&context.errout, LOG_ERROR, "no devices connected.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "no devices connected.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
} else if (gpsdata.devices.ndevices > 1 && device == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "multiple devices and no device specified.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "multiple devices and no device specified.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
}
- gpsd_report(&context.errout, LOG_PROG,
- "%d device(s) found.\n",gpsdata.devices.ndevices);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%d device(s) found.\n",gpsdata.devices.ndevices);
/* try to mine the devicelist return for the data we want */
if (gpsdata.devices.ndevices == 1 && device == NULL) {
@@ -407,8 +407,8 @@ int main(int argc, char **argv)
if (strcmp(device, gpsdata.devices.list[i].path) == 0) {
goto devicelist_entry_matches;
}
- gpsd_report(&context.errout, LOG_ERROR,
- "specified device not found in device list.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "specified device not found in device list.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
devicelist_entry_matches:;
@@ -421,7 +421,7 @@ int main(int argc, char **argv)
/* if the device has not identified, watch it until it does so */
if (gpsdata.dev.driver[0] == '\0') {
if (gps_stream(&gpsdata, WATCH_ENABLE|WATCH_JSON, NULL) == -1) {
- gpsd_report(&context.errout, LOG_ERROR, "stream set failed.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "stream set failed.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
}
@@ -429,7 +429,7 @@ int main(int argc, char **argv)
while (devcount > 0) {
errno = 0;
if (gps_read(&gpsdata) == -1) {
- gpsd_report(&context.errout, LOG_ERROR, "data read failed.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "data read failed.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
}
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
}
}
}
- gpsd_report(&context.errout, LOG_ERROR, "data read failed.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "data read failed.\n");
(void)gps_close(&gpsdata);
exit(EXIT_FAILURE);
matching_device_seen:;
@@ -450,8 +450,9 @@ int main(int argc, char **argv)
/* sanity check */
if (gpsdata.dev.driver[0] == '\0') {
- gpsd_report(&context.errout, LOG_SHOUT, "%s can't be identified.\n",
- gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_SHOUT,
+ "%s can't be identified.\n",
+ gpsdata.dev.path);
(void)gps_close(&gpsdata);
exit(EXIT_SUCCESS);
}
@@ -474,8 +475,8 @@ int main(int argc, char **argv)
#ifdef RECONFIGURE_ENABLE
if (reset)
{
- gpsd_report(&context.errout, LOG_PROG,
- "cannot reset with gpsd running.\n");
+ gpsd_log(&context.errout, LOG_PROG,
+ "cannot reset with gpsd running.\n");
exit(EXIT_SUCCESS);
}
@@ -492,26 +493,26 @@ int main(int argc, char **argv)
if (!gps_query(&gpsdata, NON_ERROR, (int)timeout,
"?DEVICE={\"path\":\"%s\",\"native\":0}\r\n",
device)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s mode change to NMEA failed\n",
- gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s mode change to NMEA failed\n",
+ gpsdata.dev.path);
status = 1;
} else
- gpsd_report(&context.errout, LOG_PROG,
- "%s mode change succeeded\n", gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s mode change succeeded\n", gpsdata.dev.path);
}
else if (to_binary) {
if (!gps_query(&gpsdata, NON_ERROR, (int)timeout,
"?DEVICE={\"path\":\"%s\",\"native\":1}\r\n",
device)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s mode change to native mode failed\n",
- gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s mode change to native mode failed\n",
+ gpsdata.dev.path);
status = 1;
} else
- gpsd_report(&context.errout, LOG_PROG,
- "%s mode change succeeded\n",
- gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s mode change succeeded\n",
+ gpsdata.dev.path);
}
/*@+boolops@*/
if (speed != NULL) {
@@ -529,20 +530,20 @@ int main(int argc, char **argv)
if (modespec!=NULL) {
*modespec = '\0';
if (strchr("78", *++modespec) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "No support for that word length.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "No support for that word length.\n");
status = 1;
}
parity = *++modespec;
if (strchr("NOE", parity) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "What parity is '%c'?\n", parity);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "What parity is '%c'?\n", parity);
status = 1;
}
stopbits = *++modespec;
if (strchr("12", stopbits) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Stop bits must be 1 or 2.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Stop bits must be 1 or 2.\n");
status = 1;
}
}
@@ -553,16 +554,16 @@ int main(int argc, char **argv)
device, speed, parity, stopbits);
}
if (atoi(speed) != (int)gpsdata.dev.baudrate) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s driver won't support %s%c%c\n",
- gpsdata.dev.path,
- speed, parity, stopbits);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s driver won't support %s%c%c\n",
+ gpsdata.dev.path,
+ speed, parity, stopbits);
status = 1;
} else
- gpsd_report(&context.errout, LOG_PROG,
- "%s change to %s%c%c succeeded\n",
- gpsdata.dev.path,
- speed, parity, stopbits);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s change to %s%c%c succeeded\n",
+ gpsdata.dev.path,
+ speed, parity, stopbits);
}
if (rate != NULL) {
(void)gps_query(&gpsdata,
@@ -581,8 +582,8 @@ int main(int argc, char **argv)
int i;
if (device == NULL || forcetype == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "device and type must be specified for the reset operation.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "device and type must be specified for the reset operation.\n");
exit(EXIT_FAILURE);
}
@@ -642,20 +643,20 @@ int main(int argc, char **argv)
if (!(forcetype != NULL && echo)) {
int maxfd = 0;
if (device == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "device must be specified for low-level access.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "device must be specified for low-level access.\n");
exit(EXIT_FAILURE);
}
gpsd_init(&session, &context, device);
if (gpsd_activate(&session, O_PROBEONLY) < 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "initial GPS device %s open failed\n",
- device);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "initial GPS device %s open failed\n",
+ device);
exit(EXIT_FAILURE);
}
- gpsd_report(&context.errout, LOG_INF,
- "device %s activated\n", session.gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_INF,
+ "device %s activated\n", session.gpsdata.dev.path);
/*@i1@*/FD_SET(session.gpsdata.gps_fd, &all_fds);
if (session.gpsdata.gps_fd > maxfd)
maxfd = session.gpsdata.gps_fd;
@@ -692,12 +693,12 @@ int main(int argc, char **argv)
break;
case DEVICE_ERROR:
/* this is where a failure to sync lands */
- gpsd_report(&context.errout, LOG_WARN,
- "device error, bailing out.\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "device error, bailing out.\n");
exit(EXIT_FAILURE);
case DEVICE_EOF:
- gpsd_report(&context.errout, LOG_WARN,
- "device signed off, bailing out.\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "device signed off, bailing out.\n");
exit(EXIT_SUCCESS);
default:
break;
@@ -705,16 +706,16 @@ int main(int argc, char **argv)
}
/*@+compdef@*/
- gpsd_report(&context.errout, LOG_PROG,
- "%s looks like a %s at %d.\n",
- device, gpsd_id(&session),
- session.gpsdata.dev.baudrate);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s looks like a %s at %d.\n",
+ device, gpsd_id(&session),
+ session.gpsdata.dev.baudrate);
if (forcetype!=NULL && strcmp("NMEA0183", session.device_type->type_name) !=0 && strcmp(forcetype->type_name, session.device_type->type_name)!=0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "'%s' doesn't match non-generic type '%s' of selected device.\n",
- forcetype->type_name,
- session.device_type->type_name);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "'%s' doesn't match non-generic type '%s' of selected device.\n",
+ forcetype->type_name,
+ session.device_type->type_name);
}
}
@@ -742,16 +743,16 @@ int main(int argc, char **argv)
bool write_enable = context.readonly;
context.readonly = false;
if (session.device_type->mode_switcher == NULL) {
- gpsd_report(&context.errout, LOG_SHOUT,
- "%s devices have no mode switch.\n",
- session.device_type->type_name);
+ gpsd_log(&context.errout, LOG_SHOUT,
+ "%s devices have no mode switch.\n",
+ session.device_type->type_name);
status = 1;
} else {
int target_mode = to_nmea ? MODE_NMEA : MODE_BINARY;
- gpsd_report(&context.errout, LOG_SHOUT,
- "switching to mode %s.\n",
- to_nmea ? "NMEA" : "BINARY");
+ gpsd_log(&context.errout, LOG_SHOUT,
+ "switching to mode %s.\n",
+ to_nmea ? "NMEA" : "BINARY");
session.device_type->mode_switcher(&session, target_mode);
settle(&session);
}
@@ -768,29 +769,29 @@ int main(int argc, char **argv)
if (modespec!=NULL) {
*modespec = '\0';
if (strchr("78", *++modespec) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "No support for that word lengths.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "No support for that word lengths.\n");
status = 1;
}
parity = *++modespec;
if (strchr("NOE", parity) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "What parity is '%c'?\n", parity);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "What parity is '%c'?\n", parity);
status = 1;
}
stopbits = *++modespec;
if (strchr("12", parity) == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Stop bits must be 1 or 2.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Stop bits must be 1 or 2.\n");
status = 1;
}
stopbits = (int)(stopbits-'0');
}
if (status == 0) {
if (session.device_type->speed_switcher == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s devices have no speed switch.\n",
- session.device_type->type_name);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s devices have no speed switch.\n",
+ session.device_type->type_name);
status = 1;
}
else if (session.device_type->speed_switcher(&session,
@@ -798,15 +799,15 @@ int main(int argc, char **argv)
parity,
stopbits)) {
settle(&session);
- gpsd_report(&context.errout, LOG_PROG,
- "%s change to %s%c%d succeeded\n",
- session.gpsdata.dev.path,
- speed, parity, stopbits);
+ gpsd_log(&context.errout, LOG_PROG,
+ "%s change to %s%c%d succeeded\n",
+ session.gpsdata.dev.path,
+ speed, parity, stopbits);
} else {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s driver won't support %s%c%d.\n",
- session.gpsdata.dev.path,
- speed, parity, stopbits);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s driver won't support %s%c%d.\n",
+ session.gpsdata.dev.path,
+ speed, parity, stopbits);
status = 1;
}
}
@@ -815,15 +816,16 @@ int main(int argc, char **argv)
bool write_enable = context.readonly;
context.readonly = false;
if (session.device_type->rate_switcher == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s devices have no rate switcher.\n",
- session.device_type->type_name);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s devices have no rate switcher.\n",
+ session.device_type->type_name);
status = 1;
} else {
double rate_dbl = strtod(rate, NULL);
if (!session.device_type->rate_switcher(&session, rate_dbl)) {
- gpsd_report(&context.errout, LOG_ERROR, "rate switch failed.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "rate switch failed.\n");
status = 1;
}
settle(&session);
@@ -837,16 +839,16 @@ int main(int argc, char **argv)
bool write_enable = context.readonly;
context.readonly = false;
if (session.device_type->control_send == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s devices have no control sender.\n",
- session.device_type->type_name);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s devices have no control sender.\n",
+ session.device_type->type_name);
status = 1;
} else {
if (session.device_type->control_send(&session,
cooked,
(size_t)cooklen) == -1) {
- gpsd_report(&context.errout, LOG_ERROR,
- "control transmission failed.\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "control transmission failed.\n");
status = 1;
}
settle(&session);
diff --git a/gpsd.c b/gpsd.c
index f77ef35e..e6e784a9 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -255,18 +255,21 @@ static socket_t filesock(char *filename)
/*@ -mayaliasunique -usedef @*/
if (BAD_SOCKET(sock = socket(AF_UNIX, SOCK_STREAM, 0))) {
- gpsd_report(&context.errout, LOG_ERROR, "Can't create device-control socket\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Can't create device-control socket\n");
return -1;
}
(void)strlcpy(addr.sun_path, filename, sizeof(addr.sun_path));
addr.sun_family = (sa_family_t)AF_UNIX;
if (bind(sock, (struct sockaddr *)&addr, (int)sizeof(addr)) < 0) {
- gpsd_report(&context.errout, LOG_ERROR, "can't bind to local socket %s\n", filename);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't bind to local socket %s\n", filename);
(void)close(sock);
return -1;
}
if (listen(sock, QLEN) == -1) {
- gpsd_report(&context.errout, LOG_ERROR, "can't listen on local socket %s\n", filename);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't listen on local socket %s\n", filename);
(void)close(sock);
return -1;
}
@@ -334,8 +337,8 @@ static socket_t passivesock_af(int af, char *service, char *tcp_or_udp, int qlen
port = ntohs((in_port_t) pse->s_port);
// cppcheck-suppress unreadVariable
else if ((port = (in_port_t) atoi(service)) == 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "can't get \"%s\" service entry.\n", service);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't get \"%s\" service entry.\n", service);
return -1;
}
ppe = getprotobyname(tcp_or_udp);
@@ -371,8 +374,8 @@ static socket_t passivesock_af(int af, char *service, char *tcp_or_udp, int qlen
/*@-unrecog@*/
/* Set packet priority */
if (setsockopt(s, IPPROTO_IP, IP_TOS, &dscp, sizeof(dscp)) == -1)
- gpsd_report(&context.errout, LOG_WARN,
- "Warning: SETSOCKOPT TOS failed\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "Warning: SETSOCKOPT TOS failed\n");
}
/*@+unrecog@*/
@@ -412,57 +415,58 @@ static socket_t passivesock_af(int af, char *service, char *tcp_or_udp, int qlen
if (s > -1) {
int on = 1;
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Error: SETSOCKOPT IPV6_V6ONLY\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Error: SETSOCKOPT IPV6_V6ONLY\n");
(void)close(s);
return -1;
}
/* Set packet priority */
if (setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp)) == -1)
- gpsd_report(&context.errout, LOG_WARN,
- "Warning: SETSOCKOPT TOS failed\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "Warning: SETSOCKOPT TOS failed\n");
}
#endif /* S_SPLINT_S */
break;
#endif /* IPV6_ENABLE */
default:
- gpsd_report(&context.errout, LOG_ERROR,
- "unhandled address family %d\n", af);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "unhandled address family %d\n", af);
return -1;
}
- gpsd_report(&context.errout, LOG_IO,
- "opening %s socket\n", af_str);
+ gpsd_log(&context.errout, LOG_IO,
+ "opening %s socket\n", af_str);
if (BAD_SOCKET(s)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "can't create %s socket\n", af_str);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't create %s socket\n", af_str);
return -1;
}
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
(int)sizeof(one)) == -1) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Error: SETSOCKOPT SO_REUSEADDR\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Error: SETSOCKOPT SO_REUSEADDR\n");
(void)close(s);
return -1;
}
if (bind(s, &sat.sa, sin_len) < 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "can't bind to %s port %s, %s\n", af_str,
- service, strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't bind to %s port %s, %s\n", af_str,
+ service, strerror(errno));
if (errno == EADDRINUSE) {
- gpsd_report(&context.errout, LOG_ERROR,
- "maybe gpsd is already running!\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "maybe gpsd is already running!\n");
}
(void)close(s);
return -1;
}
if (type == SOCK_STREAM && listen(s, qlen) == -1) {
- gpsd_report(&context.errout, LOG_ERROR, "can't listen on port %s\n", service);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't listen on port %s\n", service);
(void)close(s);
return -1;
}
- gpsd_report(&context.errout, LOG_SPIN, "passivesock_af() -> %d\n", s);
+ gpsd_log(&context.errout, LOG_SPIN, "passivesock_af() -> %d\n", s);
return s;
/*@ +mustfreefresh -matchanyintegral @*/
}
@@ -552,13 +556,13 @@ static void detach_client(struct subscriber_t *sub)
}
c_ip = netlib_sock2ip(sub->fd);
(void)shutdown(sub->fd, SHUT_RDWR);
- gpsd_report(&context.errout, LOG_SPIN,
- "close(%d) in detach_client()\n",
- sub->fd);
+ gpsd_log(&context.errout, LOG_SPIN,
+ "close(%d) in detach_client()\n",
+ sub->fd);
(void)close(sub->fd);
- gpsd_report(&context.errout, LOG_INF,
- "detaching %s (sub %d, fd %d) in detach_client\n",
- c_ip, sub_index(sub), sub->fd);
+ gpsd_log(&context.errout, LOG_INF,
+ "detaching %s (sub %d, fd %d) in detach_client\n",
+ c_ip, sub_index(sub), sub->fd);
FD_CLR(sub->fd, &all_fds);
adjust_max_fd(sub->fd, false);
sub->active = (timestamp_t)0;
@@ -583,16 +587,16 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf,
if (context.errout.debug >= LOG_CLIENT) {
if (isprint((unsigned char) buf[0]))
- gpsd_report(&context.errout, LOG_CLIENT,
- "=> client(%d): %s\n", sub_index(sub), buf);
+ gpsd_log(&context.errout, LOG_CLIENT,
+ "=> client(%d): %s\n", sub_index(sub), buf);
else {
char *cp, buf2[MAX_PACKET_LENGTH * 3];
buf2[0] = '\0';
for (cp = buf; cp < buf + len; cp++)
str_appendf(buf2, sizeof(buf2),
"%02x", (unsigned int)(*cp & 0xff));
- gpsd_report(&context.errout, LOG_CLIENT,
- "=> client(%d): =%s\n", sub_index(sub), buf2);
+ gpsd_log(&context.errout, LOG_CLIENT,
+ "=> client(%d): =%s\n", sub_index(sub), buf2);
}
}
@@ -607,23 +611,24 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf,
if (status == (ssize_t) len)
return status;
else if (status > -1) {
- gpsd_report(&context.errout, LOG_INF,
- "short write disconnecting client(%d)\n",
- sub_index(sub));
+ gpsd_log(&context.errout, LOG_INF,
+ "short write disconnecting client(%d)\n",
+ sub_index(sub));
detach_client(sub);
return 0;
} else if (errno == EAGAIN || errno == EINTR)
return 0; /* no data written, and errno says to retry */
else if (errno == EBADF)
- gpsd_report(&context.errout, LOG_WARN, "client(%d) has vanished.\n", sub_index(sub));
+ gpsd_log(&context.errout, LOG_WARN,
+ "client(%d) has vanished.\n", sub_index(sub));
else if (errno == EWOULDBLOCK
&& timestamp() - sub->active > NOREAD_TIMEOUT)
- gpsd_report(&context.errout, LOG_INF,
- "client(%d) timed out.\n", sub_index(sub));
+ gpsd_log(&context.errout, LOG_INF,
+ "client(%d) timed out.\n", sub_index(sub));
else
- gpsd_report(&context.errout, LOG_INF,
- "client(%d) write: %s\n",
- sub_index(sub), strerror(errno));
+ gpsd_log(&context.errout, LOG_INF,
+ "client(%d) write: %s\n",
+ sub_index(sub), strerror(errno));
detach_client(sub);
return status;
}
@@ -701,13 +706,13 @@ static bool open_device( /*@null@*/struct gps_device_t *device)
* 1PPS derived time data to ntpd/chrony.
*/
ntpshm_link_activate(device);
- gpsd_report(&context.errout, LOG_INF,
- "NTPD ntpshm_link_activate: %d\n",
- device->shm_clock != NULL);
+ gpsd_log(&context.errout, LOG_INF,
+ "NTPD ntpshm_link_activate: %d\n",
+ device->shm_clock != NULL);
#endif /* NTPSHM_ENABLE */
- gpsd_report(&context.errout, LOG_INF,
- "device %s activated\n", device->gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_INF,
+ "device %s activated\n", device->gpsdata.dev.path);
FD_SET(device->gpsdata.gps_fd, &all_fds);
adjust_max_fd(device->gpsdata.gps_fd, true);
++highwater;
@@ -721,9 +726,9 @@ bool gpsd_add_device(const char *device_name, bool flag_nowait)
bool ret = false;
/* we can't handle paths longer than GPS_PATH_MAX, so don't try */
if (strlen(device_name) >= GPS_PATH_MAX) {
- gpsd_report(&context.errout, LOG_ERROR,
- "ignoring device %s: path length exceeds maximum %d\n",
- device_name, GPS_PATH_MAX);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "ignoring device %s: path length exceeds maximum %d\n",
+ device_name, GPS_PATH_MAX);
return false;
}
/* stash devicename away for probing when the first client connects */
@@ -733,9 +738,9 @@ bool gpsd_add_device(const char *device_name, bool flag_nowait)
#ifdef NTPSHM_ENABLE
ntpshm_session_init(devp);
#endif /* NTPSHM_ENABLE */
- gpsd_report(&context.errout, LOG_INF,
- "stashing device %s at slot %d\n",
- device_name, (int)(devp - devices));
+ gpsd_log(&context.errout, LOG_INF,
+ "stashing device %s at slot %d\n",
+ device_name, (int)(devp - devices));
if (!flag_nowait) {
devp->gpsdata.gps_fd = UNALLOCATED_FD;
ret = true;
@@ -786,8 +791,8 @@ static void handle_control(int sfd, char *buf)
if (buf[0] == '-') {
/* remove device named after - */
(void)snarfline(buf + 1, &stash);
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): removing %s\n", sfd, stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): removing %s\n", sfd, stash);
if ((devp = find_device(stash))) {
deactivate_device(devp);
free_device(devp);
@@ -798,19 +803,20 @@ static void handle_control(int sfd, char *buf)
/* add device named after + */
(void)snarfline(buf + 1, &stash);
if (find_device(stash)) {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): %s already active \n", sfd,
- stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): %s already active \n", sfd,
+ stash);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): adding %s\n", sfd, stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): adding %s\n", sfd, stash);
if (gpsd_add_device(stash, NOWAIT))
ignore_return(write(sfd, "OK\n", 3));
else {
ignore_return(write(sfd, "ERROR\n", 6));
- gpsd_report(&context.errout, LOG_INF,
- "control(%d): adding %s failed, too many devices active\n", sfd, stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "control(%d): adding %s failed, too many devices active\n",
+ sfd, stash);
}
}
} else if (buf[0] == '!') {
@@ -819,34 +825,35 @@ static void handle_control(int sfd, char *buf)
(void)snarfline(buf + 1, &stash);
eq = strchr(stash, '=');
if (eq == NULL) {
- gpsd_report(&context.errout, LOG_WARN,
- "<= control(%d): ill-formed command \n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): ill-formed command \n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
*eq++ = '\0';
if ((devp = find_device(stash))) {
if (devp->context->readonly || (devp->sourcetype <= source_blockdev)) {
- gpsd_report(&context.errout, LOG_WARN,
- "<= control(%d): attempted to write to a read-only device\n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): attempted to write to a read-only device\n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): writing to %s \n", sfd,
- stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): writing to %s \n", sfd,
+ stash);
if (write(devp->gpsdata.gps_fd, eq, strlen(eq)) <= 0) {
- gpsd_report(&context.errout, LOG_WARN, "<= control(%d): write to device failed\n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): write to device failed\n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
ignore_return(write(sfd, "OK\n", 3));
}
}
} else {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): %s not active \n", sfd,
- stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): %s not active \n", sfd,
+ stash);
ignore_return(write(sfd, "ERROR\n", 6));
}
}
@@ -856,9 +863,9 @@ static void handle_control(int sfd, char *buf)
(void)snarfline(buf + 1, &stash);
eq = strchr(stash, '=');
if (eq == NULL) {
- gpsd_report(&context.errout, LOG_WARN,
- "<= control(%d): ill-formed command\n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): ill-formed command\n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
size_t len;
@@ -866,27 +873,27 @@ static void handle_control(int sfd, char *buf)
len = strlen(eq) + 5;
if ((devp = find_device(stash)) != NULL) {
if (devp->context->readonly || (devp->sourcetype <= source_blockdev)) {
- gpsd_report(&context.errout, LOG_WARN,
- "<= control(%d): attempted to write to a read-only device\n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): attempted to write to a read-only device\n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
int st;
/* NOTE: this destroys the original buffer contents */
st = gpsd_hexpack(eq, eq, len);
if (st <= 0) {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): invalid hex string (error %d).\n",
- sfd, st);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): invalid hex string (error %d).\n",
+ sfd, st);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): writing %d bytes fromhex(%s) to %s\n",
- sfd, st, eq, stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): writing %d bytes fromhex(%s) to %s\n",
+ sfd, st, eq, stash);
if (write(devp->gpsdata.gps_fd, eq, (size_t) st) <= 0) {
- gpsd_report(&context.errout, LOG_WARN,
- "<= control(%d): write to device failed\n",
- sfd);
+ gpsd_log(&context.errout, LOG_WARN,
+ "<= control(%d): write to device failed\n",
+ sfd);
ignore_return(write(sfd, "ERROR\n", 6));
} else {
ignore_return(write(sfd, "OK\n", 3));
@@ -894,9 +901,9 @@ static void handle_control(int sfd, char *buf)
}
}
} else {
- gpsd_report(&context.errout, LOG_INF,
- "<= control(%d): %s not active\n", sfd,
- stash);
+ gpsd_log(&context.errout, LOG_INF,
+ "<= control(%d): %s not active\n", sfd,
+ stash);
ignore_return(write(sfd, "ERROR\n", 6));
}
}
@@ -923,28 +930,28 @@ static bool awaken(struct gps_device_t *device)
/* open that device */
if (!initialized_device(device)) {
if (!open_device(device)) {
- gpsd_report(&context.errout, LOG_WARN,
- "%s: open failed\n",
- device->gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_WARN,
+ "%s: open failed\n",
+ device->gpsdata.dev.path);
free_device(device);
return false;
}
}
if (!BAD_SOCKET(device->gpsdata.gps_fd)) {
- gpsd_report(&context.errout, LOG_PROG,
- "device %d (fd=%d, path %s) already active.\n",
- (int)(device - devices),
- device->gpsdata.gps_fd, device->gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_PROG,
+ "device %d (fd=%d, path %s) already active.\n",
+ (int)(device - devices),
+ device->gpsdata.gps_fd, device->gpsdata.dev.path);
return true;
} else {
if (gpsd_activate(device, O_OPTIMIZE) < 0) {
- gpsd_report(&context.errout, LOG_ERROR,
- "%s: device activation failed.\n",
- device->gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "%s: device activation failed.\n",
+ device->gpsdata.dev.path);
return false;
} else {
- gpsd_report(&context.errout, LOG_RAW,
+ gpsd_log(&context.errout, LOG_RAW,
"flagging descriptor %d in assign_channel()\n",
device->gpsdata.gps_fd);
FD_SET(device->gpsdata.gps_fd, &all_fds);
@@ -995,10 +1002,10 @@ static void set_serial(struct gps_device_t *device,
}
}
- gpsd_report(&context.errout, LOG_PROG,
- "set_serial(%s,%u,%s) %c%d\n",
- device->gpsdata.dev.path,
- (unsigned int)speed, modestring, parity, stopbits);
+ gpsd_log(&context.errout, LOG_PROG,
+ "set_serial(%s,%u,%s) %c%d\n",
+ device->gpsdata.dev.path,
+ (unsigned int)speed, modestring, parity, stopbits);
/* no support for other word sizes yet */
/* *INDENT-OFF* */
if (wordsize == (int)(9 - stopbits)
@@ -1109,7 +1116,7 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Invalid WATCH: %s\"}\r\n",
json_error_string(status));
- gpsd_report(&context.errout, LOG_ERROR, "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR, "response: %s\n", reply);
} else if (sub->policy.watcher) {
if (sub->policy.devpath[0] == '\0') {
/* awaken all devices */
@@ -1127,8 +1134,8 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"No such device as %s\"}\r\n",
sub->policy.devpath);
- gpsd_report(&context.errout, LOG_ERROR,
- "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "response: %s\n", reply);
goto bailout;
} else if (awaken(devp)) {
if (devp->sourcetype == source_gpsd) {
@@ -1139,8 +1146,8 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Can't assign %s\"}\r\n",
sub->policy.devpath);
- gpsd_report(&context.errout, LOG_ERROR,
- "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "response: %s\n", reply);
goto bailout;
}
}
@@ -1175,7 +1182,7 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Invalid DEVICE: \"%s\"}\r\n",
json_error_string(status));
- gpsd_report(&context.errout, LOG_ERROR, "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR, "response: %s\n", reply);
goto bailout;
} else {
if (devconf.path[0] != '\0') {
@@ -1186,8 +1193,8 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Can't open %s.\"}\r\n",
devconf.path);
- gpsd_report(&context.errout, LOG_ERROR,
- "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "response: %s\n", reply);
goto bailout;
}
} else {
@@ -1202,14 +1209,14 @@ static void handle_request(struct subscriber_t *sub,
(void)strlcat(reply,
"{\"class\":\"ERROR\",\"message\":\"Can't perform DEVICE configuration, no devices attached.\"}\r\n",
replylen);
- gpsd_report(&context.errout, LOG_ERROR,
- "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "response: %s\n", reply);
goto bailout;
} else if (devcount > 1) {
str_appendf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"No path specified in DEVICE, but multiple devices are attached.\"}\r\n");
- gpsd_report(&context.errout, LOG_ERROR,
- "response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "response: %s\n", reply);
goto bailout;
}
/* we should have exactly one device now */
@@ -1339,7 +1346,7 @@ static void handle_request(struct subscriber_t *sub,
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Unrecognized request '%.*s'\"}\r\n",
(int)(errend - buf), buf);
- gpsd_report(&context.errout, LOG_ERROR, "ERROR response: %s\n", reply);
+ gpsd_log(&context.errout, LOG_ERROR, "ERROR response: %s\n", reply);
buf += strlen(buf);
}
bailout:
@@ -1401,33 +1408,33 @@ static void pseudonmea_report(struct subscriber_t *sub,
if ((changed & REPORT_IS) != 0) {
nmea_tpv_dump(device, buf, sizeof(buf));
- gpsd_report(&context.errout, LOG_IO,
- "<= GPS (binary tpv) %s: %s\n",
- device->gpsdata.dev.path, buf);
+ gpsd_log(&context.errout, LOG_IO,
+ "<= GPS (binary tpv) %s: %s\n",
+ device->gpsdata.dev.path, buf);
(void)throttled_write(sub, buf, strlen(buf));
}
if ((changed & SATELLITE_SET) != 0) {
nmea_sky_dump(device, buf, sizeof(buf));
- gpsd_report(&context.errout, LOG_IO,
- "<= GPS (binary sky) %s: %s\n",
- device->gpsdata.dev.path, buf);
+ gpsd_log(&context.errout, LOG_IO,
+ "<= GPS (binary sky) %s: %s\n",
+ device->gpsdata.dev.path, buf);
(void)throttled_write(sub, buf, strlen(buf));
}
if ((changed & SUBFRAME_SET) != 0) {
nmea_subframe_dump(device, buf, sizeof(buf));
- gpsd_report(&context.errout, LOG_IO,
- "<= GPS (binary subframe) %s: %s\n",
- device->gpsdata.dev.path, buf);
+ gpsd_log(&context.errout, LOG_IO,
+ "<= GPS (binary subframe) %s: %s\n",
+ device->gpsdata.dev.path, buf);
(void)throttled_write(sub, buf, strlen(buf));
}
#ifdef AIVDM_ENABLE
if ((changed & AIS_SET) != 0) {
nmea_ais_dump(device, buf, sizeof(buf));
- gpsd_report(&context.errout, LOG_IO,
- "<= AIS (binary ais) %s: %s\n",
- device->gpsdata.dev.path, buf);
+ gpsd_log(&context.errout, LOG_IO,
+ "<= AIS (binary ais) %s: %s\n",
+ device->gpsdata.dev.path, buf);
(void)throttled_write(sub, buf, strlen(buf));
}
#endif /* AIVDM_ENABLE */
@@ -1458,9 +1465,9 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
/* handle laggy response to a firmware version query */
if ((changed & (DEVICEID_SET | DRIVER_IS)) != 0) {
if (device->device_type == NULL)
- gpsd_report(&context.errout, LOG_ERROR,
- "internal error - device type of %s not set when expected\n",
- device->gpsdata.dev.path);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "internal error - device type of %s not set when expected\n",
+ device->gpsdata.dev.path);
else
{
char id2[GPS_JSON_RESPONSE_MAX];
@@ -1475,9 +1482,9 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
*/
if ((changed & RTCM2_SET) != 0 || (changed & RTCM3_SET) != 0) {
if (device->lexer.outbuflen > RTCM_MAX) {
- gpsd_report(&context.errout, LOG_ERROR,
- "overlong RTCM packet (%zd bytes)\n",
- device->lexer.outbuflen);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "overlong RTCM packet (%zd bytes)\n",
+ device->lexer.outbuflen);
} else {
struct gps_device_t *dp;
for (dp = devices; dp < devices+MAX_DEVICES; dp++) {
@@ -1487,12 +1494,12 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
if (dp->device_type->rtcm_writer(dp,
(const char *)device->lexer.outbuffer,
device->lexer.outbuflen) == 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "Write to RTCM sink failed\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Write to RTCM sink failed\n");
else {
- gpsd_report(&context.errout, LOG_IO,
- "<= DGPS: %zd bytes of RTCM relayed.\n",
- device->lexer.outbuflen);
+ gpsd_log(&context.errout, LOG_IO,
+ "<= DGPS: %zd bytes of RTCM relayed.\n",
+ device->lexer.outbuflen);
}
}
/* *INDENT-ON* */
@@ -1516,15 +1523,15 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
* Else we may be providing GPS time.
*/
if ((changed & TIME_SET) == 0) {
- //gpsd_report(&context.errout, LOG_PROG, "NTP: No time this packet\n");
+ //gpsd_log(&context.errout, LOG_PROG, "NTP: No time this packet\n");
} else if (isnan(device->newdata.time)) {
- //gpsd_report(&context.errout, LOG_PROG, "NTP: bad new time\n");
+ //gpsd_log(&context.errout, LOG_PROG, "NTP: bad new time\n");
#ifdef PPS_ENABLE
} else if (device->newdata.time == device->pps_thread.fixin_real) {
- //gpsd_report(&context.errout, LOG_PROG, "NTP: Not a new time\n");
+ //gpsd_log(&context.errout, LOG_PROG, "NTP: Not a new time\n");
#endif /* PPS_ENABLE */
} else if (!device->ship_to_ntpd) {
- //gpsd_report(&context.errout, LOG_PROG, "NTP: No precision time report\n");
+ //gpsd_log(&context.errout, LOG_PROG, "NTP: No precision time report\n");
} else {
struct timedelta_t td;
ntp_latch(device, &td);
@@ -1612,13 +1619,13 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
if (changed & DATA_IS) {
/* guard keeps mask dumper from eating CPU */
if (context.errout.debug >= LOG_PROG)
- gpsd_report(&context.errout, LOG_PROG,
- "Changed mask: %s with %sreliable cycle detection\n",
- gps_maskdump(changed),
- device->cycle_end_reliable ? "" : "un");
+ gpsd_log(&context.errout, LOG_PROG,
+ "Changed mask: %s with %sreliable cycle detection\n",
+ gps_maskdump(changed),
+ device->cycle_end_reliable ? "" : "un");
if ((changed & REPORT_IS) != 0)
- gpsd_report(&context.errout, LOG_PROG,
- "time to report a fix\n");
+ gpsd_log(&context.errout, LOG_PROG,
+ "time to report a fix\n");
if (sub->policy.nmea)
pseudonmea_report(sub, changed, device);
@@ -1710,7 +1717,7 @@ static void netgnss_autoconnect(struct gps_context_t *context,
FILE *sfp = fopen(serverlist, "r");
if (sfp == NULL) {
- gpsd_report(&context.errout, LOG_ERROR, "no DGPS server list found.\n");
+ gpsd_log(&context.errout, LOG_ERROR, "no DGPS server list found.\n");
return;
}
@@ -1744,9 +1751,9 @@ static void netgnss_autoconnect(struct gps_context_t *context,
(void)fclose(sfp);
if (keep[0].server[0] == '\0') {
- gpsd_report(&context.errout, LOG_ERROR,
- "no DGPS servers within %dm.\n",
- (int)(DGPS_THRESHOLD / 1000));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "no DGPS servers within %dm.\n",
+ (int)(DGPS_THRESHOLD / 1000));
return;
}
/*@ +usedef @*/
@@ -1755,9 +1762,9 @@ static void netgnss_autoconnect(struct gps_context_t *context,
qsort((void *)keep, SERVER_SAMPLE, sizeof(struct dgps_server_t), srvcmp);
for (sp = keep; sp < keep + SERVER_SAMPLE; sp++) {
if (sp->server[0] != '\0') {
- gpsd_report(&context.errout, LOG_INF,
- "%s is %dkm away.\n", sp->server,
- (int)(sp->dist / 1000));
+ gpsd_log(&context.errout, LOG_INF,
+ "%s is %dkm away.\n", sp->server,
+ (int)(sp->dist / 1000));
if (dgpsip_open(context, sp->server) >= 0)
break;
}
@@ -1874,8 +1881,8 @@ int main(int argc, char *argv[])
/* sanity check */
if (argc - optind > MAX_DEVICES) {
- gpsd_report(&context.errout, LOG_ERROR,
- "too many devices on command line\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "too many devices on command line\n");
exit(1);
}
@@ -1886,8 +1893,8 @@ int main(int argc, char *argv[])
#if defined(SYSTEMD_ENABLE) && defined(CONTROL_SOCKET_ENABLE)
sd_socket_count = sd_get_socket_count();
if (sd_socket_count > 0 && control_socket != NULL) {
- gpsd_report(&context.errout, LOG_WARN,
- "control socket passed on command line ignored\n");
+ gpsd_log(&context.errout, LOG_WARN,
+ "control socket passed on command line ignored\n");
control_socket = NULL;
}
#endif
@@ -1904,8 +1911,8 @@ int main(int argc, char *argv[])
sd_socket_count <= 0
#endif
&& optind >= argc) {
- gpsd_report(&context.errout, LOG_ERROR,
- "can't run with neither control socket nor devices\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't run with neither control socket nor devices\n");
exit(EXIT_FAILURE);
}
@@ -1925,25 +1932,25 @@ int main(int argc, char *argv[])
if (control_socket) {
(void)unlink(control_socket);
if (BAD_SOCKET(csock = filesock(control_socket))) {
- gpsd_report(&context.errout, LOG_ERROR,
- "control socket create failed, netlib error %d\n",
- csock);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "control socket create failed, netlib error %d\n",
+ csock);
exit(EXIT_FAILURE);
} else
- gpsd_report(&context.errout, LOG_SPIN,
- "control socket %s is fd %d\n",
- control_socket, csock);
+ gpsd_log(&context.errout, LOG_SPIN,
+ "control socket %s is fd %d\n",
+ control_socket, csock);
FD_SET(csock, &all_fds);
adjust_max_fd(csock, true);
- gpsd_report(&context.errout, LOG_PROG,
- "control socket opened at %s\n",
- control_socket);
+ gpsd_log(&context.errout, LOG_PROG,
+ "control socket opened at %s\n",
+ control_socket);
}
#endif /* CONTROL_SOCKET_ENABLE */
#else
if (optind >= argc) {
- gpsd_report(&context.errout, LOG_ERROR,
- "can't run with no devices specified\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "can't run with no devices specified\n");
exit(EXIT_FAILURE);
}
#endif /* defined(CONTROL_SOCKET_ENABLE) || defined(SYSTEMD_ENABLE) */
@@ -1954,8 +1961,8 @@ int main(int argc, char *argv[])
if (go_background) {
/* not SuS/POSIX portable, but we have our own fallback version */
if (daemon(0, 0) != 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "demonization failed: %s\n",strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "demonization failed: %s\n",strerror(errno));
}
/*@+unrecog@*/
@@ -1966,13 +1973,13 @@ int main(int argc, char *argv[])
(void)fprintf(fp, "%u\n", (unsigned int)getpid());
(void)fclose(fp);
} else {
- gpsd_report(&context.errout, LOG_ERROR,
- "Cannot create PID file: %s.\n", pid_file);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Cannot create PID file: %s.\n", pid_file);
}
}
openlog("gpsd", LOG_PID, LOG_USER);
- gpsd_report(&context.errout, LOG_INF, "launching (Version %s)\n", VERSION);
+ gpsd_log(&context.errout, LOG_INF, "launching (Version %s)\n", VERSION);
#ifdef SOCKET_EXPORT_ENABLE
/*@ -observertrans @*/
@@ -1981,12 +1988,12 @@ int main(int argc, char *argv[])
getservbyname("gpsd", "tcp") ? "gpsd" : DEFAULT_GPSD_PORT;
/*@ +observertrans @*/
if (passivesocks(gpsd_service, "tcp", QLEN, msocks) < 1) {
- gpsd_report(&context.errout, LOG_ERR,
- "command sockets creation failed, netlib errors %d, %d\n",
- msocks[0], msocks[1]);
+ gpsd_log(&context.errout, LOG_ERR,
+ "command sockets creation failed, netlib errors %d, %d\n",
+ msocks[0], msocks[1]);
exit(EXIT_FAILURE);
}
- gpsd_report(&context.errout, LOG_INF, "listening on port %s\n", gpsd_service);
+ gpsd_log(&context.errout, LOG_INF, "listening on port %s\n", gpsd_service);
#endif /* SOCKET_EXPORT_ENABLE */
#ifdef NTPSHM_ENABLE
@@ -1995,7 +2002,8 @@ int main(int argc, char *argv[])
// nice() can ONLY succeed when run as root!
// do not even bother as non-root
if (nice(NICEVAL) == -1 && errno != 0)
- gpsd_report(&context.errout, LOG_INF, "NTPD Priority setting failed.\n");
+ gpsd_log(&context.errout, LOG_INF,
+ "NTPD o=priority setting failed.\n");
}
/*
* By initializing before we drop privileges, we guarantee that even
@@ -2009,11 +2017,11 @@ int main(int argc, char *argv[])
/* we need to connect to dbus as root */
if (initialize_dbus_connection()) {
/* the connection could not be started */
- gpsd_report(&context.errout, LOG_ERROR,
- "unable to connect to the DBUS system bus\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "unable to connect to the DBUS system bus\n");
} else
- gpsd_report(&context.errout, LOG_PROG,
- "successfully connected to the DBUS system bus\n");
+ gpsd_log(&context.errout, LOG_PROG,
+ "successfully connected to the DBUS system bus\n");
#endif /* defined(DBUS_EXPORT_ENABLE) && !defined(S_SPLINT_S) */
#ifdef SHM_EXPORT_ENABLE
@@ -2029,9 +2037,9 @@ int main(int argc, char *argv[])
in_restart = false;
for (i = optind; i < argc; i++) {
if (!gpsd_add_device(argv[i], NOWAIT)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "initial GPS device %s open failed\n",
- argv[i]);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "initial GPS device %s open failed\n",
+ argv[i]);
}
}
@@ -2055,9 +2063,9 @@ int main(int argc, char *argv[])
*/
/*@-nullpass@*/
if (setgroups(0, NULL) != 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "setgroups() failed, errno %s\n",
- strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "setgroups() failed, errno %s\n",
+ strerror(errno));
/*@+nullpass@*/
/*@-type@*/
#ifdef GPSD_GROUP
@@ -2065,33 +2073,33 @@ int main(int argc, char *argv[])
struct group *grp = getgrnam(GPSD_GROUP);
if (grp)
if (setgid(grp->gr_gid) != 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "setgid() failed, errno %s\n",
- strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "setgid() failed, errno %s\n",
+ strerror(errno));
}
#else
if ((optind < argc && stat(argv[optind], &stb) == 0)
|| stat(PROTO_TTY, &stb) == 0) {
- gpsd_report(&context.errout, LOG_PROG,
- "changing to group %d\n", stb.st_gid);
+ gpsd_log(&context.errout, LOG_PROG,
+ "changing to group %d\n", stb.st_gid);
if (setgid(stb.st_gid) != 0)
- gpsd_report(&context.errout, LOG_ERROR,
- "setgid() failed, errno %s\n",
- strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "setgid() failed, errno %s\n",
+ strerror(errno));
}
#endif
pw = getpwnam(GPSD_USER);
if (pw)
if (setuid(pw->pw_uid) != 0)
- gpsd_report(&context.errout, LOG_ERROR,
+ gpsd_log(&context.errout, LOG_ERROR,
"setuid() failed, errno %s\n",
strerror(errno));
/*@+type@*/
}
- gpsd_report(&context.errout, LOG_INF,
- "running with effective group ID %d\n", getegid());
- gpsd_report(&context.errout, LOG_INF,
- "running with effective user ID %d\n", geteuid());
+ gpsd_log(&context.errout, LOG_INF,
+ "running with effective group ID %d\n", getegid());
+ gpsd_log(&context.errout, LOG_INF,
+ "running with effective user ID %d\n", geteuid());
#ifdef SOCKET_EXPORT_ENABLE
for (i = 0; i < NITEMS(subscribers); i++) {
@@ -2129,7 +2137,7 @@ int main(int argc, char *argv[])
if (setjmp(restartbuf) > 0) {
gpsd_terminate(&context);
in_restart = true;
- gpsd_report(&context.errout, LOG_WARN, "gpsd restarted by SIGHUP\n");
+ gpsd_log(&context.errout, LOG_WARN, "gpsd restarted by SIGHUP\n");
}
signalled = 0;
@@ -2154,9 +2162,9 @@ int main(int argc, char *argv[])
if (in_restart)
for (i = optind; i < argc; i++) {
if (!gpsd_add_device(argv[i], NOWAIT)) {
- gpsd_report(&context.errout, LOG_ERROR,
- "GPS device %s open failed\n",
- argv[i]);
+ gpsd_log(&context.errout, LOG_ERROR,
+ "GPS device %s open failed\n",
+ argv[i]);
}
}
@@ -2189,8 +2197,8 @@ int main(int argc, char *argv[])
/*@+matchanyintegral@*/
if (BAD_SOCKET(ssock))
- gpsd_report(&context.errout, LOG_ERROR,
- "accept: %s\n", strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "accept: %s\n", strerror(errno));
else {
struct subscriber_t *client = NULL;
int opts = fcntl(ssock, F_GETFL);
@@ -2203,17 +2211,17 @@ int main(int argc, char *argv[])
c_ip = netlib_sock2ip(ssock);
client = allocate_client();
if (client == NULL) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Client %s connect on fd %d -"
- "no subscriber slots available\n", c_ip,
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Client %s connect on fd %d -"
+ "no subscriber slots available\n", c_ip,
ssock);
(void)close(ssock);
} else
if (setsockopt
(ssock, SOL_SOCKET, SO_LINGER, (char *)&linger,
(int)sizeof(struct linger)) == -1) {
- gpsd_report(&context.errout, LOG_ERROR,
- "Error: SETSOCKOPT SO_LINGER\n");
+ gpsd_log(&context.errout, LOG_ERROR,
+ "Error: SETSOCKOPT SO_LINGER\n");
(void)close(ssock);
} else {
char announce[GPS_JSON_RESPONSE_MAX];
@@ -2221,9 +2229,9 @@ int main(int argc, char *argv[])
adjust_max_fd(ssock, true);
client->fd = ssock;
client->active = timestamp();
- gpsd_report(&context.errout, LOG_SPIN,
- "client %s (%d) connect on fd %d\n", c_ip,
- sub_index(client), ssock);
+ gpsd_log(&context.errout, LOG_SPIN,
+ "client %s (%d) connect on fd %d\n", c_ip,
+ sub_index(client), ssock);
json_version_dump(announce, sizeof(announce));
(void)throttled_write(client, announce,
strlen(announce));
@@ -2243,12 +2251,12 @@ int main(int argc, char *argv[])
/*@-matchanyintegral@*/
if (BAD_SOCKET(ssock))
- gpsd_report(&context.errout, LOG_ERROR,
- "accept: %s\n", strerror(errno));
+ gpsd_log(&context.errout, LOG_ERROR,
+ "accept: %s\n", strerror(errno));
else {
- gpsd_report(&context.errout, LOG_INF,
- "control socket connect on fd %d\n",
- ssock);
+ gpsd_log(&context.errout, LOG_INF,
+ "control socket connect on fd %d\n",
+ ssock);
FD_SET(ssock, &all_fds);
FD_SET(ssock, &control_fds);
adjust_max_fd(ssock, true);
@@ -2264,13 +2272,13 @@ int main(int argc, char *argv[])
while ((rd = read(cfd, buf, sizeof(buf) - 1)) > 0) {
buf[rd] = '\0';
- gpsd_report(&context.errout, LOG_CLIENT,
- "<= control(%d): %s\n", cfd, buf);
+ gpsd_log(&context.errout, LOG_CLIENT,
+ "<= control(%d): %s\n", cfd, buf);
/* coverity[tainted_data] Safe, never handed to exec */
handle_control(cfd, buf);
}
- gpsd_report(&context.errout, LOG_SPIN,
- "close(%d) of control socket\n", cfd);
+ gpsd_log(&context.errout, LOG_SPIN,
+ "close(%d) of control socket\n", cfd);
(void)close(cfd);
FD_CLR(cfd, &all_fds);
FD_CLR(cfd, &control_fds);
@@ -2327,9 +2335,9 @@ int main(int argc, char *argv[])
unlock_subscriber(sub);
- gpsd_report(&context.errout, LOG_PROG,
- "checking client(%d)\n",
- sub_index(sub));
+ gpsd_log(&context.errout, LOG_PROG,
+ "checking client(%d)\n",
+ sub_index(sub));
if ((buflen =
(int)recv(sub->fd, buf, sizeof(buf) - 1, 0)) <= 0) {
detach_client(sub);
@@ -2337,8 +2345,8 @@ int main(int argc, char *argv[])
if (buf[buflen - 1] != '\n')
buf[buflen++] = '\n';
buf[buflen] = '\0';
- gpsd_report(&context.errout, LOG_CLIENT,
- "<= client(%d): %s\n", sub_index(sub), buf);
+ gpsd_log(&context.errout, LOG_CLIENT,
+ "<= client(%d): %s\n", sub_index(sub), buf);
/*
* When a command comes in, update subscriber.active to
@@ -2355,9 +2363,9 @@ int main(int argc, char *argv[])
if (!sub->policy.watcher
&& timestamp() - sub->active > COMMAND_TIMEOUT) {
- gpsd_report(&context.errout, LOG_WARN,
- "client(%d) timed out on command wait.\n",
- sub_index(sub));
+ gpsd_log(&context.errout, LOG_WARN,
+ "client(%d) timed out on command wait.\n",
+ sub_index(sub));
detach_client(sub);
}
}
@@ -2391,18 +2399,18 @@ int main(int argc, char *argv[])
device->lexer.type != BAD_PACKET) {
if (device->releasetime == 0) {
device->releasetime = timestamp();
- gpsd_report(&context.errout, LOG_PROG,
- "device %d (fd %d) released\n",
- (int)(device - devices),
- device->gpsdata.gps_fd);
+ gpsd_log(&context.errout, LOG_PROG,
+ "device %d (fd %d) released\n",
+ (int)(device - devices),
+ device->gpsdata.gps_fd);
} else if (timestamp() - device->releasetime >
RELEASE_TIMEOUT) {
- gpsd_report(&context.errout, LOG_PROG,
- "device %d closed\n",
- (int)(device - devices));
- gpsd_report(&context.errout, LOG_RAW,
- "unflagging descriptor %d\n",
- device->gpsdata.gps_fd);
+ gpsd_log(&context.errout, LOG_PROG,
+ "device %d closed\n",
+ (int)(device - devices));
+ gpsd_log(&context.errout, LOG_RAW,
+ "unflagging descriptor %d\n",
+ device->gpsdata.gps_fd);
deactivate_device(device);
}
}
@@ -2411,9 +2419,9 @@ int main(int argc, char *argv[])
(device->opentime == 0 ||
timestamp() - device->opentime > DEVICE_RECONNECT)) {
device->opentime = timestamp();
- gpsd_report(&context.errout, LOG_INF,
- "reconnection attempt on device %d\n",
- (int)(device - devices));
+ gpsd_log(&context.errout, LOG_INF,
+ "reconnection attempt on device %d\n",
+ (int)(device - devices));
(void)awaken(device);
}
}
@@ -2441,8 +2449,8 @@ int main(int argc, char *argv[])
if (allocated_device(device))
++devcount;
if (subcount == 0 && devcount == 0) {
- gpsd_report(&context.errout, LOG_SHOUT,
- "no subscribers or devices, shutting down.\n");
+ gpsd_log(&context.errout, LOG_SHOUT,
+ "no subscribers or devices, shutting down.\n");
goto shutdown;
}
}
@@ -2453,12 +2461,12 @@ int main(int argc, char *argv[])
if (SIGHUP == (int)signalled)
longjmp(restartbuf, 1);
- gpsd_report(&context.errout, LOG_WARN,
- "received terminating signal %d.\n", signalled);
+ gpsd_log(&context.errout, LOG_WARN,
+ "received terminating signal %d.\n", signalled);
shutdown:
gpsd_terminate(&context);
- gpsd_report(&context.errout, LOG_WARN, "exiting.\n");
+ gpsd_log(&context.errout, LOG_WARN, "exiting.\n");
#ifdef SOCKET_EXPORT_ENABLE
/*
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 5d2ce0f0..904a890f 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -1082,7 +1082,7 @@ extern void libgps_dump_state(struct gps_data_t *);
void gpsd_labeled_report(const int, const int,
const char *, const char *, va_list);
-PRINTF_FUNC(3, 4) void gpsd_report(const struct gpsd_errout_t *, const int, const char *, ...);
+PRINTF_FUNC(3, 4) void gpsd_log(const struct gpsd_errout_t *, const int, const char *, ...);
#ifdef S_SPLINT_S
extern struct protoent *getprotobyname(const char *);
diff --git a/gpspacket.c b/gpspacket.c
index 0f4311a0..d8b36685 100644
--- a/gpspacket.c
+++ b/gpspacket.c
@@ -25,8 +25,8 @@ void errout_reset(struct gpsd_errout_t *errout)
errout->report = basic_report;
}
-void gpsd_report(const struct gpsd_errout_t *errout UNUSED,
- int errlevel, const char *fmt, ... )
+void gpsd_log(const struct gpsd_errout_t *errout UNUSED,
+ int errlevel, const char *fmt, ... )
{
char buf[BUFSIZ];
PyObject *args;
diff --git a/isgps.c b/isgps.c
index dcec5d0c..2d9438b7 100644
--- a/isgps.c
+++ b/isgps.c
@@ -141,7 +141,7 @@ unsigned int isgps_parity(isgps30bits_t th)
/*@ -charint @*/
#ifdef __UNUSED__
- gpsd_report(errout, ISGPS_ERRLEVEL_BASE + 2, "ISGPS parity %u\n", p);
+ gpsd_log(errout, ISGPS_ERRLEVEL_BASE + 2, "ISGPS parity %u\n", p);
#endif /* __UNUSED__ */
return (p);
}
@@ -186,8 +186,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
{
/* ASCII characters 64-127, @ through DEL */
if ((c & MAG_TAG_MASK) != MAG_TAG_DATA) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS word tag not correct, skipping byte\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS word tag not correct, skipping byte\n");
return ISGPS_SKIP;
}
@@ -206,19 +206,19 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
lexer->isgps.curr_word |=
c >> -(lexer->isgps.curr_offset);
}
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS syncing at byte %lu: 0x%08x\n",
- lexer->char_counter, lexer->isgps.curr_word);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS syncing at byte %lu: 0x%08x\n",
+ lexer->char_counter, lexer->isgps.curr_word);
if (preamble_match(&lexer->isgps.curr_word)) {
if (isgps_parityok(lexer->isgps.curr_word)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS preamble ok, parity ok -- locked\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS preamble ok, parity ok -- locked\n");
lexer->isgps.locked = true;
break;
}
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS preamble ok, parity fail\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS preamble ok, parity fail\n");
}
lexer->isgps.curr_offset++;
} /* end while */
@@ -246,16 +246,16 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
* another preamble pattern in the data stream. -wsr
*/
if (preamble_match(&lexer->isgps.curr_word)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS preamble spotted (index: %u)\n",
- lexer->isgps.bufindex);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS preamble spotted (index: %u)\n",
+ lexer->isgps.bufindex);
lexer->isgps.bufindex = 0;
}
#endif
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS processing word %u (offset %d)\n",
- lexer->isgps.bufindex,
- lexer->isgps.curr_offset);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS processing word %u (offset %d)\n",
+ lexer->isgps.bufindex,
+ lexer->isgps.curr_offset);
{
/*
* Guard against a buffer overflow attack. Just wait for
@@ -263,8 +263,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
*/
if (lexer->isgps.bufindex >= (unsigned)maxlen) {
lexer->isgps.bufindex = 0;
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS buffer overflowing -- resetting\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS buffer overflowing -- resetting\n");
return ISGPS_NO_SYNC;
}
@@ -274,8 +274,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
/* *INDENT-OFF* */
if ((lexer->isgps.bufindex == 0) &&
!preamble_match((isgps30bits_t *) lexer->isgps.buf)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS word 0 not a preamble- punting\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS word 0 not a preamble- punting\n");
return ISGPS_NO_SYNC;
}
/* *INDENT-ON* */
@@ -298,22 +298,22 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
c >> -(lexer->isgps.curr_offset);
}
} else {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 0,
- "ISGPS parity failure, lost lock\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 0,
+ "ISGPS parity failure, lost lock\n");
lexer->isgps.locked = false;
}
}
lexer->isgps.curr_offset -= 6;
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS residual %d\n",
- lexer->isgps.curr_offset);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS residual %d\n",
+ lexer->isgps.curr_offset);
return res;
}
/*@ +shiftnegative @*/
/* never achieved lock */
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS lock never achieved\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS lock never achieved\n");
return ISGPS_NO_SYNC;
}
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 1c3c91ca..50887d0e 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -114,7 +114,7 @@ static void visibilize(/*@out@*/char *outbuf, size_t outlen,
#endif /* !SQUELCH_ENABLE */
-static void gpsd_vreport(const struct gpsd_errout_t *errout,
+static void gpsd_vlog(const struct gpsd_errout_t *errout,
const int errlevel,
char *outbuf, size_t outlen,
const char *fmt, va_list ap)
@@ -188,7 +188,7 @@ static void gpsd_vreport(const struct gpsd_errout_t *errout,
#endif /* !SQUELCH_ENABLE */
}
-void gpsd_report(const struct gpsd_errout_t *errout,
+void gpsd_log(const struct gpsd_errout_t *errout,
const int errlevel,
const char *fmt, ...)
/* assemble msg in printf(3) style, use errout hook or syslog for delivery */
@@ -198,7 +198,7 @@ void gpsd_report(const struct gpsd_errout_t *errout,
buf[0] = '\0';
va_start(ap, fmt);
- gpsd_vreport(errout, errlevel, buf, sizeof(buf), fmt, ap);
+ gpsd_vlog(errout, errlevel, buf, sizeof(buf), fmt, ap);
va_end(ap);
}
@@ -216,9 +216,9 @@ static void gpsd_run_device_hook(struct gpsd_errout_t *errout,
{
struct stat statbuf;
if (stat(DEVICEHOOKPATH, &statbuf) == -1)
- gpsd_report(errout, LOG_PROG,
- "no %s present, skipped running %s hook\n",
- DEVICEHOOKPATH, hook);
+ gpsd_log(errout, LOG_PROG,
+ "no %s present, skipped running %s hook\n",
+ DEVICEHOOKPATH, hook);
else {
/*
* We make an exception to the no-malloc rule here because
@@ -228,21 +228,21 @@ static void gpsd_run_device_hook(struct gpsd_errout_t *errout,
size_t bufsize = strlen(DEVICEHOOKPATH) + 1 + strlen(device_name) + 1 + strlen(hook) + 1;
char *buf = malloc(bufsize);
if (buf == NULL)
- gpsd_report(errout, LOG_ERROR,
- "error allocating run-hook buffer\n");
+ gpsd_log(errout, LOG_ERROR,
+ "error allocating run-hook buffer\n");
else
{
int status;
(void)snprintf(buf, bufsize, "%s %s %s",
DEVICEHOOKPATH, device_name, hook);
- gpsd_report(errout, LOG_INF, "running %s\n", buf);
+ gpsd_log(errout, LOG_INF, "running %s\n", buf);
status = system(buf);
if (status == -1)
- gpsd_report(errout, LOG_ERROR, "error running %s\n", buf);
+ gpsd_log(errout, LOG_ERROR, "error running %s\n", buf);
else
- gpsd_report(errout, LOG_INF,
- "%s returned %d\n", DEVICEHOOKPATH,
- WEXITSTATUS(status));
+ gpsd_log(errout, LOG_INF,
+ "%s returned %d\n", DEVICEHOOKPATH,
+ WEXITSTATUS(status));
free(buf);
}
}
@@ -259,14 +259,14 @@ int gpsd_switch_driver(struct gps_device_t *session, char *type_name)
if (first_sync && strcmp(session->device_type->type_name, type_name) == 0)
return 0;
- gpsd_report(&session->context->errout, LOG_PROG,
- "switch_driver(%s) called...\n", type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "switch_driver(%s) called...\n", type_name);
/*@ -compmempass @*/
for (dp = gpsd_drivers, i = 0; *dp; dp++, i++)
if (strcmp((*dp)->type_name, type_name) == 0) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "selecting %s driver...\n",
- (*dp)->type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "selecting %s driver...\n",
+ (*dp)->type_name);
gpsd_assert_sync(session);
/*@i@*/ session->device_type = *dp;
session->driver_index = i;
@@ -283,7 +283,8 @@ int gpsd_switch_driver(struct gps_device_t *session, char *type_name)
#endif /* RECONFIGURE_ENABLE */
return 1;
}
- gpsd_report(&session->context->errout, LOG_ERROR, "invalid GPS type \"%s\".\n", type_name);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "invalid GPS type \"%s\".\n", type_name);
return 0;
/*@ +compmempass @*/
/*@+mustfreeonly@*/
@@ -371,8 +372,9 @@ void gpsd_deactivate(struct gps_device_t *session)
session->device_type->mode_switcher(session, 0);
}
#endif /* RECONFIGURE_ENABLE */
- gpsd_report(&session->context->errout, LOG_INF, "closing GPS=%s (%d)\n",
- session->gpsdata.dev.path, session->gpsdata.gps_fd);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "closing GPS=%s (%d)\n",
+ session->gpsdata.dev.path, session->gpsdata.gps_fd);
#if defined(NMEA2000_ENABLE)
if (session->sourcetype == source_can)
(void)nmea2000_close(session);
@@ -429,9 +431,9 @@ int gpsd_open(struct gps_device_t *session)
session->gpsdata.gps_fd = netgnss_uri_open(session,
session->gpsdata.dev.path);
session->sourcetype = source_tcp;
- gpsd_report(&session->context->errout, LOG_SPIN,
- "netgnss_uri_open(%s) returns socket on fd %d\n",
- session->gpsdata.dev.path, session->gpsdata.gps_fd);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "netgnss_uri_open(%s) returns socket on fd %d\n",
+ session->gpsdata.dev.path, session->gpsdata.gps_fd);
return session->gpsdata.gps_fd;
/* otherwise, could be an TCP data feed */
} else if (str_starts_with(session->gpsdata.dev.path, "tcp://")) {
@@ -441,22 +443,22 @@ int gpsd_open(struct gps_device_t *session)
INVALIDATE_SOCKET(session->gpsdata.gps_fd);
port = strchr(server, ':');
if (port == NULL) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Missing colon in TCP feed spec.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Missing colon in TCP feed spec.\n");
return -1;
}
*port++ = '\0';
- gpsd_report(&session->context->errout, LOG_INF,
- "opening TCP feed at %s, port %s.\n", server,
- port);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "opening TCP feed at %s, port %s.\n", server,
+ port);
if ((dsock = netlib_connectsock(AF_UNSPEC, server, port, "tcp")) < 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "TCP device open error %s.\n",
- netlib_errstr(dsock));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "TCP device open error %s.\n",
+ netlib_errstr(dsock));
return -1;
} else
- gpsd_report(&session->context->errout, LOG_SPIN,
- "TCP device opened on fd %d\n", dsock);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "TCP device opened on fd %d\n", dsock);
session->gpsdata.gps_fd = dsock;
session->sourcetype = source_tcp;
return session->gpsdata.gps_fd;
@@ -468,22 +470,22 @@ int gpsd_open(struct gps_device_t *session)
INVALIDATE_SOCKET(session->gpsdata.gps_fd);
port = strchr(server, ':');
if (port == NULL) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "Missing colon in UDP feed spec.\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "Missing colon in UDP feed spec.\n");
return -1;
}
*port++ = '\0';
- gpsd_report(&session->context->errout, LOG_INF,
- "opening UDP feed at %s, port %s.\n", server,
- port);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "opening UDP feed at %s, port %s.\n", server,
+ port);
if ((dsock = netlib_connectsock(AF_UNSPEC, server, port, "udp")) < 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "UDP device open error %s.\n",
- netlib_errstr(dsock));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "UDP device open error %s.\n",
+ netlib_errstr(dsock));
return -1;
} else
- gpsd_report(&session->context->errout, LOG_SPIN,
- "UDP device opened on fd %d\n", dsock);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "UDP device opened on fd %d\n", dsock);
session->gpsdata.gps_fd = dsock;
session->sourcetype = source_udp;
return session->gpsdata.gps_fd;
@@ -500,17 +502,17 @@ int gpsd_open(struct gps_device_t *session)
port = DEFAULT_GPSD_PORT;
} else
*port++ = '\0';
- gpsd_report(&session->context->errout, LOG_INF,
- "opening remote gpsd feed at %s, port %s.\n",
- server, port);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "opening remote gpsd feed at %s, port %s.\n",
+ server, port);
if ((dsock = netlib_connectsock(AF_UNSPEC, server, port, "tcp")) < 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "remote gpsd device open error %s.\n",
- netlib_errstr(dsock));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "remote gpsd device open error %s.\n",
+ netlib_errstr(dsock));
return -1;
} else
- gpsd_report(&session->context->errout, LOG_SPIN,
- "remote gpsd feed opened on fd %d\n", dsock);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "remote gpsd feed opened on fd %d\n", dsock);
/*@+branchstate +nullpass@*/
/* watch to remote is issued when WATCH is */
session->gpsdata.gps_fd = dsock;
@@ -551,34 +553,34 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
/*@ -mustfreeonly @*/
for (dp = gpsd_drivers; *dp; dp++) {
if ((*dp)->probe_detect != NULL) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Probing \"%s\" driver...\n",
- (*dp)->type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Probing \"%s\" driver...\n",
+ (*dp)->type_name);
/* toss stale data */
(void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH);
if ((*dp)->probe_detect(session) != 0) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "Probe found \"%s\" driver...\n",
- (*dp)->type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Probe found \"%s\" driver...\n",
+ (*dp)->type_name);
session->device_type = *dp;
gpsd_assert_sync(session);
goto foundit;
} else
- gpsd_report(&session->context->errout, LOG_PROG,
- "Probe not found \"%s\" driver...\n",
- (*dp)->type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "Probe not found \"%s\" driver...\n",
+ (*dp)->type_name);
}
}
/*@ +mustfreeonly @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "no probe matched...\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "no probe matched...\n");
}
foundit:
#endif /* NON_NMEA_ENABLE */
gpsd_clear(session);
- gpsd_report(&session->context->errout, LOG_INF,
- "gpsd_activate(%d): activated GPS (fd %d)\n",
- session->mode, session->gpsdata.gps_fd);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "gpsd_activate(%d): activated GPS (fd %d)\n",
+ session->mode, session->gpsdata.gps_fd);
/*
* We might know the device's type, but we shouldn't assume it has
* retained its settings. A revert hook might well have undone
@@ -696,7 +698,7 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
memset(satpos, 0, sizeof(satpos));
- gpsd_report(errout, LOG_INF, "Sats used (%d):\n", gpsdata->satellites_used);
+ gpsd_log(errout, LOG_INF, "Sats used (%d):\n", gpsdata->satellites_used);
for (n = k = 0; k < gpsdata->satellites_visible; k++) {
if (gpsdata->skyview[k].used && !SBAS_PRN(gpsdata->skyview[k].PRN))
{
@@ -707,11 +709,11 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
* cos(sp->elevation * DEG_2_RAD);
satpos[n][2] = sin(sp->elevation * DEG_2_RAD);
satpos[n][3] = 1;
- gpsd_report(errout, LOG_INF, "PRN=%3d az=%3d el=%2d (%f, %f, %f)\n",
- gpsdata->skyview[k].PRN,
- gpsdata->skyview[k].azimuth,
- gpsdata->skyview[k].elevation,
- satpos[n][0], satpos[n][1], satpos[n][2]);
+ gpsd_log(errout, LOG_INF, "PRN=%3d az=%3d el=%2d (%f, %f, %f)\n",
+ gpsdata->skyview[k].PRN,
+ gpsdata->skyview[k].azimuth,
+ gpsdata->skyview[k].elevation,
+ satpos[n][0], satpos[n][1], satpos[n][2]);
n++;
}
}
@@ -719,9 +721,9 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
/* If we don't have 4 satellites then we don't have enough information to calculate DOPS */
if (n < 4) {
#ifdef __UNUSED__
- gpsd_report(errout, LOG_DATA + 2,
- "Not enough satellites available %d < 4:\n",
- n);
+ gpsd_log(errout, LOG_DATA + 2,
+ "Not enough satellites available %d < 4:\n",
+ n);
#endif /* __UNUSED__ */
return 0; /* Is this correct return code here? or should it be ERROR_SET */
}
@@ -730,10 +732,10 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
memset(inv, 0, sizeof(inv));
#ifdef __UNUSED__
- gpsd_report(errout, LOG_INF, "Line-of-sight matrix:\n");
+ gpsd_log(errout, LOG_INF, "Line-of-sight matrix:\n");
for (k = 0; k < n; k++) {
- gpsd_report(errout, LOG_INF, "%f %f %f %f\n",
- satpos[k][0], satpos[k][1], satpos[k][2], satpos[k][3]);
+ gpsd_log(errout, LOG_INF, "%f %f %f %f\n",
+ satpos[k][0], satpos[k][1], satpos[k][2], satpos[k][3]);
}
#endif /* __UNUSED__ */
@@ -747,10 +749,10 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
}
#ifdef __UNUSED__
- gpsd_report(errout, LOG_INF, "product:\n");
+ gpsd_log(errout, LOG_INF, "product:\n");
for (k = 0; k < 4; k++) {
- gpsd_report(errout, LOG_INF, "%f %f %f %f\n",
- prod[k][0], prod[k][1], prod[k][2], prod[k][3]);
+ gpsd_log(errout, LOG_INF, "%f %f %f %f\n",
+ prod[k][0], prod[k][1], prod[k][2], prod[k][3]);
}
#endif /* __UNUSED__ */
@@ -760,18 +762,18 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
* Note: this will print garbage unless all the subdeterminants
* are computed in the invert() function.
*/
- gpsd_report(errout, LOG_RAW, "inverse:\n");
+ gpsd_log(errout, LOG_RAW, "inverse:\n");
for (k = 0; k < 4; k++) {
- gpsd_report(errout, LOG_RAW,
- "%f %f %f %f\n",
- inv[k][0], inv[k][1], inv[k][2], inv[k][3]);
+ gpsd_log(errout, LOG_RAW,
+ "%f %f %f %f\n",
+ inv[k][0], inv[k][1], inv[k][2], inv[k][3]);
}
#endif /* __UNUSED__ */
} else {
#ifndef USE_QT
- gpsd_report(errout, LOG_DATA,
- "LOS matrix is singular, can't calculate DOPs - source '%s'\n",
- gpsdata->dev.path);
+ gpsd_log(errout, LOG_DATA,
+ "LOS matrix is singular, can't calculate DOPs - source '%s'\n",
+ gpsdata->dev.path);
#endif
return 0;
}
@@ -785,10 +787,11 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout,
gdop = sqrt(inv[0][0] + inv[1][1] + inv[2][2] + inv[3][3]);
#ifndef USE_QT
- gpsd_report(errout, LOG_DATA,
- "DOPS computed/reported: X=%f/%f, Y=%f/%f, H=%f/%f, V=%f/%f, P=%f/%f, T=%f/%f, G=%f/%f\n",
- xdop, dop->xdop, ydop, dop->ydop, hdop, dop->hdop, vdop,
- dop->vdop, pdop, dop->pdop, tdop, dop->tdop, gdop, dop->gdop);
+ gpsd_log(errout, LOG_DATA,
+ "DOPS computed/reported: X=%f/%f, Y=%f/%f, H=%f/%f, V=%f/%f, "
+ "P=%f/%f, T=%f/%f, G=%f/%f\n",
+ xdop, dop->xdop, ydop, dop->ydop, hdop, dop->hdop, vdop,
+ dop->vdop, pdop, dop->pdop, tdop, dop->tdop, gdop, dop->gdop);
#endif
/*@ -usedef @*/
@@ -984,7 +987,7 @@ int gpsd_await_data(/*@out@*/fd_set *rfds,
FD_ZERO(efds);
(void)memcpy((char *)rfds, (char *)all_fds, sizeof(fd_set));
- gpsd_report(errout, LOG_RAW + 2, "select waits\n");
+ gpsd_log(errout, LOG_RAW + 2, "select waits\n");
/*
* Poll for user commands or GPS data. The timeout doesn't
* actually matter here since select returns whenever one of
@@ -1017,7 +1020,7 @@ int gpsd_await_data(/*@out@*/fd_set *rfds,
}
return AWAIT_NOT_READY;
} else {
- gpsd_report(errout, LOG_ERROR, "select: %s\n", strerror(errno));
+ gpsd_log(errout, LOG_ERROR, "select: %s\n", strerror(errno));
return AWAIT_FAILED;
}
}
@@ -1035,9 +1038,9 @@ int gpsd_await_data(/*@out@*/fd_set *rfds,
for (i = 0; i < (int)FD_SETSIZE; i++)
if (FD_ISSET(i, rfds))
str_appendf(dbuf, sizeof(dbuf), " %d ", i);
- gpsd_report(errout, LOG_SPIN,
- "select() {%s} at %f (errno %d)\n",
- dbuf, timestamp(), errno);
+ gpsd_log(errout, LOG_SPIN,
+ "select() {%s} at %f (errno %d)\n",
+ dbuf, timestamp(), errno);
}
return AWAIT_GOT_INPUT;
@@ -1140,11 +1143,11 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
double gap = now - session->lexer.start_time;
if (gap > min_cycle)
- gpsd_report(&session->context->errout, LOG_WARN,
- "cycle-start detector failed.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "cycle-start detector failed.\n");
else if (gap > quiet_time) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "transmission pause of %f\n", gap);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "transmission pause of %f\n", gap);
session->sor = now;
session->lexer.start_char = session->lexer.char_counter;
}
@@ -1163,23 +1166,23 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
if (session->device_type != NULL) {
newlen = session->device_type->get_packet(session);
/* coverity[deref_ptr] */
- gpsd_report(&session->context->errout, LOG_RAW,
- "%s is known to be %s\n",
- session->gpsdata.dev.path,
- session->device_type->type_name);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "%s is known to be %s\n",
+ session->gpsdata.dev.path,
+ session->device_type->type_name);
} else {
newlen = generic_get(session);
}
/* update the scoreboard structure from the GPS */
- gpsd_report(&session->context->errout, LOG_RAW + 2,
- "%s sent %zd new characters\n",
- session->gpsdata.dev.path, newlen);
+ gpsd_log(&session->context->errout, LOG_RAW + 2,
+ "%s sent %zd new characters\n",
+ session->gpsdata.dev.path, newlen);
if (newlen < 0) { /* read error */
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS on %s returned error %zd (%lf sec since data)\n",
- session->gpsdata.dev.path, newlen,
- timestamp() - session->gpsdata.online);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS on %s returned error %zd (%lf sec since data)\n",
+ session->gpsdata.dev.path, newlen,
+ timestamp() - session->gpsdata.online);
session->gpsdata.online = (timestamp_t)0;
return ERROR_SET;
} else if (newlen == 0) { /* zero length read, possible EOF */
@@ -1188,26 +1191,26 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* wrong time...
*/
if (session->gpsdata.online > 0 && timestamp() - session->gpsdata.online >= session->gpsdata.dev.cycle * 2) {
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS on %s is offline (%lf sec since data)\n",
- session->gpsdata.dev.path,
- timestamp() - session->gpsdata.online);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS on %s is offline (%lf sec since data)\n",
+ session->gpsdata.dev.path,
+ timestamp() - session->gpsdata.online);
session->gpsdata.online = (timestamp_t)0;
}
return NODATA_IS;
} else /* (newlen > 0) */ {
- gpsd_report(&session->context->errout, LOG_RAW,
- "packet sniff on %s finds type %d\n",
- session->gpsdata.dev.path, session->lexer.type);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "packet sniff on %s finds type %d\n",
+ session->gpsdata.dev.path, session->lexer.type);
if (session->lexer.type == COMMENT_PACKET) {
if (strcmp((const char *)session->lexer.outbuffer, "# EOF\n") == 0) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "synthetic EOF\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "synthetic EOF\n");
return EOF_IS;
}
else
- gpsd_report(&session->context->errout, LOG_PROG,
- "comment, sync lock deferred\n");
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "comment, sync lock deferred\n");
/* FALL THROUGH */
} else if (session->lexer.type > COMMENT_PACKET) {
if (session->device_type == NULL)
@@ -1247,9 +1250,9 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
for (dp = gpsd_drivers; *dp; dp++)
if (session->lexer.type == (*dp)->packet_type) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "switching to match packet type %d: %s\n",
- session->lexer.type, gpsd_prettydump(session));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "switching to match packet type %d: %s\n",
+ session->lexer.type, gpsd_prettydump(session));
(void)gpsd_switch_driver(session, (*dp)->type_name);
break;
}
@@ -1259,26 +1262,26 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->gpsdata.dev.driver_mode = (session->lexer.type > NMEA_PACKET) ? MODE_BINARY : MODE_NMEA;
/* FALL THROUGH */
} else if (hunt_failure(session) && !gpsd_next_hunt_setting(session)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "hunt on %s failed (%lf sec since data)\n",
- session->gpsdata.dev.path,
- timestamp() - session->gpsdata.online);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "hunt on %s failed (%lf sec since data)\n",
+ session->gpsdata.dev.path,
+ timestamp() - session->gpsdata.online);
return ERROR_SET;
}
}
if (session->lexer.outbuflen == 0) { /* got new data, but no packet */
- gpsd_report(&session->context->errout, LOG_RAW + 3,
- "New data on %s, not yet a packet\n",
- session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_RAW + 3,
+ "New data on %s, not yet a packet\n",
+ session->gpsdata.dev.path);
return ONLINE_SET;
} else { /* we have recognized a packet */
gps_mask_t received = PACKET_SET;
session->gpsdata.online = timestamp();
- gpsd_report(&session->context->errout, LOG_RAW + 3,
- "Accepted packet on %s.\n",
- session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_RAW + 3,
+ "Accepted packet on %s.\n",
+ session->gpsdata.dev.path);
/* track the packet count since achieving sync on the device */
if (driver_change
@@ -1287,12 +1290,12 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
/*@-nullderef@*/
/* coverity[var_deref_op] */
- gpsd_report(&session->context->errout, LOG_INF,
- "%s identified as type %s, %f sec @ %ubps\n",
- session->gpsdata.dev.path,
- session->device_type->type_name,
- timestamp() - session->opentime,
- (unsigned int)speed);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "%s identified as type %s, %f sec @ %ubps\n",
+ session->gpsdata.dev.path,
+ session->device_type->type_name,
+ timestamp() - session->opentime,
+ (unsigned int)speed);
/*@+nullderef@*/
/* fire the init_query method */
@@ -1333,11 +1336,11 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* level does not actually require it.
*/
if (session->context->errout.debug >= LOG_RAW)
- gpsd_report(&session->context->errout, LOG_RAW,
- "raw packet of type %d, %zd:%s\n",
- session->lexer.type,
- session->lexer.outbuflen,
- gpsd_prettydump(session));
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "raw packet of type %d, %zd:%s\n",
+ session->lexer.type,
+ session->lexer.outbuflen,
+ gpsd_prettydump(session));
/* Get data from current packet into the fix structure */
if (session->lexer.type != COMMENT_PACKET)
@@ -1358,9 +1361,9 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
&& session->last_controller != NULL)
{
session->device_type = session->last_controller;
- gpsd_report(&session->context->errout, LOG_PROG,
- "reverted to %s driver...\n",
- session->device_type->type_name);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "reverted to %s driver...\n",
+ session->device_type->type_name);
}
/*@+mustfreeonly@*/
#endif /* RECONFIGURE_ENABLE */
@@ -1397,7 +1400,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
/* don't downgrade mode if holding previous fix */
if (session->gpsdata.fix.mode > session->newdata.mode)
session->gpsdata.set &= ~MODE_SET;
- //gpsd_report(&session->context->errout, LOG_PROG,
+ //gpsd_log(&session->context->errout, LOG_PROG,
// "transfer mask: %02x\n", session->gpsdata.set);
gps_merge_fix(&session->gpsdata.fix,
session->gpsdata.set, &session->newdata);
@@ -1436,11 +1439,11 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
/*@+relaxtypes +longunsignedintegral@*/
if ((session->gpsdata.set & TIME_SET) != 0) {
if (session->newdata.time > time(NULL) + (60 * 60 * 24 * 365))
- gpsd_report(&session->context->errout, LOG_WARN,
- "date more than a year in the future!\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "date more than a year in the future!\n");
else if (session->newdata.time < 0)
- gpsd_report(&session->context->errout, LOG_ERROR,
- "date is negative!\n");
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "date is negative!\n");
}
/*@-relaxtypes -longunsignedintegral@*/
@@ -1458,8 +1461,8 @@ int gpsd_multipoll(const bool data_ready,
{
int fragments;
- gpsd_report(&device->context->errout, LOG_RAW + 1,
- "polling %d\n", device->gpsdata.gps_fd);
+ gpsd_log(&device->context->errout, LOG_RAW + 1,
+ "polling %d\n", device->gpsdata.gps_fd);
#ifdef NETFEED_ENABLE
/*
@@ -1471,8 +1474,8 @@ int gpsd_multipoll(const bool data_ready,
(void)ntrip_open(device, "");
if (device->ntrip.conn_state == ntrip_conn_err) {
- gpsd_report(&device->context->errout, LOG_WARN,
- "connection to ntrip server failed\n");
+ gpsd_log(&device->context->errout, LOG_WARN,
+ "connection to ntrip server failed\n");
device->ntrip.conn_state = ntrip_conn_init;
return DEVICE_ERROR;
} else {
@@ -1485,15 +1488,15 @@ int gpsd_multipoll(const bool data_ready,
gps_mask_t changed = gpsd_poll(device);
if (changed == EOF_IS) {
- gpsd_report(&device->context->errout, LOG_WARN,
- "device signed off %s\n",
- device->gpsdata.dev.path);
+ gpsd_log(&device->context->errout, LOG_WARN,
+ "device signed off %s\n",
+ device->gpsdata.dev.path);
return DEVICE_EOF;
} else if (changed == ERROR_SET) {
- gpsd_report(&device->context->errout, LOG_WARN,
- "device read of %s returned error or packet sniffer failed sync (flags %s)\n",
- device->gpsdata.dev.path,
- gps_maskdump(changed));
+ gpsd_log(&device->context->errout, LOG_WARN,
+ "device read of %s returned error or packet sniffer failed sync (flags %s)\n",
+ device->gpsdata.dev.path,
+ gps_maskdump(changed));
return DEVICE_ERROR;
} else if (changed == NODATA_IS) {
/*
@@ -1501,21 +1504,21 @@ int gpsd_multipoll(const bool data_ready,
* fd may have been in an end-of-file condition on select.
*/
if (fragments == 0) {
- gpsd_report(&device->context->errout, LOG_DATA,
- "%s returned zero bytes\n",
- device->gpsdata.dev.path);
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "%s returned zero bytes\n",
+ device->gpsdata.dev.path);
if (device->zerokill) {
/* failed timeout-and-reawake, kill it */
gpsd_deactivate(device);
if (device->ntrip.works) {
device->ntrip.works = false; // reset so we try this once only
if (gpsd_activate(device, O_CONTINUE) < 0) {
- gpsd_report(&device->context->errout, LOG_WARN,
- "reconnect to ntrip server failed\n");
+ gpsd_log(&device->context->errout, LOG_WARN,
+ "reconnect to ntrip server failed\n");
return DEVICE_ERROR;
} else {
- gpsd_report(&device->context->errout, LOG_INFO,
- "reconnecting to ntrip server\n");
+ gpsd_log(&device->context->errout, LOG_INFO,
+ "reconnecting to ntrip server\n");
return DEVICE_READY;
}
}
@@ -1526,9 +1529,9 @@ int gpsd_multipoll(const bool data_ready,
* Disable listening to this fd for long enough
* that the buffer can fill up again.
*/
- gpsd_report(&device->context->errout, LOG_DATA,
- "%s will be repolled in %f seconds\n",
- device->gpsdata.dev.path, reawake_time);
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "%s will be repolled in %f seconds\n",
+ device->gpsdata.dev.path, reawake_time);
device->reawake = timestamp() + reawake_time;
return DEVICE_UNREADY;
}
@@ -1553,15 +1556,15 @@ int gpsd_multipoll(const bool data_ready,
/* conditional prevents mask dumper from eating CPU */
if (device->context->errout.debug >= LOG_DATA) {
if (device->lexer.type == BAD_PACKET)
- gpsd_report(&device->context->errout, LOG_DATA,
- "packet with bad checksum from %s\n",
- device->gpsdata.dev.path);
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "packet with bad checksum from %s\n",
+ device->gpsdata.dev.path);
else
- gpsd_report(&device->context->errout, LOG_DATA,
- "packet type %d from %s with %s\n",
- device->lexer.type,
- device->gpsdata.dev.path,
- gps_maskdump(device->gpsdata.set));
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "packet type %d from %s with %s\n",
+ device->lexer.type,
+ device->gpsdata.dev.path,
+ gps_maskdump(device->gpsdata.set));
}
@@ -1586,9 +1589,9 @@ int gpsd_multipoll(const bool data_ready,
}
else if (device->reawake>0 && timestamp()>device->reawake) {
/* device may have had a zero-length read */
- gpsd_report(&device->context->errout, LOG_DATA,
- "%s reawakened after zero-length read\n",
- device->gpsdata.dev.path);
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "%s reawakened after zero-length read\n",
+ device->gpsdata.dev.path);
device->reawake = (timestamp_t)0;
device->zerokill = true;
return DEVICE_READY;
diff --git a/net_dgpsip.c b/net_dgpsip.c
index dc596efa..3574125b 100644
--- a/net_dgpsip.c
+++ b/net_dgpsip.c
@@ -37,21 +37,21 @@ int dgpsip_open(struct gps_device_t *device, const char *dgpsserver)
// cppcheck-suppress pointerPositive
if (device->gpsdata.gps_fd >= 0) {
char hn[256], buf[BUFSIZ];
- gpsd_report(&device->context->errout, LOG_PROG,
- "connection to DGPS server %s established.\n",
- dgpsserver);
+ gpsd_log(&device->context->errout, LOG_PROG,
+ "connection to DGPS server %s established.\n",
+ dgpsserver);
(void)gethostname(hn, sizeof(hn));
/* greeting required by some RTCM104 servers; others will ignore it */
(void)snprintf(buf, sizeof(buf), "HELO %s gpsd %s\r\nR\r\n", hn,
VERSION);
if (write(device->gpsdata.gps_fd, buf, strlen(buf)) != (ssize_t) strlen(buf))
- gpsd_report(&device->context->errout, LOG_ERROR,
- "hello to DGPS server %s failed\n",
- dgpsserver);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "hello to DGPS server %s failed\n",
+ dgpsserver);
} else
- gpsd_report(&device->context->errout, LOG_ERROR,
- "can't connect to DGPS server %s, netlib error %d.\n",
- dgpsserver, device->gpsdata.gps_fd);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "can't connect to DGPS server %s, netlib error %d.\n",
+ dgpsserver, device->gpsdata.gps_fd);
opts = fcntl(device->gpsdata.gps_fd, F_GETFL);
if (opts >= 0)
@@ -81,9 +81,9 @@ void dgpsip_report(struct gps_context_t *context,
gps->gpsdata.fix.altitude);
if (write(dgpsip->gpsdata.gps_fd, buf, strlen(buf)) ==
(ssize_t) strlen(buf))
- gpsd_report(&context->errout, LOG_IO, "=> dgps %s\n", buf);
+ gpsd_log(&context->errout, LOG_IO, "=> dgps %s\n", buf);
else
- gpsd_report(&context->errout, LOG_IO, "write to dgps FAILED\n");
+ gpsd_log(&context->errout, LOG_IO, "write to dgps FAILED\n");
}
}
}
diff --git a/net_gnss_dispatch.c b/net_gnss_dispatch.c
index b3dfd800..a8f6fd13 100644
--- a/net_gnss_dispatch.c
+++ b/net_gnss_dispatch.c
@@ -45,9 +45,9 @@ int netgnss_uri_open(struct gps_device_t *dev, char *netgnss_service)
#ifndef REQUIRE_DGNSS_PROTO
return dgpsip_open(dev, netgnss_service);
#else
- gpsd_report(&dev->context.errout, LOG_ERROR,
- "Unknown or unspecified DGNSS protocol for service %s\n",
- netgnss_service);
+ gpsd_log(&dev->context.errout, LOG_ERROR,
+ "Unknown or unspecified DGNSS protocol for service %s\n",
+ netgnss_service);
return -1;
#endif
}
diff --git a/net_ntrip.c b/net_ntrip.c
index 2d26a66c..75ef0d88 100644
--- a/net_ntrip.c
+++ b/net_ntrip.c
@@ -58,7 +58,7 @@ static /*@null@*/ char *ntrip_field_iterate( /*@null@ */ char *start,
if ((t = strstr(t, ";")))
*t = '\0';
- gpsd_report(errout, LOG_RAW, "Next Ntrip source table field %s\n", s);
+ gpsd_log(errout, LOG_RAW, "Next Ntrip source table field %s\n", s);
return s;
}
@@ -183,22 +183,22 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device)
if (match) {
return 1;
}
- gpsd_report(&device->context->errout, LOG_ERROR,
- "ntrip stream read error %d on fd %d\n",
- errno, fd);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "ntrip stream read error %d on fd %d\n",
+ errno, fd);
return -1;
} else if (rlen == 0) { // server closed the connection
- gpsd_report(&device->context->errout, LOG_ERROR,
- "ntrip stream unexpected close %d on fd %d during sourcetable read\n",
- errno, fd);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "ntrip stream unexpected close %d on fd %d during sourcetable read\n",
+ errno, fd);
return -1;
}
line = buf;
rlen = len += rlen;
- gpsd_report(&device->context->errout, LOG_RAW,
- "Ntrip source table buffer %s\n", buf);
+ gpsd_log(&device->context->errout, LOG_RAW,
+ "Ntrip source table buffer %s\n", buf);
sourcetable = device->ntrip.sourcetable_parse;
if (!sourcetable) {
@@ -210,9 +210,9 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device)
line += llen;
len -= llen;
} else {
- gpsd_report(&device->context->errout, LOG_WARN,
- "Received unexpexted Ntrip reply %s.\n",
- buf);
+ gpsd_log(&device->context->errout, LOG_WARN,
+ "Received unexpexted Ntrip reply %s.\n",
+ buf);
return -1;
}
}
@@ -226,8 +226,8 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device)
if (!(eol = strstr(line, NTRIP_BR)))
break;
- gpsd_report(&device->context->errout, LOG_DATA,
- "next Ntrip source table line %s\n", line);
+ gpsd_log(&device->context->errout, LOG_DATA,
+ "next Ntrip source table line %s\n", line);
*eol = '\0';
llen = (ssize_t) (eol - line);
@@ -242,23 +242,23 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device)
if (strcmp(device->ntrip.stream.mountpoint, hold.mountpoint) == 0) {
/* todo: support for RTCM 3.0, SBAS (WAAS, EGNOS), ... */
if (hold.format == fmt_unknown) {
- gpsd_report(&device->context->errout, LOG_ERROR,
- "Ntrip stream %s format not supported\n",
- line);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "Ntrip stream %s format not supported\n",
+ line);
return -1;
}
/* todo: support encryption and compression algorithms */
if (hold.compr_encryp != cmp_enc_none) {
- gpsd_report(&device->context->errout, LOG_ERROR,
- "Ntrip stream %s compression/encryption algorithm not supported\n",
- line);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "Ntrip stream %s compression/encryption algorithm not supported\n",
+ line);
return -1;
}
/* todo: support digest authentication */
if (hold.authentication != auth_none
&& hold.authentication != auth_basic) {
- gpsd_report(&device->context->errout, LOG_ERROR,
- "Ntrip stream %s authentication method not supported\n",
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "Ntrip stream %s authentication method not supported\n",
line);
return -1;
}
@@ -287,9 +287,9 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device)
llen += strlen(NTRIP_BR);
line += llen;
len -= llen;
- gpsd_report(&device->context->errout, LOG_RAW,
- "Remaining Ntrip source table buffer %zd %s\n", len,
- line);
+ gpsd_log(&device->context->errout, LOG_RAW,
+ "Remaining Ntrip source table buffer %zd %s\n", len,
+ line);
}
/* message too big to fit into buffer */
if ((size_t)len == blen - 1)
@@ -312,10 +312,12 @@ static int ntrip_stream_req_probe(const struct ntrip_stream_t *stream,
dsock = netlib_connectsock(AF_UNSPEC, stream->url, stream->port, "tcp");
if (dsock < 0) {
- gpsd_report(errout, LOG_ERROR, "ntrip stream connect error %d in req probe\n", dsock);
+ gpsd_log(errout, LOG_ERROR,
+ "ntrip stream connect error %d in req probe\n", dsock);
return -1;
}
- gpsd_report(errout, LOG_SPIN, "ntrip stream for req probe connected on fd %d\n", dsock);
+ gpsd_log(errout, LOG_SPIN,
+ "ntrip stream for req probe connected on fd %d\n", dsock);
(void)snprintf(buf, sizeof(buf),
"GET / HTTP/1.1\r\n"
"User-Agent: NTRIP gpsd/%s\r\n"
@@ -324,9 +326,9 @@ static int ntrip_stream_req_probe(const struct ntrip_stream_t *stream,
"\r\n", VERSION, stream->url);
r = write(dsock, buf, strlen(buf));
if (r != (ssize_t)strlen(buf)) {
- gpsd_report(errout, LOG_ERROR,
- "ntrip stream write error %d on fd %d during probe request %zd\n",
- errno, dsock, r);
+ gpsd_log(errout, LOG_ERROR,
+ "ntrip stream write error %d on fd %d during probe request %zd\n",
+ errno, dsock, r);
(void)close(dsock);
return -1;
}
@@ -368,14 +370,14 @@ static int ntrip_stream_get_req(const struct ntrip_stream_t *stream,
dsock = netlib_connectsock(AF_UNSPEC, stream->url, stream->port, "tcp");
if (BAD_SOCKET(dsock)) {
- gpsd_report(errout, LOG_ERROR,
- "ntrip stream connect error %d\n", dsock);
+ gpsd_log(errout, LOG_ERROR,
+ "ntrip stream connect error %d\n", dsock);
return -1;
}
- gpsd_report(errout, LOG_SPIN,
- "netlib_connectsock() returns socket on fd %d\n",
- dsock);
+ gpsd_log(errout, LOG_SPIN,
+ "netlib_connectsock() returns socket on fd %d\n",
+ dsock);
(void)snprintf(buf, sizeof(buf),
"GET /%s HTTP/1.1\r\n"
@@ -386,9 +388,9 @@ static int ntrip_stream_get_req(const struct ntrip_stream_t *stream,
"Connection: close\r\n"
"\r\n", stream->mountpoint, VERSION, stream->url, stream->authStr);
if (write(dsock, buf, strlen(buf)) != (ssize_t) strlen(buf)) {
- gpsd_report(errout, LOG_ERROR,
- "ntrip stream write error %d on fd %d during get request\n", errno,
- dsock);
+ gpsd_log(errout, LOG_ERROR,
+ "ntrip stream write error %d on fd %d during get request\n", errno,
+ dsock);
(void)close(dsock);
return -1;
}
@@ -406,32 +408,32 @@ static int ntrip_stream_get_parse(const struct ntrip_stream_t *stream,
while (read(dsock, buf, sizeof(buf) - 1) == -1) {
if (errno == EINTR)
continue;
- gpsd_report(errout, LOG_ERROR,
- "ntrip stream read error %d on fd %d during get rsp\n", errno,
- dsock);
+ gpsd_log(errout, LOG_ERROR,
+ "ntrip stream read error %d on fd %d during get rsp\n", errno,
+ dsock);
goto close;
}
/* parse 401 Unauthorized */
/* coverity[string_null] - guaranteed terminated by the memset above */
if (strstr(buf, NTRIP_UNAUTH)!=NULL) {
- gpsd_report(errout, LOG_ERROR,
- "not authorized for Ntrip stream %s/%s\n", stream->url,
- stream->mountpoint);
+ gpsd_log(errout, LOG_ERROR,
+ "not authorized for Ntrip stream %s/%s\n", stream->url,
+ stream->mountpoint);
goto close;
}
/* parse SOURCETABLE */
if (strstr(buf, NTRIP_SOURCETABLE)!=NULL) {
- gpsd_report(errout, LOG_ERROR,
- "Broadcaster doesn't recognize Ntrip stream %s:%s/%s\n",
- stream->url, stream->port, stream->mountpoint);
+ gpsd_log(errout, LOG_ERROR,
+ "Broadcaster doesn't recognize Ntrip stream %s:%s/%s\n",
+ stream->url, stream->port, stream->mountpoint);
goto close;
}
/* parse ICY 200 OK */
if (strstr(buf, NTRIP_ICY)==NULL) {
- gpsd_report(errout, LOG_ERROR,
- "Unknown reply %s from Ntrip service %s:%s/%s\n", buf,
- stream->url, stream->port, stream->mountpoint);
+ gpsd_log(errout, LOG_ERROR,
+ "Unknown reply %s from Ntrip service %s:%s/%s\n", buf,
+ stream->url, stream->port, stream->mountpoint);
goto close;
}
opts = fcntl(dsock, F_GETFL);
@@ -476,9 +478,9 @@ int ntrip_open(struct gps_device_t *device, char *caster)
tmp = amp + 1;
url = tmp;
} else {
- gpsd_report(&device->context->errout, LOG_ERROR,
- "can't extract user-ID and password from %s\n",
- caster);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "can't extract user-ID and password from %s\n",
+ caster);
device->ntrip.conn_state = ntrip_conn_err;
return -1;
}
@@ -489,9 +491,9 @@ int ntrip_open(struct gps_device_t *device, char *caster)
stream = slash + 1;
} else {
/* todo: add autoconnect like in dgpsip.c */
- gpsd_report(&device->context->errout, LOG_ERROR,
- "can't extract Ntrip stream from %s\n",
- caster);
+ gpsd_log(&device->context->errout, LOG_ERROR,
+ "can't extract Ntrip stream from %s\n",
+ caster);
device->ntrip.conn_state = ntrip_conn_err;
return -1;
}
@@ -596,9 +598,9 @@ void ntrip_report(struct gps_context_t *context,
gpsd_position_fix_dump(gps, buf, sizeof(buf));
if (write(caster->gpsdata.gps_fd, buf, strlen(buf)) ==
(ssize_t) strlen(buf)) {
- gpsd_report(&context->errout, LOG_IO, "=> dgps %s\n", buf);
+ gpsd_log(&context->errout, LOG_IO, "=> dgps %s\n", buf);
} else {
- gpsd_report(&context->errout, LOG_IO, "ntrip report write failed\n");
+ gpsd_log(&context->errout, LOG_IO, "ntrip report write failed\n");
}
}
}
diff --git a/packet.c b/packet.c
index 08e58864..8c6bacde 100644
--- a/packet.c
+++ b/packet.c
@@ -202,11 +202,11 @@ static bool character_pushback(struct gps_lexer_t *lexer, unsigned int newstate)
if (lexer->errout.debug >= LOG_RAW + 2)
{
unsigned char c = *lexer->inbufptr;
- gpsd_report(&lexer->errout, LOG_RAW + 2,
- "%08ld: character '%c' [%02x] pushed back, state set to %s\n",
- lexer->char_counter,
- (isprint((int)c) ? c : '.'), c,
- state_table[lexer->state]);
+ gpsd_log(&lexer->errout, LOG_RAW + 2,
+ "%08ld: character '%c' [%02x] pushed back, state set to %s\n",
+ lexer->char_counter,
+ (isprint((int)c) ? c : '.'), c,
+ state_table[lexer->state]);
}
return false;
@@ -971,9 +971,9 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
n++)
csum ^= lexer->inbuffer[n];
if (csum != c) {
- gpsd_report(&lexer->errout, LOG_IO,
- "Navcom packet type 0x%hhx bad checksum 0x%hhx, expecting 0x%x\n",
- lexer->inbuffer[3], csum, c);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Navcom packet type 0x%hhx bad checksum 0x%hhx, expecting 0x%x\n",
+ lexer->inbuffer[3], csum, c);
lexer->state = GROUND_STATE;
break;
}
@@ -1057,16 +1057,16 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
short sum = getword(0) + getword(1) + getword(2) + getword(3);
sum *= -1;
if (sum != getword(4)) {
- gpsd_report(&lexer->errout, LOG_IO,
- "Zodiac Header checksum 0x%hx expecting 0x%hx\n",
- sum, getword(4));
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Zodiac Header checksum 0x%hx expecting 0x%hx\n",
+ sum, getword(4));
lexer->state = GROUND_STATE;
break;
}
}
- gpsd_report(&lexer->errout, LOG_RAW + 1,
- "Zodiac header id=%hd len=%hd flags=%hx\n",
- getword(1), getword(2), getword(3));
+ gpsd_log(&lexer->errout, LOG_RAW + 1,
+ "Zodiac header id=%hd len=%hd flags=%hx\n",
+ getword(1), getword(2), getword(3));
#undef getword
if (lexer->length == 0) {
lexer->state = ZODIAC_RECOGNIZED;
@@ -1196,8 +1196,8 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
if ((c == '>') && (lexer->inbufptr[0] == '<') &&
(lexer->inbufptr[1] == '!')) {
lexer->state = ITALK_RECOGNIZED;
- gpsd_report(&lexer->errout, LOG_IO,
- "ITALK: trying to process runt packet\n");
+ gpsd_log(&lexer->errout, LOG_IO,
+ "ITALK: trying to process runt packet\n");
break;
} else if (--lexer->length == 0)
lexer->state = ITALK_DELIVERED;
@@ -1352,9 +1352,9 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
lexer->state = JSON_STRINGLITERAL;
lexer->json_after = JSON_END_ATTRIBUTE;
} else {
- gpsd_report(&lexer->errout, LOG_RAW + 2,
- "%08ld: missing attribute start after header\n",
- lexer->char_counter);
+ gpsd_log(&lexer->errout, LOG_RAW + 2,
+ "%08ld: missing attribute start after header\n",
+ lexer->char_counter);
lexer->state = GROUND_STATE;
}
break;
@@ -1444,17 +1444,17 @@ static void packet_accept(struct gps_lexer_t *lexer, int packet_type)
lexer->type = packet_type;
if (lexer->errout.debug >= LOG_RAW+1) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
- gpsd_report(&lexer->errout, LOG_RAW+1,
- "Packet type %d accepted %zu = %s\n",
- packet_type, packetlen,
- gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
- (char *)lexer->outbuffer,
- lexer->outbuflen));
+ gpsd_log(&lexer->errout, LOG_RAW+1,
+ "Packet type %d accepted %zu = %s\n",
+ packet_type, packetlen,
+ gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
+ (char *)lexer->outbuffer,
+ lexer->outbuflen));
}
} else {
- gpsd_report(&lexer->errout, LOG_ERROR,
- "Rejected too long packet type %d len %zu\n",
- packet_type, packetlen);
+ gpsd_log(&lexer->errout, LOG_ERROR,
+ "Rejected too long packet type %d len %zu\n",
+ packet_type, packetlen);
}
}
@@ -1467,10 +1467,10 @@ static void packet_discard(struct gps_lexer_t *lexer)
lexer->inbuflen = remaining;
if (lexer->errout.debug >= LOG_RAW+1) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
- gpsd_report(&lexer->errout, LOG_RAW + 1,
- "Packet discard of %zu, chars remaining is %zu = %s\n",
- discard, remaining,
- gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
+ gpsd_log(&lexer->errout, LOG_RAW + 1,
+ "Packet discard of %zu, chars remaining is %zu = %s\n",
+ discard, remaining,
+ gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
(char *)lexer->inbuffer, lexer->inbuflen));
}
}
@@ -1482,10 +1482,10 @@ static void character_discard(struct gps_lexer_t *lexer)
lexer->inbufptr = lexer->inbuffer;
if (lexer->errout.debug >= LOG_RAW+1) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
- gpsd_report(&lexer->errout, LOG_RAW + 1,
- "Character discarded, buffer %zu chars = %s\n",
- lexer->inbuflen,
- gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
+ gpsd_log(&lexer->errout, LOG_RAW + 1,
+ "Character discarded, buffer %zu chars = %s\n",
+ lexer->inbuflen,
+ gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
(char *)lexer->inbuffer, lexer->inbuflen));
}
}
@@ -1520,10 +1520,10 @@ void packet_parse(struct gps_lexer_t *lexer)
unsigned int oldstate = lexer->state;
if (!nextstate(lexer, c))
continue;
- gpsd_report(&lexer->errout, LOG_RAW + 2,
- "%08ld: character '%c' [%02x], %s -> %s\n",
- lexer->char_counter, (isprint(c) ? c : '.'), c,
- state_table[oldstate], state_table[lexer->state]);
+ gpsd_log(&lexer->errout, LOG_RAW + 2,
+ "%08ld: character '%c' [%02x], %s -> %s\n",
+ lexer->char_counter, (isprint(c) ? c : '.'), c,
+ state_table[oldstate], state_table[lexer->state]);
lexer->char_counter++;
if (lexer->state == GROUND_STATE) {
@@ -1562,9 +1562,9 @@ void packet_parse(struct gps_lexer_t *lexer)
&& csum[1] == toupper((unsigned char) end[2]));
}
if (!checksum_ok) {
- gpsd_report(&lexer->errout, LOG_WARN,
- "bad checksum in NMEA packet; expected %s.\n",
- csum);
+ gpsd_log(&lexer->errout, LOG_WARN,
+ "bad checksum in NMEA packet; expected %s.\n",
+ csum);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
packet_discard(lexer);
@@ -1615,14 +1615,14 @@ void packet_parse(struct gps_lexer_t *lexer)
for (n = 0; n < lexer->length - 2; n++)
a += (unsigned)lexer->inbuffer[n];
b = (unsigned)getleu16(lexer->inbuffer, lexer->length - 2);
- gpsd_report(&lexer->errout, LOG_IO,
- "SuperStarII pkt dump: type %u len %u\n",
- lexer->inbuffer[1], (unsigned int)lexer->length);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "SuperStarII pkt dump: type %u len %u\n",
+ lexer->inbuffer[1], (unsigned int)lexer->length);
if (a != b) {
- gpsd_report(&lexer->errout, LOG_IO,
- "REJECT SuperStarII packet type 0x%02x"
- "%zd bad checksum 0x%04x, expecting 0x%04x\n",
- lexer->inbuffer[1], lexer->length, a, b);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "REJECT SuperStarII packet type 0x%02x"
+ "%zd bad checksum 0x%04x, expecting 0x%04x\n",
+ lexer->inbuffer[1], lexer->length, a, b);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
} else {
@@ -1643,14 +1643,14 @@ void packet_parse(struct gps_lexer_t *lexer)
for (i = 2; i < len - 3; i++)
b ^= lexer->inbuffer[i];
if (a == b) {
- gpsd_report(&lexer->errout, LOG_IO,
- "Accept OnCore packet @@%c%c len %d\n",
- lexer->inbuffer[2], lexer->inbuffer[3], len);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Accept OnCore packet @@%c%c len %d\n",
+ lexer->inbuffer[2], lexer->inbuffer[3], len);
packet_accept(lexer, ONCORE_PACKET);
} else {
- gpsd_report(&lexer->errout, LOG_IO,
- "REJECT OnCore packet @@%c%c len %d\n",
- lexer->inbuffer[2], lexer->inbuffer[3], len);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "REJECT OnCore packet @@%c%c len %d\n",
+ lexer->inbuffer[2], lexer->inbuffer[3], len);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
}
@@ -1671,8 +1671,8 @@ void packet_parse(struct gps_lexer_t *lexer)
if (dlecnt > 2) {
dlecnt -= 2;
dlecnt /= 2;
- gpsd_report(&lexer->errout, LOG_RAW,
- "Unstuffed %d DLEs\n", dlecnt);
+ gpsd_log(&lexer->errout, LOG_RAW,
+ "Unstuffed %d DLEs\n", dlecnt);
packetlen -= dlecnt;
}
#endif /* TSIP_ENABLE */
@@ -1722,16 +1722,16 @@ void packet_parse(struct gps_lexer_t *lexer)
/*@ +charint */
chksum &= 0xff;
if (chksum) {
- gpsd_report(&lexer->errout, LOG_IO,
- "Garmin checksum failed: %02x!=0\n", chksum);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Garmin checksum failed: %02x!=0\n", chksum);
goto not_garmin;
}
packet_accept(lexer, GARMIN_PACKET);
packet_discard(lexer);
break;
not_garmin:;
- gpsd_report(&lexer->errout, LOG_RAW + 1,
- "Not a Garmin packet\n");
+ gpsd_log(&lexer->errout, LOG_RAW + 1,
+ "Not a Garmin packet\n");
#endif /* GARMIN_ENABLE */
#ifdef TSIP_ENABLE
/* check for some common TSIP packet types:
@@ -1781,9 +1781,9 @@ void packet_parse(struct gps_lexer_t *lexer)
(0xbc == pkt_id) ||
(0x38 == pkt_id))
&& ((0x41 > pkt_id) || (0x8f < pkt_id))) {
- gpsd_report(&lexer->errout, LOG_IO,
- "Packet ID 0x%02x out of range for TSIP\n",
- pkt_id);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Packet ID 0x%02x out of range for TSIP\n",
+ pkt_id);
goto not_tsip;
}
/* *INDENT-ON* */
@@ -1865,22 +1865,22 @@ void packet_parse(struct gps_lexer_t *lexer)
/* pass */ ;
else {
/* pass */ ;
- gpsd_report(&lexer->errout, LOG_IO,
- "TSIP REJECT pkt_id = %#02x, packetlen= %zu\n",
- pkt_id, packetlen);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "TSIP REJECT pkt_id = %#02x, packetlen= %zu\n",
+ pkt_id, packetlen);
goto not_tsip;
}
#undef TSIP_ID_AND_LENGTH
/* Debug */
- gpsd_report(&lexer->errout, LOG_RAW,
- "TSIP pkt_id = %#02x, packetlen= %zu\n",
- pkt_id, packetlen);
+ gpsd_log(&lexer->errout, LOG_RAW,
+ "TSIP pkt_id = %#02x, packetlen= %zu\n",
+ pkt_id, packetlen);
/*@ -charint +ifempty @*/
packet_accept(lexer, TSIP_PACKET);
packet_discard(lexer);
break;
not_tsip:
- gpsd_report(&lexer->errout, LOG_RAW + 1, "Not a TSIP packet\n");
+ gpsd_log(&lexer->errout, LOG_RAW + 1, "Not a TSIP packet\n");
/*
* More attempts to recognize ambiguous TSIP-like
* packet types could go here.
@@ -1899,13 +1899,13 @@ void packet_parse(struct gps_lexer_t *lexer)
lexer->inbufptr - lexer->inbuffer)) {
packet_accept(lexer, RTCM3_PACKET);
} else {
- gpsd_report(&lexer->errout, LOG_IO,
- "RTCM3 data checksum failure, "
- "%0x against %02x %02x %02x\n",
- crc24q_hash(lexer->inbuffer,
- lexer->inbufptr - lexer->inbuffer -
- 3), lexer->inbufptr[-3],
- lexer->inbufptr[-2], lexer->inbufptr[-1]);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "RTCM3 data checksum failure, "
+ "%0x against %02x %02x %02x\n",
+ crc24q_hash(lexer->inbuffer,
+ lexer->inbufptr - lexer->inbuffer -
+ 3), lexer->inbufptr[-3],
+ lexer->inbufptr[-2], lexer->inbufptr[-1]);
packet_accept(lexer, BAD_PACKET);
}
packet_discard(lexer);
@@ -1923,9 +1923,9 @@ void packet_parse(struct gps_lexer_t *lexer)
if (len == 0 || sum == getword(5 + len)) {
packet_accept(lexer, ZODIAC_PACKET);
} else {
- gpsd_report(&lexer->errout, LOG_IO,
- "Zodiac data checksum 0x%hx over length %hd, expecting 0x%hx\n",
- sum, len, getword(5 + len));
+ gpsd_log(&lexer->errout, LOG_IO,
+ "Zodiac data checksum 0x%hx over length %hd, expecting 0x%hx\n",
+ sum, len, getword(5 + len));
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
}
@@ -1940,7 +1940,7 @@ void packet_parse(struct gps_lexer_t *lexer)
unsigned char ck_a = (unsigned char)0;
unsigned char ck_b = (unsigned char)0;
len = lexer->inbufptr - lexer->inbuffer;
- gpsd_report(&lexer->errout, LOG_IO, "UBX: len %d\n", len);
+ gpsd_log(&lexer->errout, LOG_IO, "UBX: len %d\n", len);
for (n = 2; n < (len - 2); n++) {
ck_a += lexer->inbuffer[n];
ck_b += ck_a;
@@ -1949,15 +1949,15 @@ void packet_parse(struct gps_lexer_t *lexer)
ck_b == lexer->inbuffer[len - 1])
packet_accept(lexer, UBX_PACKET);
else {
- gpsd_report(&lexer->errout, LOG_IO,
- "UBX checksum 0x%02hhx%02hhx over length %d,"
- " expecting 0x%02hhx%02hhx (type 0x%02hhx%02hhx)\n",
- ck_a,
- ck_b,
- len,
- lexer->inbuffer[len - 2],
- lexer->inbuffer[len - 1],
- lexer->inbuffer[2], lexer->inbuffer[3]);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "UBX checksum 0x%02hhx%02hhx over length %d,"
+ " expecting 0x%02hhx%02hhx (type 0x%02hhx%02hhx)\n",
+ ck_a,
+ ck_b,
+ len,
+ lexer->inbuffer[len - 2],
+ lexer->inbuffer[len - 1],
+ lexer->inbuffer[2], lexer->inbuffer[3]);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
}
@@ -2000,9 +2000,9 @@ void packet_parse(struct gps_lexer_t *lexer)
goto not_evermore;
crc &= 0xff;
if (crc != checksum) {
- gpsd_report(&lexer->errout, LOG_IO,
- "EverMore checksum failed: %02x != %02x\n",
- crc, checksum);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "EverMore checksum failed: %02x != %02x\n",
+ crc, checksum);
goto not_evermore;
}
/*@ +charint */
@@ -2042,10 +2042,10 @@ void packet_parse(struct gps_lexer_t *lexer)
if (len == 0 || csum == xsum)
packet_accept(lexer, ITALK_PACKET);
else {
- gpsd_report(&lexer->errout, LOG_IO,
- "ITALK: checksum failed - "
- "type 0x%02x expected 0x%04x got 0x%04x\n",
- lexer->inbuffer[4], xsum, csum);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "ITALK: checksum failed - "
+ "type 0x%02x expected 0x%04x got 0x%04x\n",
+ lexer->inbuffer[4], xsum, csum);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
}
@@ -2078,9 +2078,9 @@ void packet_parse(struct gps_lexer_t *lexer)
if (cs == 0)
packet_accept(lexer, GEOSTAR_PACKET);
else {
- gpsd_report(&lexer->errout, LOG_IO,
- "GeoStar checksum failed 0x%x over length %d\n",
- cs, len);
+ gpsd_log(&lexer->errout, LOG_IO,
+ "GeoStar checksum failed 0x%x over length %d\n",
+ cs, len);
packet_accept(lexer, BAD_PACKET);
lexer->state = GROUND_STATE;
}
@@ -2143,28 +2143,28 @@ ssize_t packet_get(int fd, struct gps_lexer_t *lexer)
/*@ +modobserver @*/
if (recvd == -1) {
if ((errno == EAGAIN) || (errno == EINTR)) {
- gpsd_report(&lexer->errout, LOG_RAW + 2, "no bytes ready\n");
+ gpsd_log(&lexer->errout, LOG_RAW + 2, "no bytes ready\n");
recvd = 0;
/* fall through, input buffer may be nonempty */
} else {
- gpsd_report(&lexer->errout, LOG_RAW + 2,
- "errno: %s\n", strerror(errno));
+ gpsd_log(&lexer->errout, LOG_RAW + 2,
+ "errno: %s\n", strerror(errno));
return -1;
}
} else {
if (lexer->errout.debug >= LOG_RAW+1) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
- gpsd_report(&lexer->errout, LOG_RAW + 1,
- "Read %zd chars to buffer offset %zd (total %zd): %s\n",
- recvd, lexer->inbuflen, lexer->inbuflen + recvd,
- gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
- (char *)lexer->inbufptr, (size_t) recvd));
+ gpsd_log(&lexer->errout, LOG_RAW + 1,
+ "Read %zd chars to buffer offset %zd (total %zd): %s\n",
+ recvd, lexer->inbuflen, lexer->inbuflen + recvd,
+ gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
+ (char *)lexer->inbufptr, (size_t) recvd));
}
lexer->inbuflen += recvd;
}
- gpsd_report(&lexer->errout, LOG_SPIN,
- "packet_get() fd %d -> %zd (%d)\n",
- fd, recvd, errno);
+ gpsd_log(&lexer->errout, LOG_SPIN,
+ "packet_get() fd %d -> %zd (%d)\n",
+ fd, recvd, errno);
/*
* Bail out, indicating no more input, only if we just received
diff --git a/ppsthread.c b/ppsthread.c
index a1b6ade6..50edcd94 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -91,7 +91,7 @@ void pps_early_init( struct gps_context_t * context ) {
if ( 0 != err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&context->errout, LOG_ERROR,
+ gpsd_log(&context->errout, LOG_ERROR,
"PPS: pthread_mutex_init() : %s\n", errbuf);
}
}
@@ -116,7 +116,7 @@ static int init_kernel_pps(struct gps_device_t *session)
session->pps_thread.kernelpps_handle = -1;
if ( isatty(session->gpsdata.gps_fd) == 0 ) {
- gpsd_report(&session->context->errout, LOG_INF, "KPPS gps_fd not a tty\n");
+ gpsd_log(&session->context->errout, LOG_INF, "KPPS gps_fd not a tty\n");
return -1;
}
@@ -138,7 +138,7 @@ static int init_kernel_pps(struct gps_device_t *session)
if ( 0 > ioctl(session->gpsdata.gps_fd, TIOCSETD, &ldisc)) {
char errbuf[BUFSIZ] = "unknown error";
strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS cannot set PPS line discipline on %s : %s\n",
session->gpsdata.dev.path, errbuf);
return -1;
@@ -167,7 +167,7 @@ static int init_kernel_pps(struct gps_device_t *session)
}
(void)close(fd);
}
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS checking %s, %s\n",
globbuf.gl_pathv[i], path);
if ( 0 == strncmp( path, session->gpsdata.dev.path, sizeof(path))) {
@@ -182,7 +182,7 @@ static int init_kernel_pps(struct gps_device_t *session)
globfree(&globbuf);
if ( 0 == (int)pps_num ) {
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS device not found.\n");
return -1;
}
@@ -191,7 +191,7 @@ static int init_kernel_pps(struct gps_device_t *session)
/* root privs are required for this device open */
if ( 0 != getuid() ) {
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS only works as root \n");
return -1;
}
@@ -199,7 +199,7 @@ static int init_kernel_pps(struct gps_device_t *session)
if ( 0 > ret ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS cannot open %s: %s\n", path, errbuf);
return -1;
}
@@ -212,7 +212,7 @@ static int init_kernel_pps(struct gps_device_t *session)
ret = session->gpsdata.gps_fd;
#endif
/* assert(ret >= 0); */
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS RFC2783 fd is %d\n",
ret);
@@ -221,7 +221,7 @@ static int init_kernel_pps(struct gps_device_t *session)
if ( 0 > time_pps_create(ret, (pps_handle_t *)&session->pps_thread.kernelpps_handle )) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"KPPS time_pps_create(%d) failed: %s\n",
ret, errbuf);
return -1;
@@ -231,10 +231,10 @@ static int init_kernel_pps(struct gps_device_t *session)
int caps;
/* get features supported */
if ( 0 > time_pps_getcap(session->pps_thread.kernelpps_handle, &caps)) {
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"KPPS time_pps_getcap() failed\n");
} else {
- gpsd_report(&session->context->errout,
+ gpsd_log(&session->context->errout,
LOG_INF, "KPPS caps %0x\n", caps);
}
@@ -253,7 +253,7 @@ static int init_kernel_pps(struct gps_device_t *session)
if ( 0 > time_pps_setparams(session->pps_thread.kernelpps_handle, &pp)) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"KPPS time_pps_setparams() failed: %s\n", errbuf);
time_pps_destroy(session->pps_thread.kernelpps_handle);
return -1;
@@ -330,7 +330,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_TIOC) != 0) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_WARN,
+ gpsd_log(&session->context->errout, LOG_WARN,
"PPS ioctl(TIOCMIWAIT) on %s failed: %d %.40s\n",
session->gpsdata.dev.path, errno, errbuf);
break;
@@ -346,7 +346,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_lock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -357,7 +357,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_unlock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -366,7 +366,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
/* get the time after we just woke up */
if ( 0 > clock_gettime(CLOCK_REALTIME, &clock_ts) ) {
/* uh, oh, can not get time! */
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS clock_gettime() failed\n");
break;
}
@@ -376,14 +376,14 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
* get the edge state */
/*@ +ignoresigns */
if (ioctl(session->gpsdata.gps_fd, TIOCMGET, &state) != 0) {
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS ioctl(TIOCMGET) on %s failed\n",
session->gpsdata.dev.path);
break;
}
/*@ -ignoresigns */
/* end of time critical section */
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"PPS ioctl(TIOCMIWAIT) on %s succeeded\n",
session->gpsdata.dev.path);
@@ -434,7 +434,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
#endif
if ( 0 > time_pps_fetch(session->pps_thread.kernelpps_handle, PPS_TSFMT_TSPEC
, &pi, &kernelpps_tv)) {
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"KPPS kernel PPS failed\n");
} else {
// find the last edge
@@ -460,14 +460,14 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
*/
timespec_str( &pi.assert_timestamp, ts_str1, sizeof(ts_str1) );
timespec_str( &pi.clear_timestamp, ts_str2, sizeof(ts_str2) );
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"KPPS assert %s, sequence: %ld - "
"clear %s, sequence: %ld\n",
ts_str1,
(unsigned long) pi.assert_sequence,
ts_str2,
(unsigned long) pi.clear_sequence);
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"KPPS data: using %s\n",
edge_kpps ? "assert" : "clear");
@@ -476,7 +476,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
cycle_kpps = timespec_diff_ns(ts_kpps, pulse_kpps[edge_kpps])/1000;
duration_kpps = timespec_diff_ns(ts_kpps, pulse_kpps[(int)(edge_kpps == 0)])/1000;
timespec_str( &ts_kpps, ts_str1, sizeof(ts_str1) );
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"KPPS cycle: %7d uSec, duration: %7d uSec @ %s\n",
cycle_kpps, duration_kpps, ts_str1);
pulse_kpps[edge_kpps] = ts_kpps;
@@ -499,18 +499,18 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if (999000 < cycle && 1001000 > cycle) {
duration = 0;
unchanged = 0;
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS pps-detect on %s invisible pulse\n",
session->gpsdata.dev.path);
} else if (++unchanged == 10) {
/* not really unchanged, just out of bounds */
unchanged = 1;
- gpsd_report(&session->context->errout, LOG_WARN,
+ gpsd_log(&session->context->errout, LOG_WARN,
"PPS TIOCMIWAIT returns unchanged state, ppsmonitor sleeps 10\n");
(void)sleep(10);
}
} else {
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS pps-detect on %s changed to %d\n",
session->gpsdata.dev.path, state);
unchanged = 0;
@@ -519,7 +519,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
/* save this edge so we know next cycle time */
pulse[edge] = clock_ts;
timespec_str( &clock_ts, ts_str1, sizeof(ts_str1) );
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"PPS edge: %d, cycle: %7d uSec, duration: %7d uSec @ %s\n",
edge, cycle, duration, ts_str1);
if (unchanged) {
@@ -629,13 +629,13 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
char *log1 = NULL;
/* ppstimes.real is the time we think the pulse represents */
struct timedelta_t ppstimes;
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS edge accepted %.100s", log);
#ifndef S_SPLINT_S
#if defined(HAVE_SYS_TIMEPPS_H)
if ( 0 <= session->pps_thread.kernelpps_handle && ok_kpps) {
/* use KPPS time */
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"KPPS using edge %d", edge_kpps );
/* pick the right edge */
if ( edge_kpps ) {
@@ -674,14 +674,14 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
/*@+compdef@*/
if ( 0> delay.tv_sec || 0 > delay.tv_nsec ) {
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS: system clock went backwards: %.20s\n",
delay_str);
log1 = "system clock went backwards";
} else if ( ( 2 < delay.tv_sec)
|| ( 1 == delay.tv_sec && 100000000 > delay.tv_nsec ) ) {
/* system clock could be slewing so allow 1.1 sec delay */
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS: no current GPS seconds: %.20s\n",
delay_str);
log1 = "timestamp out of range";
@@ -699,7 +699,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_lock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -712,14 +712,14 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_unlock() : %s\n", errbuf);
}
/*@ +unrecog @*/
/*@-type@*/ /* splint is confused about struct timespec */
timespec_str( &ppstimes.clock, ts_str1, sizeof(ts_str1) );
timespec_str( &ppstimes.real, ts_str2, sizeof(ts_str2) );
- gpsd_report(&session->context->errout, LOG_INF,
+ gpsd_log(&session->context->errout, LOG_INF,
"PPS hooks called with %.20s clock: %s real: %s\n",
log1, ts_str1, ts_str2);
/*@+type@*/
@@ -729,26 +729,26 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
/*@-type@*/ /* splint is confused about struct timespec */
timespec_str( &clock_ts, ts_str1, sizeof(ts_str1) );
timespec_str( &offset, offset_str, sizeof(offset_str) );
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"PPS edge %.20s @ %s offset %.20s\n",
log1, ts_str1, offset_str);
/*@+type@*/
/*@+compdef@*/
} else {
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS edge rejected %.100s", log);
}
}
#if defined(HAVE_SYS_TIMEPPS_H)
if (session->pps_thread.kernelpps_handle > 0) {
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"PPS descriptor cleaned up\n");
(void)time_pps_destroy(session->pps_thread.kernelpps_handle);
}
#endif
if (session->pps_thread.wrap_hook != NULL)
session->pps_thread.wrap_hook(session);
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"PPS gpsd_ppsmonitor exited.\n");
return NULL;
}
@@ -767,14 +767,14 @@ void pps_thread_activate(struct gps_device_t *session)
/* some operations in init_kernel_pps() require root privs */
(void)init_kernel_pps( session );
if ( 0 <= session->pps_thread.kernelpps_handle ) {
- gpsd_report(&session->context->errout, LOG_WARN,
+ gpsd_log(&session->context->errout, LOG_WARN,
"KPPS kernel PPS will be used\n");
}
#endif
/*@-compdef -nullpass@*/
retval = pthread_create(&pt, NULL, gpsd_ppsmonitor, (void *)session);
/*@+compdef +nullpass@*/
- gpsd_report(&session->context->errout, LOG_PROG, "PPS thread %s\n",
+ gpsd_log(&session->context->errout, LOG_PROG, "PPS thread %s\n",
(retval==0) ? "launched" : "FAILED");
}
@@ -796,7 +796,7 @@ void pps_thread_stash_fixtime(struct gps_device_t *session,
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_lock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -807,7 +807,7 @@ void pps_thread_stash_fixtime(struct gps_device_t *session,
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_unlock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -825,7 +825,7 @@ int pps_thread_lastpps(struct gps_device_t *session, struct timedelta_t *td)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf,(int) sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_lock() : %s\n", errbuf);
}
/*@ +unrecog @*/
@@ -836,7 +836,7 @@ int pps_thread_lastpps(struct gps_device_t *session, struct timedelta_t *td)
if ( 0 != pthread_err ) {
char errbuf[BUFSIZ] = "unknown error";
(void)strerror_r(errno, errbuf, (int)sizeof(errbuf));
- gpsd_report(&session->context->errout, LOG_ERROR,
+ gpsd_log(&session->context->errout, LOG_ERROR,
"PPS: pthread_mutex_unlock() : %s\n", errbuf);
}
/*@ +unrecog @*/
diff --git a/serial.c b/serial.c
index 0c76b36e..df6f9040 100644
--- a/serial.c
+++ b/serial.c
@@ -241,8 +241,8 @@ bool gpsd_set_raw(struct gps_device_t * session)
{
(void)cfmakeraw(&session->ttyset);
if (tcsetattr(session->gpsdata.gps_fd, TCIOFLUSH, &session->ttyset) == -1) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "error changing port attributes: %s\n", strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "error changing port attributes: %s\n", strerror(errno));
return false;
}
@@ -374,10 +374,10 @@ void gpsd_set_speed(struct gps_device_t *session,
(void)usleep(200000);
(void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH);
}
- gpsd_report(&session->context->errout, LOG_INF,
- "speed %u, %d%c%d\n",
- gpsd_get_speed(session), 9 - stopbits, parity,
- stopbits);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "speed %u, %d%c%d\n",
+ gpsd_get_speed(session), 9 - stopbits, parity,
+ stopbits);
session->gpsdata.dev.baudrate = (unsigned int)speed;
session->gpsdata.dev.parity = parity;
@@ -420,13 +420,13 @@ int gpsd_serial_open(struct gps_device_t *session)
if (session->context->readonly
|| (session->sourcetype <= source_blockdev)) {
mode = (mode_t) O_RDONLY;
- gpsd_report(&session->context->errout, LOG_INF,
- "opening read-only GPS data source type %d and at '%s'\n",
- (int)session->sourcetype, session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "opening read-only GPS data source type %d and at '%s'\n",
+ (int)session->sourcetype, session->gpsdata.dev.path);
} else {
- gpsd_report(&session->context->errout, LOG_INF,
- "opening GPS data source type %d at '%s'\n",
- (int)session->sourcetype, session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_INF,
+ "opening GPS data source type %d at '%s'\n",
+ (int)session->sourcetype, session->gpsdata.dev.path);
}
/*@ +boolops +type @*/
#ifdef ENABLE_BLUEZ
@@ -441,19 +441,19 @@ int gpsd_serial_open(struct gps_device_t *session)
if (connect(session->gpsdata.gps_fd, (struct sockaddr *) &addr, sizeof (addr)) == -1) {
if (errno != EINPROGRESS && errno != EAGAIN) {
(void)close(session->gpsdata.gps_fd);
- gpsd_report(&session->context->errout, LOG_ERROR,
- "bluetooth socket connect failed: %s\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "bluetooth socket connect failed: %s\n",
+ strerror(errno));
return -1;
}
- gpsd_report(&session->context->errout, LOG_ERROR,
- "bluetooth socket connect in progress or again : %s\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "bluetooth socket connect in progress or again : %s\n",
+ strerror(errno));
}
(void)fcntl(session->gpsdata.gps_fd, F_SETFL, (int)mode);
- gpsd_report(&session->context->errout, LOG_PROG,
- "bluez device open success: %s %s\n",
- session->gpsdata.dev.path, strerror(errno));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "bluez device open success: %s %s\n",
+ session->gpsdata.dev.path, strerror(errno));
} else
#endif /* BLUEZ */
{
@@ -463,20 +463,20 @@ int gpsd_serial_open(struct gps_device_t *session)
*/
if ((session->gpsdata.gps_fd =
open(session->gpsdata.dev.path, (int)(mode | O_NONBLOCK | O_NOCTTY))) == -1) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "device open failed: %s - retrying read-only\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "device open failed: %s - retrying read-only\n",
+ strerror(errno));
if ((session->gpsdata.gps_fd =
open(session->gpsdata.dev.path, O_RDONLY | O_NONBLOCK | O_NOCTTY)) == -1) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "read-only device open failed: %s\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "read-only device open failed: %s\n",
+ strerror(errno));
return -1;
}
- gpsd_report(&session->context->errout, LOG_PROG,
- "file device open success: %s\n",
- strerror(errno));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "file device open success: %s\n",
+ strerror(errno));
}
}
@@ -506,9 +506,9 @@ int gpsd_serial_open(struct gps_device_t *session)
* Don't touch devices already opened by another process.
*/
if (fusercount(session->gpsdata.dev.path) > 1) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "%s already opened by another process\n",
- session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_ERROR,
+ "%s already opened by another process\n",
+ session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
session->gpsdata.gps_fd = -1;
return -1;
@@ -588,9 +588,9 @@ int gpsd_serial_open(struct gps_device_t *session)
session->gpsdata.dev.stopbits = 1;
}
- gpsd_report(&session->context->errout, LOG_SPIN,
- "open(%s) -> %d in gpsd_serial_open()\n",
- session->gpsdata.dev.path, session->gpsdata.gps_fd);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "open(%s) -> %d in gpsd_serial_open()\n",
+ session->gpsdata.dev.path, session->gpsdata.gps_fd);
return session->gpsdata.gps_fd;
}
@@ -608,10 +608,10 @@ ssize_t gpsd_serial_write(struct gps_device_t * session,
/* extra guard prevents expensive hexdump calls */
if (session->context->errout.debug >= LOG_IO) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
- gpsd_report(&session->context->errout, LOG_IO,
- "=> GPS: %s%s\n",
- gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
- (char *)buf, len), ok ? "" : " FAILED");
+ gpsd_log(&session->context->errout, LOG_IO,
+ "=> GPS: %s%s\n",
+ gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
+ (char *)buf, len), ok ? "" : " FAILED");
}
return status;
}
@@ -721,9 +721,9 @@ void gpsd_close(struct gps_device_t *session)
(void)tcsetattr(session->gpsdata.gps_fd, TCSANOW,
&session->ttyset_old);
}
- gpsd_report(&session->context->errout, LOG_SPIN,
- "close(%d) in gpsd_close(%s)\n",
- session->gpsdata.gps_fd, session->gpsdata.dev.path);
+ gpsd_log(&session->context->errout, LOG_SPIN,
+ "close(%d) in gpsd_close(%s)\n",
+ session->gpsdata.gps_fd, session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
session->gpsdata.gps_fd = -1;
}
diff --git a/shmexport.c b/shmexport.c
index 3b2f6d8f..4bfe750a 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -40,26 +40,27 @@ bool shm_acquire(struct gps_context_t *context)
int shmid = shmget((key_t)shmkey, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666));
if (shmid == -1) {
- gpsd_report(&context->errout, LOG_ERROR,
- "shmget(0x%lx, %zd, 0666) for SHM export failed: %s\n",
- shmkey,
- sizeof(struct gps_data_t),
- strerror(errno));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "shmget(0x%lx, %zd, 0666) for SHM export failed: %s\n",
+ shmkey,
+ sizeof(struct gps_data_t),
+ strerror(errno));
return false;
} else
- gpsd_report(&context->errout, LOG_PROG,
- "shmget(0x%lx, %zd, 0666) for SHM export succeeded\n",
- shmkey,
- sizeof(struct gps_data_t));
+ gpsd_log(&context->errout, LOG_PROG,
+ "shmget(0x%lx, %zd, 0666) for SHM export succeeded\n",
+ shmkey,
+ sizeof(struct gps_data_t));
context->shmexport = (void *)shmat(shmid, 0, 0);
if ((int)(long)context->shmexport == -1) {
- gpsd_report(&context->errout, LOG_ERROR, "shmat failed: %s\n", strerror(errno));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "shmat failed: %s\n", strerror(errno));
context->shmexport = NULL;
return false;
}
- gpsd_report(&context->errout, LOG_PROG,
- "shmat() for SHM export succeeded, segment %d\n", shmid);
+ gpsd_log(&context->errout, LOG_PROG,
+ "shmat() for SHM export succeeded, segment %d\n", shmid);
return true;
}
diff --git a/subframe.c b/subframe.c
index f0b24a4b..83f7cf21 100644
--- a/subframe.c
+++ b/subframe.c
@@ -21,8 +21,8 @@ gps_mask_t gpsd_interpret_subframe_raw(struct gps_device_t *session,
speed_t speed = gpsd_get_speed(session);
if (speed < 38400)
- gpsd_report(&session->context->errout, LOG_WARN,
- "speed less than 38,400 may cause data lag and loss of functionality\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "speed less than 38,400 may cause data lag and loss of functionality\n");
}
/*
@@ -43,20 +43,20 @@ gps_mask_t gpsd_interpret_subframe_raw(struct gps_device_t *session,
* word is inverted.
*
*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "50B: gpsd_interpret_subframe_raw: "
- "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
- words[0], words[1], words[2], words[3], words[4],
- words[5], words[6], words[7], words[8], words[9]);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "50B: gpsd_interpret_subframe_raw: "
+ "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ words[0], words[1], words[2], words[3], words[4],
+ words[5], words[6], words[7], words[8], words[9]);
preamble = (uint8_t)((words[0] >> 22) & 0xFF);
if (preamble == 0x8b) { /* preamble is inverted */
words[0] ^= 0x3fffffc0; /* invert */
} else if (preamble != 0x74) {
/* strangely this is very common, so don't log it */
- gpsd_report(&session->context->errout, LOG_DATA,
- "50B: gpsd_interpret_subframe_raw: bad preamble 0x%x\n",
- preamble);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "50B: gpsd_interpret_subframe_raw: bad preamble 0x%x\n",
+ preamble);
return 0;
}
words[0] = (words[0] >> 6) & 0xffffff;
@@ -72,9 +72,9 @@ gps_mask_t gpsd_interpret_subframe_raw(struct gps_device_t *session,
}
parity = (uint32_t)isgps_parity((isgps30bits_t)words[i]);
if (parity != (words[i] & 0x3f)) {
- gpsd_report(&session->context->errout, LOG_DATA,
- "50B: gpsd_interpret_subframe_raw parity fail words[%d] 0x%x != 0x%x\n",
- i, parity, (words[i] & 0x1));
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "50B: gpsd_interpret_subframe_raw parity fail words[%d] 0x%x != 0x%x\n",
+ i, parity, (words[i] & 0x1));
return 0;
}
words[i] = (words[i] >> 6) & 0xffffff;
@@ -126,22 +126,22 @@ static void subframe_almanac(const struct gpsd_errout_t *errout,
almp->af0 |= ((words[9] >> 2) & 0x000007);
almp->af0 = (short)uint2int(almp->af0, 11);
almp->d_af0 = pow(2.0,-20) * almp->af0;
- gpsd_report(errout, LOG_PROG,
- "50B: SF:%d SV:%2u TSV:%2u data_id %d e:%g toa:%lu "
- "deltai:%.10e Omegad:%.5e svh:%u sqrtA:%.10g Omega0:%.10e "
- "omega:%.10e M0:%.11e af0:%.5e af1:%.5e\n",
- subframe, almp->sv, tSVID, data_id,
- almp->d_eccentricity,
- almp->l_toa,
- almp->d_deltai,
- almp->d_Omegad,
- almp->svh,
- almp->d_sqrtA,
- almp->d_Omega0,
- almp->d_omega,
- almp->d_M0,
- almp->d_af0,
- almp->d_af1);
+ gpsd_log(errout, LOG_PROG,
+ "50B: SF:%d SV:%2u TSV:%2u data_id %d e:%g toa:%lu "
+ "deltai:%.10e Omegad:%.5e svh:%u sqrtA:%.10g Omega0:%.10e "
+ "omega:%.10e M0:%.11e af0:%.5e af1:%.5e\n",
+ subframe, almp->sv, tSVID, data_id,
+ almp->d_eccentricity,
+ almp->l_toa,
+ almp->d_deltai,
+ almp->d_Omegad,
+ almp->svh,
+ almp->d_sqrtA,
+ almp->d_Omega0,
+ almp->d_omega,
+ almp->d_M0,
+ almp->d_af0,
+ almp->d_af1);
/*@-matchanyintegral -shiftimplementation@*/
}
@@ -164,11 +164,11 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
/* FIXME!! I really doubt this is Big Endian compatible */
uint8_t preamble;
struct subframe_t *subp = &session->gpsdata.subframe;
- gpsd_report(&session->context->errout, LOG_DATA,
- "50B: gpsd_interpret_subframe: (%d) "
- "%06x %06x %06x %06x %06x %06x %06x %06x %06x %06x\n",
- tSVID, words[0], words[1], words[2], words[3], words[4],
- words[5], words[6], words[7], words[8], words[9]);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "50B: gpsd_interpret_subframe: (%d) "
+ "%06x %06x %06x %06x %06x %06x %06x %06x %06x %06x\n",
+ tSVID, words[0], words[1], words[2], words[3], words[4],
+ words[5], words[6], words[7], words[8], words[9]);
preamble = (uint8_t)((words[0] >> 16) & 0x0FF);
if (preamble == 0x8b) {
@@ -177,9 +177,9 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
words[0] ^= 0xffffff;
}
if (preamble != 0x74) {
- gpsd_report(&session->context->errout, LOG_WARN,
- "50B: gpsd_interpret_subframe bad preamble: 0x%x header 0x%x\n",
- preamble, words[0]);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "50B: gpsd_interpret_subframe bad preamble: 0x%x header 0x%x\n",
+ preamble, words[0]);
return 0;
}
subp->integrity = (bool)((words[0] >> 1) & 0x01);
@@ -190,11 +190,11 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->subframe_num = ((words[1] >> 2) & 0x07);
subp->alert = (bool)((words[1] >> 6) & 0x01);
subp->antispoof = (bool)((words[1] >> 6) & 0x01);
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:%d SV:%2u TOW17:%7lu Alert:%u AS:%u IF:%d\n",
- subp->subframe_num, subp->tSVID, subp->l_TOW17,
- (unsigned)subp->alert, (unsigned)subp->antispoof,
- (unsigned)subp->integrity);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:%d SV:%2u TOW17:%7lu Alert:%u AS:%u IF:%d\n",
+ subp->subframe_num, subp->tSVID, subp->l_TOW17,
+ (unsigned)subp->alert, (unsigned)subp->antispoof,
+ (unsigned)subp->integrity);
/*
* Consult the latest revision of IS-GPS-200 for the mapping
* between magic SVIDs and pages.
@@ -234,22 +234,22 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub1.d_af0 = pow(2.0, -31) * subp->sub1.af0;
subp->sub1.IODC <<= 8;
subp->sub1.IODC |= ((words[7] >> 16) & 0x00FF);
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:1 SV:%2u WN:%4u IODC:%4u"
- " L2:%u ura:%u hlth:%u L2P:%u Tgd:%g toc:%lu af2:%.4g"
- " af1:%.6e af0:%.7e\n",
- subp->tSVID,
- subp->sub1.WN,
- subp->sub1.IODC,
- subp->sub1.l2,
- subp->sub1.ura,
- subp->sub1.hlth,
- subp->sub1.l2p,
- subp->sub1.d_Tgd,
- subp->sub1.l_toc,
- subp->sub1.d_af2,
- subp->sub1.d_af1,
- subp->sub1.d_af0);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:1 SV:%2u WN:%4u IODC:%4u"
+ " L2:%u ura:%u hlth:%u L2P:%u Tgd:%g toc:%lu af2:%.4g"
+ " af1:%.6e af0:%.7e\n",
+ subp->tSVID,
+ subp->sub1.WN,
+ subp->sub1.IODC,
+ subp->sub1.l2,
+ subp->sub1.ura,
+ subp->sub1.hlth,
+ subp->sub1.l2p,
+ subp->sub1.d_Tgd,
+ subp->sub1.l_toc,
+ subp->sub1.d_af2,
+ subp->sub1.d_af1,
+ subp->sub1.d_af0);
break;
case 2:
/* subframe 2: ephemeris for transmitting SV */
@@ -279,22 +279,22 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub2.fit = ((words[9] >> 7) & 0x000001);
subp->sub2.AODO = ((words[9] >> 2) & 0x00001F);
subp->sub2.u_AODO = subp->sub2.AODO * 900;
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:2 SV:%2u IODE:%3u Crs:%.6e deltan:%.6e "
- "M0:%.11e Cuc:%.6e e:%f Cus:%.6e sqrtA:%.11g "
- "toe:%lu FIT:%u AODO:%5u\n",
- subp->tSVID,
- subp->sub2.IODE,
- subp->sub2.d_Crs,
- subp->sub2.d_deltan,
- subp->sub2.d_M0,
- subp->sub2.d_Cuc,
- subp->sub2.d_eccentricity,
- subp->sub2.d_Cus,
- subp->sub2.d_sqrtA,
- subp->sub2.l_toe,
- subp->sub2.fit,
- subp->sub2.u_AODO);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:2 SV:%2u IODE:%3u Crs:%.6e deltan:%.6e "
+ "M0:%.11e Cuc:%.6e e:%f Cus:%.6e sqrtA:%.11g "
+ "toe:%lu FIT:%u AODO:%5u\n",
+ subp->tSVID,
+ subp->sub2.IODE,
+ subp->sub2.d_Crs,
+ subp->sub2.d_deltan,
+ subp->sub2.d_M0,
+ subp->sub2.d_Cuc,
+ subp->sub2.d_eccentricity,
+ subp->sub2.d_Cus,
+ subp->sub2.d_sqrtA,
+ subp->sub2.l_toe,
+ subp->sub2.fit,
+ subp->sub2.u_AODO);
break;
case 3:
/* subframe 3: ephemeris for transmitting SV */
@@ -323,13 +323,13 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub3.IDOT = (int16_t)((words[9] >> 2) & 0x003FFF);
subp->sub3.IDOT = uint2int(subp->sub3.IDOT, 14);
subp->sub3.d_IDOT = pow(2.0, -43) * subp->sub3.IDOT;
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:3 SV:%2u IODE:%3u I IDOT:%.6g Cic:%.6e Omega0:%.11e "
- " Cis:%.7g i0:%.11e Crc:%.7g omega:%.11e Omegad:%.6e\n",
- subp->tSVID, subp->sub3.IODE, subp->sub3.d_IDOT,
- subp->sub3.d_Cic, subp->sub3.d_Omega0, subp->sub3.d_Cis,
- subp->sub3.d_i0, subp->sub3.d_Crc, subp->sub3.d_omega,
- subp->sub3.d_Omegad );
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:3 SV:%2u IODE:%3u I IDOT:%.6g Cic:%.6e Omega0:%.11e "
+ " Cis:%.7g i0:%.11e Crc:%.7g omega:%.11e Omegad:%.6e\n",
+ subp->tSVID, subp->sub3.IODE, subp->sub3.d_IDOT,
+ subp->sub3.d_Cic, subp->sub3.d_Omega0, subp->sub3.d_Cis,
+ subp->sub3.d_i0, subp->sub3.d_Crc, subp->sub3.d_omega,
+ subp->sub3.d_Omegad );
break;
case 4:
{
@@ -477,32 +477,32 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
}
/*@-charint@*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:4-13 data_id %d ai:%u "
- "ERD1:%d ERD2:%d ERD3:%d ERD4:%d "
- "ERD5:%d ERD6:%d ERD7:%d ERD8:%d "
- "ERD9:%d ERD10:%d ERD11:%d ERD12:%d "
- "ERD13:%d ERD14:%d ERD15:%d ERD16:%d "
- "ERD17:%d ERD18:%d ERD19:%d ERD20:%d "
- "ERD21:%d ERD22:%d ERD23:%d ERD24:%d "
- "ERD25:%d ERD26:%d ERD27:%d ERD28:%d "
- "ERD29:%d ERD30:%d\n",
- subp->data_id, subp->sub4_13.ai,
- subp->sub4_13.ERD[1], subp->sub4_13.ERD[2],
- subp->sub4_13.ERD[3], subp->sub4_13.ERD[4],
- subp->sub4_13.ERD[5], subp->sub4_13.ERD[6],
- subp->sub4_13.ERD[7], subp->sub4_13.ERD[8],
- subp->sub4_13.ERD[9], subp->sub4_13.ERD[10],
- subp->sub4_13.ERD[11], subp->sub4_13.ERD[12],
- subp->sub4_13.ERD[13], subp->sub4_13.ERD[14],
- subp->sub4_13.ERD[15], subp->sub4_13.ERD[16],
- subp->sub4_13.ERD[17], subp->sub4_13.ERD[18],
- subp->sub4_13.ERD[19], subp->sub4_13.ERD[20],
- subp->sub4_13.ERD[21], subp->sub4_13.ERD[22],
- subp->sub4_13.ERD[23], subp->sub4_13.ERD[24],
- subp->sub4_13.ERD[25], subp->sub4_13.ERD[26],
- subp->sub4_13.ERD[27], subp->sub4_13.ERD[28],
- subp->sub4_13.ERD[29], subp->sub4_13.ERD[30]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:4-13 data_id %d ai:%u "
+ "ERD1:%d ERD2:%d ERD3:%d ERD4:%d "
+ "ERD5:%d ERD6:%d ERD7:%d ERD8:%d "
+ "ERD9:%d ERD10:%d ERD11:%d ERD12:%d "
+ "ERD13:%d ERD14:%d ERD15:%d ERD16:%d "
+ "ERD17:%d ERD18:%d ERD19:%d ERD20:%d "
+ "ERD21:%d ERD22:%d ERD23:%d ERD24:%d "
+ "ERD25:%d ERD26:%d ERD27:%d ERD28:%d "
+ "ERD29:%d ERD30:%d\n",
+ subp->data_id, subp->sub4_13.ai,
+ subp->sub4_13.ERD[1], subp->sub4_13.ERD[2],
+ subp->sub4_13.ERD[3], subp->sub4_13.ERD[4],
+ subp->sub4_13.ERD[5], subp->sub4_13.ERD[6],
+ subp->sub4_13.ERD[7], subp->sub4_13.ERD[8],
+ subp->sub4_13.ERD[9], subp->sub4_13.ERD[10],
+ subp->sub4_13.ERD[11], subp->sub4_13.ERD[12],
+ subp->sub4_13.ERD[13], subp->sub4_13.ERD[14],
+ subp->sub4_13.ERD[15], subp->sub4_13.ERD[16],
+ subp->sub4_13.ERD[17], subp->sub4_13.ERD[18],
+ subp->sub4_13.ERD[19], subp->sub4_13.ERD[20],
+ subp->sub4_13.ERD[21], subp->sub4_13.ERD[22],
+ subp->sub4_13.ERD[23], subp->sub4_13.ERD[24],
+ subp->sub4_13.ERD[25], subp->sub4_13.ERD[26],
+ subp->sub4_13.ERD[27], subp->sub4_13.ERD[28],
+ subp->sub4_13.ERD[29], subp->sub4_13.ERD[30]);
break;
case 25:
@@ -556,39 +556,39 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub4_25.svhx[6] = ((words[9] >> 12) & 0x00003F);
subp->sub4_25.svhx[7] = ((words[9] >> 6) & 0x00003F);
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:4-25 data_id %d "
- "SV1:%u SV2:%u SV3:%u SV4:%u "
- "SV5:%u SV6:%u SV7:%u SV8:%u "
- "SV9:%u SV10:%u SV11:%u SV12:%u "
- "SV13:%u SV14:%u SV15:%u SV16:%u "
- "SV17:%u SV18:%u SV19:%u SV20:%u "
- "SV21:%u SV22:%u SV23:%u SV24:%u "
- "SV25:%u SV26:%u SV27:%u SV28:%u "
- "SV29:%u SV30:%u SV31:%u SV32:%u "
- "SVH25:%u SVH26:%u SVH27:%u SVH28:%u "
- "SVH29:%u SVH30:%u SVH31:%u SVH32:%u\n",
- subp->data_id,
- subp->sub4_25.svf[1], subp->sub4_25.svf[2],
- subp->sub4_25.svf[3], subp->sub4_25.svf[4],
- subp->sub4_25.svf[5], subp->sub4_25.svf[6],
- subp->sub4_25.svf[7], subp->sub4_25.svf[8],
- subp->sub4_25.svf[9], subp->sub4_25.svf[10],
- subp->sub4_25.svf[11], subp->sub4_25.svf[12],
- subp->sub4_25.svf[13], subp->sub4_25.svf[14],
- subp->sub4_25.svf[15], subp->sub4_25.svf[16],
- subp->sub4_25.svf[17], subp->sub4_25.svf[18],
- subp->sub4_25.svf[19], subp->sub4_25.svf[20],
- subp->sub4_25.svf[21], subp->sub4_25.svf[22],
- subp->sub4_25.svf[23], subp->sub4_25.svf[24],
- subp->sub4_25.svf[25], subp->sub4_25.svf[26],
- subp->sub4_25.svf[27], subp->sub4_25.svf[28],
- subp->sub4_25.svf[29], subp->sub4_25.svf[30],
- subp->sub4_25.svf[31], subp->sub4_25.svf[32],
- subp->sub4_25.svhx[0], subp->sub4_25.svhx[1],
- subp->sub4_25.svhx[2], subp->sub4_25.svhx[3],
- subp->sub4_25.svhx[4], subp->sub4_25.svhx[5],
- subp->sub4_25.svhx[6], subp->sub4_25.svhx[7]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:4-25 data_id %d "
+ "SV1:%u SV2:%u SV3:%u SV4:%u "
+ "SV5:%u SV6:%u SV7:%u SV8:%u "
+ "SV9:%u SV10:%u SV11:%u SV12:%u "
+ "SV13:%u SV14:%u SV15:%u SV16:%u "
+ "SV17:%u SV18:%u SV19:%u SV20:%u "
+ "SV21:%u SV22:%u SV23:%u SV24:%u "
+ "SV25:%u SV26:%u SV27:%u SV28:%u "
+ "SV29:%u SV30:%u SV31:%u SV32:%u "
+ "SVH25:%u SVH26:%u SVH27:%u SVH28:%u "
+ "SVH29:%u SVH30:%u SVH31:%u SVH32:%u\n",
+ subp->data_id,
+ subp->sub4_25.svf[1], subp->sub4_25.svf[2],
+ subp->sub4_25.svf[3], subp->sub4_25.svf[4],
+ subp->sub4_25.svf[5], subp->sub4_25.svf[6],
+ subp->sub4_25.svf[7], subp->sub4_25.svf[8],
+ subp->sub4_25.svf[9], subp->sub4_25.svf[10],
+ subp->sub4_25.svf[11], subp->sub4_25.svf[12],
+ subp->sub4_25.svf[13], subp->sub4_25.svf[14],
+ subp->sub4_25.svf[15], subp->sub4_25.svf[16],
+ subp->sub4_25.svf[17], subp->sub4_25.svf[18],
+ subp->sub4_25.svf[19], subp->sub4_25.svf[20],
+ subp->sub4_25.svf[21], subp->sub4_25.svf[22],
+ subp->sub4_25.svf[23], subp->sub4_25.svf[24],
+ subp->sub4_25.svf[25], subp->sub4_25.svf[26],
+ subp->sub4_25.svf[27], subp->sub4_25.svf[28],
+ subp->sub4_25.svf[29], subp->sub4_25.svf[30],
+ subp->sub4_25.svf[31], subp->sub4_25.svf[32],
+ subp->sub4_25.svhx[0], subp->sub4_25.svhx[1],
+ subp->sub4_25.svhx[2], subp->sub4_25.svhx[3],
+ subp->sub4_25.svhx[4], subp->sub4_25.svhx[5],
+ subp->sub4_25.svhx[6], subp->sub4_25.svhx[7]);
break;
case 33:
@@ -663,9 +663,9 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub4_17.str[i++] = (words[9] >> 8) & 0xff;
subp->sub4_17.str[i] = '\0';
/*@ +type @*/
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:4-17 system message: %.24s\n",
- subp->sub4_17.str);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:4-17 system message: %.24s\n",
+ subp->sub4_17.str);
break;
case 18:
case 56:
@@ -714,19 +714,19 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
/* leap second future */
subp->sub4_18.lsf = (int8_t)((words[9] >> 16) & 0x0000FF);
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:4-18 a0:%.5g a1:%.5g a2:%.5g a3:%.5g "
- "b0:%.5g b1:%.5g b2:%.5g b3:%.5g "
- "A1:%.11e A0:%.11e tot:%.5g WNt:%u "
- "ls: %d WNlsf:%u DN:%u, lsf:%d\n",
- subp->sub4_18.d_alpha0, subp->sub4_18.d_alpha1,
- subp->sub4_18.d_alpha2, subp->sub4_18.d_alpha3,
- subp->sub4_18.d_beta0, subp->sub4_18.d_beta1,
- subp->sub4_18.d_beta2, subp->sub4_18.d_beta3,
- subp->sub4_18.d_A1, subp->sub4_18.d_A0,
- subp->sub4_18.d_tot, subp->sub4_18.WNt,
- subp->sub4_18.leap, subp->sub4_18.WNlsf,
- subp->sub4_18.DN, subp->sub4_18.lsf);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:4-18 a0:%.5g a1:%.5g a2:%.5g a3:%.5g "
+ "b0:%.5g b1:%.5g b2:%.5g b3:%.5g "
+ "A1:%.11e A0:%.11e tot:%.5g WNt:%u "
+ "ls: %d WNlsf:%u DN:%u, lsf:%d\n",
+ subp->sub4_18.d_alpha0, subp->sub4_18.d_alpha1,
+ subp->sub4_18.d_alpha2, subp->sub4_18.d_alpha3,
+ subp->sub4_18.d_beta0, subp->sub4_18.d_beta1,
+ subp->sub4_18.d_beta2, subp->sub4_18.d_beta3,
+ subp->sub4_18.d_A1, subp->sub4_18.d_A0,
+ subp->sub4_18.d_tot, subp->sub4_18.WNt,
+ subp->sub4_18.leap, subp->sub4_18.WNlsf,
+ subp->sub4_18.DN, subp->sub4_18.lsf);
#ifdef TIMEHINT_ENABLE
/* IS-GPS-200 Revision E, paragraph 20.3.3.5.2.4 */
@@ -759,9 +759,9 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
&subp->sub4.almanac);
} else if ( -2 == sv ) {
/* unknown or secret page */
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:4-%d data_id %d\n",
- subp->pageid, subp->data_id);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:4-%d data_id %d\n",
+ subp->pageid, subp->data_id);
return 0;
}
/* else, already handled */
@@ -809,33 +809,33 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session,
subp->sub5_25.sv[22] = ((words[7] >> 12) & 0x00003F);
subp->sub5_25.sv[23] = ((words[7] >> 6) & 0x00003F);
subp->sub5_25.sv[24] = ((words[7] >> 0) & 0x00003F);
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:5-25 SV:%2u ID:%u toa:%lu WNa:%u "
- "SV1:%u SV2:%u SV3:%u SV4:%u "
- "SV5:%u SV6:%u SV7:%u SV8:%u "
- "SV9:%u SV10:%u SV11:%u SV12:%u "
- "SV13:%u SV14:%u SV15:%u SV16:%u "
- "SV17:%u SV18:%u SV19:%u SV20:%u "
- "SV21:%u SV22:%u SV23:%u SV24:%u\n",
- subp->tSVID, subp->data_id,
- subp->sub5_25.l_toa, subp->sub5_25.WNa,
- subp->sub5_25.sv[1], subp->sub5_25.sv[2],
- subp->sub5_25.sv[3], subp->sub5_25.sv[4],
- subp->sub5_25.sv[5], subp->sub5_25.sv[6],
- subp->sub5_25.sv[7], subp->sub5_25.sv[8],
- subp->sub5_25.sv[9], subp->sub5_25.sv[10],
- subp->sub5_25.sv[11], subp->sub5_25.sv[12],
- subp->sub5_25.sv[13], subp->sub5_25.sv[14],
- subp->sub5_25.sv[15], subp->sub5_25.sv[16],
- subp->sub5_25.sv[17], subp->sub5_25.sv[18],
- subp->sub5_25.sv[19], subp->sub5_25.sv[20],
- subp->sub5_25.sv[21], subp->sub5_25.sv[22],
- subp->sub5_25.sv[23], subp->sub5_25.sv[24]);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:5-25 SV:%2u ID:%u toa:%lu WNa:%u "
+ "SV1:%u SV2:%u SV3:%u SV4:%u "
+ "SV5:%u SV6:%u SV7:%u SV8:%u "
+ "SV9:%u SV10:%u SV11:%u SV12:%u "
+ "SV13:%u SV14:%u SV15:%u SV16:%u "
+ "SV17:%u SV18:%u SV19:%u SV20:%u "
+ "SV21:%u SV22:%u SV23:%u SV24:%u\n",
+ subp->tSVID, subp->data_id,
+ subp->sub5_25.l_toa, subp->sub5_25.WNa,
+ subp->sub5_25.sv[1], subp->sub5_25.sv[2],
+ subp->sub5_25.sv[3], subp->sub5_25.sv[4],
+ subp->sub5_25.sv[5], subp->sub5_25.sv[6],
+ subp->sub5_25.sv[7], subp->sub5_25.sv[8],
+ subp->sub5_25.sv[9], subp->sub5_25.sv[10],
+ subp->sub5_25.sv[11], subp->sub5_25.sv[12],
+ subp->sub5_25.sv[13], subp->sub5_25.sv[14],
+ subp->sub5_25.sv[15], subp->sub5_25.sv[16],
+ subp->sub5_25.sv[17], subp->sub5_25.sv[18],
+ subp->sub5_25.sv[19], subp->sub5_25.sv[20],
+ subp->sub5_25.sv[21], subp->sub5_25.sv[22],
+ subp->sub5_25.sv[23], subp->sub5_25.sv[24]);
} else {
/* unknown page */
- gpsd_report(&session->context->errout, LOG_PROG,
- "50B: SF:5-%d data_id %d uknown page\n",
- subp->pageid, subp->data_id);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "50B: SF:5-%d data_id %d uknown page\n",
+ subp->pageid, subp->data_id);
return 0;
}
break;
diff --git a/timebase.c b/timebase.c
index 395a3932..c44ed372 100644
--- a/timebase.c
+++ b/timebase.c
@@ -223,8 +223,8 @@ void gpsd_time_init(struct gps_context_t *context, time_t starttime)
context->rollovers = (int)((context->start_time-GPS_EPOCH) / GPS_ROLLOVER);
if (context->start_time < GPS_EPOCH)
- gpsd_report(&context->errout, LOG_ERROR,
- "system time looks bogus, dates may not be reliable.\n");
+ gpsd_log(&context->errout, LOG_ERROR,
+ "system time looks bogus, dates may not be reliable.\n");
else {
/* we've forced the UTC timezone, so this is actually UTC */
struct tm *now = localtime(&context->start_time);
@@ -236,9 +236,9 @@ void gpsd_time_init(struct gps_context_t *context, time_t starttime)
now->tm_year += 1900;
context->century = now->tm_year - (now->tm_year % 100);
(void)unix_to_iso8601((timestamp_t)context->start_time, scr, sizeof(scr));
- gpsd_report(&context->errout, LOG_INF,
- "startup at %s (%d)\n",
- scr, (int)context->start_time);
+ gpsd_log(&context->errout, LOG_INF,
+ "startup at %s (%d)\n",
+ scr, (int)context->start_time);
}
}
@@ -291,9 +291,9 @@ timestamp_t gpsd_utc_resolve(/*@in@*/struct gps_device_t *session)
if (session->newdata.time < (timestamp_t)session->context->start_time) {
char scr[128];
(void)unix_to_iso8601(session->newdata.time, scr, sizeof(scr));
- gpsd_report(&session->context->errout, LOG_WARN,
- "GPS week rollover makes time %s (%f) invalid\n",
- scr, session->newdata.time);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "GPS week rollover makes time %s (%f) invalid\n",
+ scr, session->newdata.time);
}
return t;
@@ -310,16 +310,16 @@ void gpsd_century_update(/*@in@*/struct gps_device_t *session, int century)
* certainly it means that a century mark has passed while
* gpsd was running, and we should trust the new ZDA year.
*/
- gpsd_report(&session->context->errout, LOG_WARN,
- "century rollover detected.\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "century rollover detected.\n");
session->context->century = century;
} else if (session->context->start_time >= GPS_EPOCH && century < session->context->century) {
/*
* This looks like a GPS week-counter rollover.
*/
- gpsd_report(&session->context->errout, LOG_WARN,
- "ZDA year less than clock year, "
- "probable GPS week rollover lossage\n");
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "ZDA year less than clock year, "
+ "probable GPS week rollover lossage\n");
session->context->valid &=~ CENTURY_VALID;
}
}
@@ -338,8 +338,8 @@ timestamp_t gpsd_gpstime_resolve(/*@in@*/struct gps_device_t *session,
* to 13 bits.
*/
if ((int)week < (session->context->gps_week & 0x3ff)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "GPS week 10-bit rollover detected.\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "GPS week 10-bit rollover detected.\n");
++session->context->rollovers;
}
diff --git a/timehint.c b/timehint.c
index d5d0ab5c..16788df2 100644
--- a/timehint.c
+++ b/timehint.c
@@ -130,23 +130,23 @@ static /*@null@*/ volatile struct shmTime *getShmTime(struct gps_context_t *cont
shmid = shmget((key_t) (NTPD_BASE + unit),
sizeof(struct shmTime), (int)(IPC_CREAT | perms));
if (shmid == -1) {
- gpsd_report(&context->errout, LOG_ERROR,
- "NTPD shmget(%ld, %zd, %o) fail: %s\n",
- (long int)(NTPD_BASE + unit), sizeof(struct shmTime),
- (int)perms, strerror(errno));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "NTPD shmget(%ld, %zd, %o) fail: %s\n",
+ (long int)(NTPD_BASE + unit), sizeof(struct shmTime),
+ (int)perms, strerror(errno));
return NULL;
}
p = (struct shmTime *)shmat(shmid, 0, 0);
/*@ -mustfreefresh */
if ((int)(long)p == -1) {
- gpsd_report(&context->errout, LOG_ERROR,
- "NTPD shmat failed: %s\n",
- strerror(errno));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "NTPD shmat failed: %s\n",
+ strerror(errno));
return NULL;
}
- gpsd_report(&context->errout, LOG_PROG,
- "NTPD shmat(%d,0,0) succeeded, segment %d\n",
- shmid, unit);
+ gpsd_log(&context->errout, LOG_PROG,
+ "NTPD shmat(%d,0,0) succeeded, segment %d\n",
+ shmid, unit);
return p;
/*@ +mustfreefresh */
}
@@ -233,7 +233,7 @@ int ntpshm_put(struct gps_device_t *session, volatile struct shmTime *shmseg, st
int precision = -1; /* default precision */
if (shmseg == NULL) {
- gpsd_report(&session->context->errout, LOG_RAW, "NTPD missing shm\n");
+ gpsd_log(&session->context->errout, LOG_RAW, "NTPD missing shm\n");
return 0;
}
@@ -249,11 +249,11 @@ int ntpshm_put(struct gps_device_t *session, volatile struct shmTime *shmseg, st
/*@-type@*/ /* splint is confused about struct timespec */
timespec_str( &td->real, real_str, sizeof(real_str) );
timespec_str( &td->clock, clock_str, sizeof(clock_str) );
- gpsd_report(&session->context->errout, LOG_RAW,
- "NTP ntpshm_put(%s %s) %s @ %s\n",
- session->gpsdata.dev.path,
- (precision == -20) ? "pps" : "clock",
- real_str, clock_str);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "NTP ntpshm_put(%s %s) %s @ %s\n",
+ session->gpsdata.dev.path,
+ (precision == -20) ? "pps" : "clock",
+ real_str, clock_str);
/*@+type@*/
return 1;
@@ -292,16 +292,16 @@ static void init_hook(struct gps_device_t *session)
}
if (access(chrony_path, F_OK) != 0) {
- gpsd_report(&session->context->errout, LOG_PROG,
- "PPS chrony socket %s doesn't exist\n", chrony_path);
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "PPS chrony socket %s doesn't exist\n", chrony_path);
} else {
session->pps_thread.chronyfd = netlib_localsocket(chrony_path, SOCK_DGRAM);
if (session->pps_thread.chronyfd < 0)
- gpsd_report(&session->context->errout, LOG_PROG,
- "PPS connect chrony socket failed: %s, error: %d, errno: %d/%s\n",
- chrony_path, session->pps_thread.chronyfd, errno, strerror(errno));
+ gpsd_log(&session->context->errout, LOG_PROG,
+ "PPS connect chrony socket failed: %s, error: %d, errno: %d/%s\n",
+ chrony_path, session->pps_thread.chronyfd, errno, strerror(errno));
else
- gpsd_report(&session->context->errout, LOG_RAW,
+ gpsd_log(&session->context->errout, LOG_RAW,
"PPS using chrony socket: %s\n", chrony_path);
}
}
@@ -338,9 +338,9 @@ static void chrony_send(struct gps_device_t *session, struct timedelta_t *td)
/*@-type@*/ /* splint is confused about struct timespec */
timespec_str( &td->real, real_str, sizeof(real_str) );
timespec_str( &td->clock, clock_str, sizeof(clock_str) );
- gpsd_report(&session->context->errout, LOG_RAW,
- "PPS chrony_send %s @ %s Offset: %0.9f\n",
- real_str, clock_str, sample.offset);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "PPS chrony_send %s @ %s Offset: %0.9f\n",
+ real_str, clock_str, sample.offset);
/*@+type@*/
(void)send(session->pps_thread.chronyfd, &sample, sizeof (sample), 0);
}
@@ -414,8 +414,8 @@ void ntpshm_link_activate(struct gps_device_t *session)
session->shm_clock = ntpshm_alloc(session->context);
if (session->shm_clock == NULL) {
- gpsd_report(&session->context->errout, LOG_INF,
- "NTPD ntpshm_alloc() failed\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "NTPD ntpshm_alloc() failed\n");
#if defined(PPS_ENABLE)
} else if (session->sourcetype == source_usb || session->sourcetype == source_rs232) {
/* We also have the 1pps capability, allocate a shared-memory segment
@@ -423,8 +423,8 @@ void ntpshm_link_activate(struct gps_device_t *session)
* transitions
*/
if ((session->shm_pps = ntpshm_alloc(session->context)) == NULL) {
- gpsd_report(&session->context->errout, LOG_INF,
- "NTPD ntpshm_alloc(1) failed\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "NTPD ntpshm_alloc(1) failed\n");
} else {
init_hook(session);
session->pps_thread.report_hook = report_hook;
diff --git a/valgrind-suppressions b/valgrind-suppressions
index d31a6098..3f7119bc 100644
--- a/valgrind-suppressions
+++ b/valgrind-suppressions
@@ -5,7 +5,7 @@
Memcheck:Cond
fun:strlen
fun:vsnprintf
- fun:gpsd_report
+ fun:gpsd_log
fun:main
}
{
@@ -13,7 +13,7 @@
Memcheck:Value8
fun:vfprintf
fun:vsnprintf
- fun:gpsd_report
+ fun:gpsd_log
fun:sirf_parse
fun:sirfbin_parse_input
fun:gpsd_poll
diff --git a/www/client-howto.txt b/www/client-howto.txt
index 6e58ee52..9699ca45 100644
--- a/www/client-howto.txt
+++ b/www/client-howto.txt
@@ -619,9 +619,9 @@ In major versions before 5:
'poll()' will at some point be reintroduced as an interface to the
wire-protocol POLL command.
-* Clients needed to define a gpsd_report() function for client-side logging
- if they didn't want code in netlib.c and libgps_core.c to occasionally
- send messages to stderr. This requirement is now gone.
+* Clients needed to define a hook for client-side logging if they
+ didn't want code in netlib.c and libgps_core.c to occasionally send
+ messages to stderr. This requirement is now gone.
* There was a set_raw_hook() method in the C and Python bindings, now gone.
C clients should call gps_data(); the buffer is available directly in Python.
diff --git a/www/writing-a-driver.xml b/www/writing-a-driver.xml
index 9cac39b3..c099834a 100644
--- a/www/writing-a-driver.xml
+++ b/www/writing-a-driver.xml
@@ -15,6 +15,16 @@
<revhistory>
<revision>
+ <revnumber>1.15</revnumber>
+ <date>7 Mar 2015</date>
+ <authorinitials>er</authorinitials>
+ <revremark>
+ Updated by esr; track a function rename. Text now fibs about
+ the original author thought the name was in order to avoid
+ confusing current readers.
+ </revremark>
+ </revision>
+ <revision>
<revnumber>1.13</revnumber>
<date>25 Aug 2014</date>
<authorinitials>er</authorinitials>
@@ -367,9 +377,10 @@ to experiment with the different commands and to swap between
the three modes (Oncore/Jupiter/NMEA). This is crude, but I found it hard
to get the right results with <function>minicom</function>.</para>
+<!-- ESR: gpsd_log had a different name when this was written -->
<para>To return to the development, I liberally
sprinkled the driver code with <quote>
-<function>gpsd_report</function></quote> statements set
+<function>gpsd_log</function></quote> statements set
to trigger at the lowest level of debugging and invoked the
daemon in <quote>non-daemon</quote> mode with
debugging set to LOG_WARN. This made sure that I could watch
@@ -817,8 +828,9 @@ the routines such as
<structfield>.trigger</structfield> along with some status
requests.</para>
+<!-- ESR: gpsd_log had a different name when this was written -->
<para>As I hinted earlier, I found that support code like <quote>
-<userinput>gpsd_report(LOG_WARN, "satellites tracked = %d, seen =
+<userinput>gpsd_log(..., LOG_WARN, "satellites tracked = %d, seen =
%d\n", tracked, seen);</userinput></quote> was very helpful in the
early stages. Once the driver reached a production stage, much of the
support code was removed and that which was retained had the first
@@ -934,8 +946,9 @@ I looped again if the timer had not expired. If I encountered an
error when reading the port I exited. All exits returned a
success/fail value.</para>
+<!-- ESR: gpsd_log had a different name when this was written -->
<para>This worked better, but still failed occasionally. I then used
-the <quote><function>gpsd_report</function></quote> to check the
+the <quote><function>gpsd_log</function></quote> to check the
error returned and I saw that I was getting lots of <quote>EAGAIN</quote>
errors. This suggested that the port was not able to handle all my
read requests, so I suspected the rate of reading was too fast. Not knowing