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"
15 * Default constructor of this class.
17 * @param QObject pointer to parent object. By default the value is NULL.
19 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
21 qDebug() << "__Maemo5Location";
22 ptr = new Maemo5LocationPrivate(this);
24 connect(ptr, SIGNAL(agnss()), this, SIGNAL(agnss()));
25 connect(ptr, SIGNAL(awcp()), this, SIGNAL(awcp()));
26 connect(ptr, SIGNAL(locationUpdated()), this, SIGNAL(locationUpdated()));
27 connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
28 connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
29 connect(ptr, SIGNAL(gps_error(int)), this, SIGNAL(gps_error(int)));
30 connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
31 connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped()));
35 * Destructor of this class. Should be used to release all allocated resources.
37 Maemo5Location::~Maemo5Location()
39 qDebug() << "__~Maemo5Location";
47 void Maemo5Location::startPollingGPS()
49 qDebug() << "__Maemo5Location: startPollingGPS";
56 void Maemo5Location::stopPollingGPS()
58 qDebug() << "__Maemo5Location: stopPollingGPS";
63 * Get number of satellites in use.
65 * @return int satellites in use
67 int Maemo5Location::getSatellitesInUse()
69 return ptr->get_satellites_in_use();
73 * Get number of satellites in view.
75 * @return int satellites in view
77 int Maemo5Location::getSatellitesInView()
79 return ptr->get_satellites_in_view();
83 * Get average signal strength of satellites which are in use.
85 * @return int signal strength
87 int Maemo5Location::getSignalStrength()
89 return ptr->get_signal_strength();
95 * @return bool gps online
97 bool Maemo5Location::getGpsOnline()
99 return ptr->get_gps_online();
105 * @return double latitude
107 double Maemo5Location::getLatitude()
109 return ptr->get_lat();
115 * @return double longitude
117 double Maemo5Location::getLongitude()
119 return ptr->get_lon();
123 * Get timestamp of the update in seconds.
125 * @return double time
127 double Maemo5Location::getTime()
129 return ptr->get_time();
133 * Get time accuracy in seconds.
137 double Maemo5Location::getEpt()
139 return ptr->get_ept();
143 * Get horizontal position accuracy in cm.
147 double Maemo5Location::getEph()
149 return ptr->get_eph();
153 * Get fix altitude in meters.
155 * @return double altitude
157 double Maemo5Location::getAltitude()
159 return ptr->get_altitude();
163 * Get altitude accuracy in meters.
167 double Maemo5Location::getEpv()
169 return ptr->get_epv();
173 * Get direction of motion in degrees(0-359).
175 * @return double track
177 double Maemo5Location::getTrack()
179 return ptr->get_track();
183 * Get track accuracy in degrees.
187 double Maemo5Location::getEpd()
189 return ptr->get_epd();
193 * Get current speed in km/h.
195 * @return double speed
197 double Maemo5Location::getSpeed()
199 return ptr->get_speed();
203 * Get speed accuracy in km/h.
207 double Maemo5Location::getEps()
209 return ptr->get_eps();
213 * Get current rate of climb in m/s.
215 * @return double climb
217 double Maemo5Location::getClimb()
219 return ptr->get_climb();
223 * Get climb accuracy in m/s.
227 double Maemo5Location::getEpc()
229 return ptr->get_epc();
233 * Get distance between two points in kilometers.
235 * @param double latitude of first point
236 * @param double longitude of first point
237 * @param double latitude of second point
238 * @param double longitude of second point
239 * @return double distance
241 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
243 return ptr->distance_between_two_points(latitude_s, longitude_s, latitude_f, longitude_f);