[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] Shared Memory Client Example?

From: Kevin Russell
Subject: [gpsd-users] Shared Memory Client Example?
Date: Sat, 21 Dec 2013 23:10:28 -0000

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;
    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
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 -"
  <src>GPSD 3.6</src>
   <trkpt lat="45.452308" lon="-122.763872">
    <src>GPSD tag="75"</src>
^C  </trkseg>

Any suggestions appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]