| Last Modified On : | August 28, 2009 6:15 PM PDT |
Rate |
|
Gypsy has replaced gpsd as the GPS daemon for reporting location coordinates in Moblin 2.0. There are many reasons [1] as to why Gypsy may be considered an improvement over gpsd. This article will briefly describe what you can do, as a developer, with Gypsy. A complete API[2] and tutorial [3] are available at http://gypsy.freedesktop.org.
Gypsy is a convenient way for getting location information from a GPS device. Multiple client applications can connect to Gypsy, and Gypsy can connect to one or more GPS devices [4]. Gypsy can interact with both Bluetooth and Serial (direct connection) devices, and will parse the device's cryptic data [5] into clearer, programmer friendly values [6].
Developers interface directly with Gypsy by using its GLib API. Gypsy also has an open D-Bus API which can be controlled via Linux IPC (interprocess communication). This means that a location based application can be written in any language that supports [7] D-Bus communication, and can appropriately receive information from Gypsy.
One difference between Gypsy and gpsd is in how Gypsy organizes its information, using Glib Objects to encapsulate different types of data [8]:
GypsyPosition: holds position data (latitude, longitude, altitude)
GypsyCourse: reports velocity information, in the form of speed, direction, and climb
GypsyAccuracy: reports the estimated accuracy, also known as the Dilution of Precision (DOP) for position in the horizontal and vertical planes
GypsySatellite: contains data from each visible satellite, including the satellite ID # (PRN), elevation, azimuth, and signal-to-noise ratio (SNR)
Each Object uses a method / signal architecture. For example, GypsyPosition has a method gypsy_position_get_position(...) that you can call at anytime to receive the current position. The other approach would be to use GypsyPosition's “position-changed” signal. You can register your own callback method, and instead of continually polling Gypsy for updates, your application will be signaled anytime the position changes.
The default installation path for gypsy-daemon is /usr/libexec/gypsy-daemon. If you're using the GLib API, you'll need to make sure that the gypsy daemon is running before you try and use it. An added benefit of using the D-Bus API is that gypsy-daemon will automatically launch (if it isn't running already) the first time you make a call to it.
For debugging purposes, it might be useful to execute gypsy-daemon with a “--no-daemon” flag. This will keep the process inside the terminal and spit out debugging information.
Geoclue is a location service that is also included with Moblin 2.0. It uses multiple providers (like Gypsy, gpsd, Hostip, Geonames, etc...) to provide more than the Position/Velocity information given by Gypsy. It can also give Address information based upon your current location. Please see http://www.freedesktop.org/wiki/Software/GeoClue to find out more about Geoclue. If you liked this article, you might also read the author's article on Geoclue.
In a world where devices are becoming increasingly more mobile, location information is becoming a more integral part of a user's experience. Applications with location features are making it to a variety of different platforms, and are setting a new standard for mobile functionality. Look for Gypsy and Geoclue to carry this standard to Moblin 2.0-based netbooks, MIDs and smartphones.
$<CR><LF>
MRK,0<CR><LF>
ZDA,123336.8069,17,06,2001,13.0<CR><LF>
GLL,4916.45,N,12311.12,W,225444,A,*1D<CR><LF>[1]
VTG,218.7,T,2.38,H,0.18,V<CR><LF>
SGD,-1.0,G,-1.0,M<CR><LF>
SYS,3T,9<CR><LF>
ZEV,0.28745E-006<CR><LF>
NSV,2,00,000,00,0.0,00.0,00,00,D<CR><LF>
NSV,7,00,000,00,0.0,00.0,00,00,D<CR><LF>
NSV,28,00,000,00,0.0,00.0,00,00,N<CR><LF>
NSV,1,00,000,00,0.0,00.0,00,00,D<CR><LF>
NSV,13,00,000,00,0.0,00.0,00,00,D<CR><LF>
NSV,4,00,000,00,0.0,00.0,00,00,N<CR><LF>
NSV,25,00,000,00,0.0,00.0,00,00,N<CR><LF>
NSV,0,00,000,00,0.0,00.0,00,00,N<CR><LF>
NSV,11,00,000,00,0.0,00.0,00,00,D<CR><LF>
NSV,0,00,000,00,0.0,00.0,00,00,N<CR><LF>
method return sender=:1.26 -> dest=:1.25 reply_serial=2
int32 0 fields
int32 0 timestamp
double 0 latitude
double 0 longitude
double 0 altitude
struct {
int32 0 accuracy level
double 0 horizontal accuracy
double 0 vertical accuracy
}
[3] See Gypsy Tutorial
[4] See Gypsy's Design
[6] Sample D-Bus Gypsy Position Data (connecting through Geoclue):
[7] DBusBindings will list the different language bindings for D-Bus

English | 中文 | Русский | Français
Christopher Bird (Intel)
|