Hi,
As part of my changes to qpegps I'm trying to use the latest version of gpsd using the high level interface throught libgps library.
All works quite well, I connect gpsd and I can read gps information if y I poll gpsd with a timer every 500 ms. The problem begins at this point:
my goal is to use a QSocketNotifier to know when there is new data form gpsd, so I created a object like this:
// create and connect the socket
gpsData->d_gpsData = gps_open(gpsData->host, strPort);
(void)::fcntl(gpsData->d_gpsData->gps_fd, F_SETFL, fcntl(gpsData->d_gpsData->gps_fd, F_GETFL)&~O_NONBLOCK);
gpsdNotifier = new QSocketNotifier(gpsData->d_gpsData->gps_fd, QSocketNotifier::Read, this);
connect(gpsdNotifier, SIGNAL(activated(int)), SLOT(gpsdData()));
I have got problems with this because the activated() signal is never called.
I have seen using "netstat -tc" that there is pending data in the socket.
I notice the following strange things:
- The socket descriptor given by gpsd is allwais 0. I know that this is a valid value, but is it not reserved for standar input?
- When I start qpegps from the shell (./qpegps) in order to see the messages from qDegug sentences, it starts to receive QSocketNotifier notifications after I press return on the shell (qpegps is the running process of that shell, that is I don't run in in background with &). After pressing return, all works ok.
Anyone knows how can I solve this problem?
Thanks.