I'm having trouble getting a basic client using shared memory
working. Does anyone have a working example? Any attempt to open
results in an error return "can't get host entry."
Here's an example of what I'm running into...
address@hidden ~/client $ cat client.c
#include <gps.h>
#include <stdlib.h>
#include <errno.h>
int main(void) {
int result;
struct gps_data_t data;
printf("Hello\n");
result = gps_open(GPSD_SHARED_MEMORY,0,&data);
printf("open returned %d %s\n",result,gps_errstr(errno));
if (result != 0) {
return 1;
}
result = gps_read(&data);
printf("read returned %d\n",result);
if (result != 0) {
return 1;
}
result = gps_close(&data);
printf("read returned %d\n",result);
if (result != 0) {
return 1;
}
}
address@hidden ~/client $ ./client
Hello
open returned -1 can't get host entry
address@hidden ~/client $ gpsd -V
gpsd: 3.6 (revision 3.6)
address@hidden ~/client $ uname -a
Linux raspberrypi 3.10.24+ #614 PREEMPT Thu Dec 19 20:38:42 GMT 2013
armv6l GNU/Linux
address@hidden ~/client $ /etc/init.d/gpsd status
[ ok ] gpsd is running.
address@hidden ~/client $ gpxlogger
<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.1" creator="GPSD 3.6 - http://catb.org/gpsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata>
<time>2013-12-21T23:01:34.000Z</time>
</metadata>
<trk>
<src>GPSD 3.6</src>
<trkseg>
<trkpt lat="45.452308" lon="-122.763872">
<ele>-4.268000</ele>
<time>2013-12-21T23:01:35.000Z</time>
<src>GPSD tag="75"</src>
<fix>3d</fix>
</trkpt>
^C </trkseg>
</trk>
</gpx>
Any suggestions appreciated.
Kevin