[Top][All Lists]

[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.


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;
    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]