OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio


Welcome Guest ( Log In | Register )

> Problem With Qsocketnotifier, activated signal not called
post Nov 24 2006, 09:16 AM
Post #1

Group: Members
Posts: 80
Joined: 30-March 05
Member No.: 6,751


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?

Go to the top of the page
+Quote Post

Posts in this topic
ztep   Problem With Qsocketnotifier   Nov 24 2006, 09:16 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 23rd January 2017 - 04:42 AM