Original Author Paul Laughton, 2011
Page 194
De Re BASIC!
o
latitude
o
longitude
o
altitude
o
bearing
o
speed
There are individual commands available to read each element of a location report. If you use separate
GPS commands to read different components of the location data, you don't know if the different
components came from the same location report. To be certain of consistent data, get all of the location
components from a single Gps.location command.
Gps.location {{<time_nvar>}, {<prov_svar>}, {<count_nvar}, {<acc_nvar>},
{<lat_nvar>}, {<long_nvar>}, {<alt_nvar>}, {<bear_nvar>}, {<speed_nvar>}}
Returns the data from a single GPS location report. It returns all of the data provided by all of the
individual GPS location component commands below, except that it does not return the satellite list of
the Gps.satellites command.
The parameters are all optional; use commas to indicate missing parameters (see Optional Parameters).
All of the parameters are variable names, so if any parameter is not provided, the corresponding data is
not returned.
The parameters are:
<time_nvar>: time of the location fix, in milliseconds since the epoch, as reported by Gps.time.
<prov_svar>: the location provider, as reported by Gps.provider.
<count_nvar>: the number of satellites used to generate the location fix, as reported by
Gps.satellites.
<acc_nvar>: an estimate of the accuracy of the location fix, in meters, as reported by
Gps.accuracy.
<lat_nvar>: current latitude, in decimal degrees, as reported by Gps.latitude.
<long_nvar>: current longitude, in decimal degrees, as reported by Gps.longitude.
<alt_nvar>: current altitude, in meters, as reported by Gps.altitude.
<bear_nvar>: current bearing, in compass degrees, as reported by Gps.bearing.
<speed_nvar>: current speed, in meters per second, as reported by Gps.speed.
Gps.time <nvar>
Returns the time of the last GPS fix in milliseconds since "the epoch", January 1, 1970, UTC.
Gps.provider <svar>
Returns the name of the location provider in <svar>. Normally this is "gps". The first time you read
location data, you get the last known location, which may come from either the GPS hardware or the
network location service. If it came from the network, this command returns "network". If neither
provider reported a last known location, the provider <svar> is the empty string, "".