hBasic Manual
GPS
command changes
|
Upgrade to Gnss
Older devices less than Android N (7) will still use
the deprecated GPS API.
For newer devices of Android N or greater, the library
calls will use the Gnss API (which also includes GPS)
for greater coverage and accuracy.
Gnss Constellations
Type |
Name |
Nation |
|
1
|
GPS
|
US |
|
2
|
SBAS |
Global |
|
3
|
GLONASS |
Russia |
|
4
|
QZSS |
Japan |
|
5
|
BEIDOU |
China |
|
6
|
GALILEO |
Europe |
|
7
|
IRNSS |
India |
|
About Satellite Bundles and inview
Satellite bundles are used in the updated sample
program f15_gps.bas.
You can get a count of satellites in view with
GPS.Status.
You can also get a list of satellites with GPS.Status or GPS.Satellites.
This is a list of bundle pointers with keys prn,
elevation, azimuth, snr and
infix.
If you provide a satellite list that was used before,
then any satellites in this list are not removed, they
are either updated (if they are in view), or (scrubbed
and) moved to the bottom of the list.
Therefore a reused list can get bigger and bigger,
depending on how many unique satellites were picked up
in the course of your run. This means that the list
size may or may not be the same as the last
GPS.Status inview
count.
About infix
This count can be obtained with either GPS.Status, GPS.Location or GPS.Satellites. These infix counts
are obtained from different libraries, so may not be in
sync with each other.
An infix count is the number of satellites that were in
view and used for a fix. This does not neccessarily
mean you get a fix. It usually takes 4 or more
satellites before you get a fix for data. Satellites
used for a fix will have their bundle key
"infix" set to 1.
|
PRN Number
Satellite bundles returned in the list by GPS.Status and GPS.Satellites still have a
" prn" key but it's value is replaced with an
hBasic unique number.
This is in order to accommodate multiple Gnss constellations, with the
first digit identifying the constellation type.
e.g 3023 identifies a satellite from the GLONASS
constellation.
The next 3 digits are described in
this Android document.
|
GPS.OPEN
Two new parameters were added.
GPS.OPEN {status_nvar},{time_nexp},{distance_nexp},{useNET_nexp},{useLAST_lexp,}
useNET sets
whether the scans will use the network provider or
not.
where
0 = Don't use
network provider (i.e just use GPS/Gnss provider)
1 = Use both
network provider and GPS/Gnss provider for each
scan.
2 = Only use
network provider (don't use GPS/Gnss provider).
other = default = 0 (same as
legacy).
Network provider can still get you
some data even if GPS/Gnss doesn't.
Note: The network provider still
needs 'location' enabled by the user.
useLAST is a
flag which remembers and uses the
last-known-location
(for the first scan only) of
GPS.Open.
where
0 = OFF, don't
use last known location (recommended)
1 = ON, use last
known location for first scan.
other = default = 0 (unlike
legacy)
If you don't get any readings, the last known
location just sticks, until you get a valid reading,
which can be confusing or worse mis-leading for your
next GPS.OPEN.
|
|