PDA

View Full Version : Accessing GPS device from qt desktop(windows) App



newtolinux
2nd November 2010, 05:47
Hi...I want develop a qt desktop application which uses the external gps device attached to my desktop(windows xp). My question is can i access the device from a desktop app( I wanted to use qtmobility apis). How qt knows what type of gps it is?or on which ports they are connected.? Will qt handle all these issues sothat i can directly use the apis irrespective of device type ,vendor and type of interface to my desktop.

tbscope
2nd November 2010, 06:19
Hi...I want develop a qt desktop application which uses the external gps device attached to my desktop(windows xp). My question is can i access the device from a desktop app
Yes, you can access a GPS device from a desktop application.


( I wanted to use qtmobility apis).
This will not be possible (most likely). The Qt Mobility libraries use other libraries already on the system such as a driver for the GPS device on the system.


How qt knows what type of gps it is?
Qt doesn't know, you need to find that out yourself. See answer below.


or on which ports they are connected.?
Qt doesn't know, you need to find that out yourself. See answer below.


Will qt handle all these issues sothat i can directly use the apis irrespective of device type ,vendor and type of interface to my desktop.
Qt will not handle GPS devices, except maybe on mobile devices where there are specific api's for that.

On the desktop you need to install a library (including an api) or device drivers (including an api) that you can use to talk to GPS or other devices.

newtolinux
2nd November 2010, 10:26
Thank you.

But if i write device specific code , then my application works only for particular gps device.But i want to make my app to support for multiple vendors. Any suggestions?

tbscope
2nd November 2010, 10:33
If you want them all, you either need to find a common standard or implement them all.

It would be nice if Qt would provide cross platform and cross vendor api's to everything and the kitchen sink. However, this is not doable.
The problem is that A uses their own protocols and api's, B uses their own. Hope for some standardisation.

Maybe there's a generic usb driver for such devices. Try searching for that.

In the end, this is a question that doesn't have a lot to do with Qt itself but more with the devices you want to use.

newtolinux
2nd November 2010, 10:43
Thank you very much for response

robertson1
2nd November 2010, 15:47
delete this, didnt read the question properly...

squidge
2nd November 2010, 18:26
The easiest way is to find a GPS which supports the NMEA 0183 standard. A large number of them do, so if your application supports that you can just use something like QextSerialPort or similar to talk to them.

wysota
2nd November 2010, 21:05
If you can get the device to talk to gpsd or something similar, it should be fairly easy to implement a QGeoPositionInfoSource subclass for it so that you can use the regular location API from QtMobility.