started_ = false;
}
+bool Location::hasFix() const
+{
+ if(!started_)
+ {
+ return false;
+ }
+
+ return (device_->status == LOCATION_GPS_DEVICE_STATUS_FIX);
+}
+
+double Location::getSignalStrength() const
+{
+ if(!hasFix())
+ {
+ return 0.0;
+ }
+
+ if(device_->satellites_in_view == 0)
+ {
+ return 0.0;
+ }
+
+ double val = (device_->satellites_in_use / static_cast<double>(device_->satellites_in_view)) * 100.0;
+
+ if(val > 100.0)
+ {
+ val = 100.0;
+ }
+
+ return val;
+}
+
void Location::setUnit(Location::Unit unit)
{
unit_ = unit;