summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c61ec55)
raw | patch | inline | side by side (parent: c61ec55)
author | Nicolas JOURDEN <nicolas.jourden@laposte.net> | |
Thu, 3 Dec 2015 14:59:22 +0000 (15:59 +0100) | ||
committer | Nicolas JOURDEN <nicolas.jourden@laposte.net> | |
Thu, 3 Dec 2015 14:59:22 +0000 (15:59 +0100) |
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/gps.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index ebfc3ed5b10eb74b9c6ea01471174d5e2fadaab6..21cb1111b290dbf0f3dcc7474e6b61ff1503857c 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# Host "127.0.0.1"
# Port "2947"
# Timeout 0.015
-# PauseRead 10
-# PauseConnect 1
+# PauseConnect 5
#</Plugin>
#<Plugin hddtemp>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index ef8256bb80572872a16d85c54e198b0b8968618b..5193701dd88ab9e9a2c0208a167ccabb083b4449 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
=item B<dilution_of_precision>
-Vertical and horizontal dilution.
+Vertical and horizontal dilution (type instance "horizontal" or "vertical").
It should be between 0 and 3.
-Look at the documentaiton of your GPS to know more.
+Look at the documentation of your GPS to know more.
=back
Port "2947"
# 15 ms timeout
Timeout 0.015
- # PauseRead of 5 sec. between readings:
- PauseRead 5
- # PauseConnect of 1 sec. between connection tentatives:
- PauseConnect 1
+ # PauseConnect of 5 sec. between connection attempts.
+ PauseConnect 5
</Plugin>
Available configuration options:
=item B<Host> I<Host>
-The host on which gpsd runs. Defaults to B<localhost>.
+The host on which gpsd daemon runs. Defaults to B<localhost>.
=item B<Port> I<Port>
Timeout in seconds (default 0.015 sec).
-=item B<PauseRead> I<Seconds>
+The GPS data stream is fetch by the plugin form the daemon.
+It waits for data to be available, if none arrives it times out
+and loop for another reading.
+Mind to put a low value gpsd expects value in the micro-seconds area (500 us) since
+the waiting function is blocking.
-Pause to apply between readings in seconds (default 1 sec).
+This only applies from gpsd release-2.95.
=item B<PauseConnect> I<Seconds>
-Pause to apply between tentative of connection in seconds (default 1 sec).
+Pause to apply between attempts of connection to gpsd in seconds (default 5 sec).
=back
diff --git a/src/gps.c b/src/gps.c
index d0cec6c42847a89dd2df56569a9f29dc875bb2e8..82d491892834ac522f2ca19539984e41583111ab 100644 (file)
--- a/src/gps.c
+++ b/src/gps.c
#define CGPS_TRUE 1
#define CGPS_FALSE 0
#define CGPS_DEFAULT_HOST "localhost"
-#define CGPS_DEFAULT_PORT "2947"
+#define CGPS_DEFAULT_PORT "2947" /* DEFAULT_GPSD_PORT */
#define CGPS_DEFAULT_TIMEOUT TIME_T_TO_CDTIME_T (0.015)
-#define CGPS_DEFAULT_PAUSE_READ TIME_T_TO_CDTIME_T (1)
#define CGPS_DEFAULT_PAUSE_CONNECT TIME_T_TO_CDTIME_T (5)
#define CGPS_MAX_ERROR 100
#define CGPS_CONFIG "?WATCH={\"enable\":true,\"json\":true,\"nmea\":false}\r\n"
char *host;
char *port;
cdtime_t timeout;
- cdtime_t pause_read;
cdtime_t pause_connect;
} cgps_config_t;
if (!gps_waiting (&gpsd_conn))
#endif
{
- if (cgps_thread_pause(cgps_config_data.pause_read) == CGPS_FALSE)
- {
- goto stop;
- }
-
continue;
}
cf_util_get_service (child, &cgps_config_data.port);
else if (strcasecmp ("Timeout", child->key) == 0)
cf_util_get_cdtime (child, &cgps_config_data.timeout);
- else if (strcasecmp ("Pauseread", child->key) == 0)
- cf_util_get_cdtime (child, &cgps_config_data.pause_read);
else if (strcasecmp ("PauseConnect", child->key) == 0)
cf_util_get_cdtime (child, &cgps_config_data.pause_connect);
else
return 0;
}
- DEBUG ("gps plugin: config{host: \"%s\", port: \"%s\", timeout: %.6f sec., \
-pause read: %.3f sec, pause connect: %.3f sec.}",
+ DEBUG ("gps plugin: config{host: \"%s\", port: \"%s\", timeout: %.6f sec., pause connect: %.3f sec.}",
cgps_config_data.host, cgps_config_data.port,
CDTIME_T_TO_DOUBLE (cgps_config_data.timeout),
- CDTIME_T_TO_DOUBLE (cgps_config_data.pause_read),
CDTIME_T_TO_DOUBLE (cgps_config_data.pause_connect));
status = plugin_thread_create (&cgps_thread_id, NULL, cgps_thread, NULL);
cgps_config_data.host = sstrdup (CGPS_DEFAULT_HOST);
cgps_config_data.port = sstrdup (CGPS_DEFAULT_PORT);
cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
- cgps_config_data.pause_read = CGPS_DEFAULT_PAUSE_READ;
cgps_config_data.pause_connect = CGPS_DEFAULT_PAUSE_CONNECT;
plugin_register_complex_config ("gps", cgps_config);