4 * @author Toni Jussila <toni.jussila@fudeco.com>
5 * @copyright (c) 2010 Speed Freak team
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 #include "maemo5locationprivate.h"
11 #include "maemo5location.h"
14 *Default constructor of this class.
15 *@param QObject pointer to parent object. By default the value is NULL.
17 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
19 ptr = new Maemo5LocationPrivate(this);
21 connect(ptr, SIGNAL(agnss()), this, SIGNAL(agnss()));
22 connect(ptr, SIGNAL(awcp()), this, SIGNAL(awcp()));
23 connect(ptr, SIGNAL(locationUpdated()), this, SIGNAL(locationUpdated()));
24 connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
25 connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
26 connect(ptr, SIGNAL(gps_error(int)), this, SIGNAL(gps_error(int)));
27 connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
28 connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped()));
32 *Destructor of this class. Should be used to release all allocated resources.
34 Maemo5Location::~Maemo5Location()
42 void Maemo5Location::startPollingGPS()
50 void Maemo5Location::stopPollingGPS()
56 *Returns number of satellites in use.
58 int Maemo5Location::getSatellitesInUse()
60 return ptr->get_satellites_in_use();
64 *Returns number of satellites in view.
66 int Maemo5Location::getSatellitesInView()
68 return ptr->get_satellites_in_view();
72 *Returns average signal strength of satellites which are in use.
74 int Maemo5Location::getSignalStrength()
76 return ptr->get_signal_strength();
82 bool Maemo5Location::getGpsOnline()
84 return ptr->get_gps_online();
90 double Maemo5Location::getLatitude()
92 return ptr->get_lat();
98 double Maemo5Location::getLongitude()
100 return ptr->get_lon();
104 *Returns timestamp of the update in seconds.
106 double Maemo5Location::getTime()
108 return ptr->get_time();
112 *Returns time accuracy in seconds.
114 double Maemo5Location::getEpt()
116 return ptr->get_ept();
120 *Returns horizontal position accuracy in cm.
122 double Maemo5Location::getEph()
124 return ptr->get_eph();
128 *Returns fix altitude in meters.
130 double Maemo5Location::getAltitude()
132 return ptr->get_altitude();
136 *Returns altitude accuracy in meters.
138 double Maemo5Location::getEpv()
140 return ptr->get_epv();
144 *Returns direction of motion in degrees(0-359).
146 double Maemo5Location::getTrack()
148 return ptr->get_track();
152 *Returns track accuracy in degrees.
154 double Maemo5Location::getEpd()
156 return ptr->get_epd();
160 *Returns current speed in km/h.
162 double Maemo5Location::getSpeed()
164 return ptr->get_speed();
168 *Returns speed accuracy in km/h.
170 double Maemo5Location::getEps()
172 return ptr->get_eps();
176 *Returns current rate of climb in m/s.
178 double Maemo5Location::getClimb()
180 return ptr->get_climb();
184 *Returns climb accuracy in m/s.
186 double Maemo5Location::getEpc()
188 return ptr->get_epc();
192 *Returns distance between two points in kilometers.
193 *@param latitude of first point
194 *@param longitude of first point
195 *@param latitude of second point
196 *@param longitude of second point
198 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
200 return ptr->distance_between_two_points(latitude_s, longitude_s, latitude_f, longitude_f);