> > The run method of QGPSComDevice is a huge do-while loop that basically > never goes to sleep. It is constantly polling for either a change of > stopLoop or data available on the serial io-device. > > As a consequence the thread is constantly 'active' using resources like > CPU time and consequently battery power. It is better to set up signals > that will wake up your event loop on serial data available (readyRead > signal on a QIODevice). Then you can have the run method enter the > thread eventloop with exec(). Qt will be smart and put the thread to > sleep and will get a kernel signal when there is something to read on > the serial port filedescriptor.
Ok. I get you now. You can use signals if you want, but at the bottom of the chain, there will always be a thread waiting for bytes coming in on the serial line, it's just the way it is, so I'm not convinced this will save CPU cycles or battery. But, as I said, if you think it's better, go on. > > Not all GPS'es use RS-232 as the datatransport layer. For example > bluetooth gps-es obviously use bluetooth. Not everything serial uses a RS232 port (RS232 is an electronic standard, defining voltage levels and so). Every bluetooth GPS uses a virtual serial port to communicate. AFAIK, there is no GPS specific service. My GPS is an external plain bluetooth one and it's the only way I can communicate with it. >From the gpsd main page: "gpsd is a service daemon that monitors one or more GPSes attached to a host computer through serial or USB ports" So, unless you use a usb GPS (an even usb is a serial protocol), there is simply no added value that I can think of to use gpsd (besides the fact that it is a Linux standard and that it is network enabled). But I maybe miss something... > > gpsd is certainly something unix-y. And yes, we most definitly want to > keep serial port access working :) Please verify that I didn't already > break something inadvertently! I could easily have! BTW. Can you send me a > gps-replay file so that at least I can keep checking that part? > > Sending you a NMEA file directly to your adress. - Chris -
_______________________________________________ Merkaartor mailing list [email protected] http://lists.openstreetmap.org/listinfo/merkaartor
