[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-users] unknown error on opening gps
From: |
Michael Aschauer |
Subject: |
[gpsd-users] unknown error on opening gps |
Date: |
Sun, 20 Sep 2015 13:41:09 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
I am trying to re-compile and run an older project on a new system and I
am running into an issue with libgps returning unknown error on opening
the device.
I am on Debian 8.0 with gpsd/libgps 3.11. The same code runs without an
issue on a range of older debian and ubuntu systems.
Also the gpsclient samples (gpsmon, gpslogger) seem to work - at least
open the device - quite fine.
Does anyone have a hint on what could be wrong here?
Here is brief example code snippet
<code>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <gps.h>
int main()
{
struct gps_data_t *gpsdata;
printf("Opening GPS....\n");
int ret = gps_open(NULL,NULL, gpsdata);
if (ret != 0) {
printf("gpsopen returned: %d\n",ret);
printf("errno: %d\n",errno);
printf("%s\n",gps_errstr(errno));
} else {
printf("success\n");
gps_close(gpsdata);
}
return 0;
}
</code>
and this is what it returns for me:
$ ./gps-test
Opening GPS....
gpsopen returned: -1
errno: 0
unknown error
thanks & best regards,
m,-
- [gpsd-users] unknown error on opening gps,
Michael Aschauer <=