gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] Shared Memory Client Example?


From: Ed Simmons
Subject: Re: [gpsd-users] Shared Memory Client Example?
Date: Mon, 06 Jan 2014 08:32:20 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi Kevin,

Did you compile GPSD using the option that enables shared memory export? I fell foul of this once, you need to do something like

scons shm_export=yes

but I forget the exact naming. Scons -h (i think) gives you the whole list of possible options to pass to scons.

Best,
Ed

On 21/12/2013 23:10, Kevin Russell wrote:
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




reply via email to

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