how to report gps sv status

201 views
Skip to first unread message

liaoju...@gmail.com

unread,
Mar 18, 2009, 4:20:16 AM3/18/09
to android-porting
Hi,

I am working on porting gps and use NXP gps module for gps position.
It works fine, but i faced a problem that i can not report a correct
gps status data to GpsLocationProvider.java via gps_sv_status_callback
funtion. because in structure GpsSvStatus{
/** number of SVs currently visible */
int num_svs;

/** Array of space vehicle info */
GpsSvInfo sv_list[GPS_MAX_SVS];

/** bit mask indicating which SVs have ephemeris data */
uint32_t ephemeris_mask;

/** bit mask indicating which SVs have almanac data */
uint32_t almanac_mask;

/**
* bit mask indicating which SVs were used for
* computing the most recent position fix
*/
uint32_t used_in_fix_mask;
}, i do not know what a value i should give to
ephemeris_mask,almanac_mask,used_in_fix_mask.

I can get the gps data from the gps module, and bellow is my debug
info:
sending fix lat=22.5423 lon=113.946 altitude=-138.569 time=Wed Mar 18
07:32:17 2009
D/GpsLocationProvider( 700): reportLocation lat: 22.54233323461825
long: 113.94645713861372 timestamp: 1237361537
D/GpsLocationProvider( 700):
android_location_GpsLocationProvider_wait_for_event
Satellites in view count: 14, for used: 9
Satellites in view 0: prn: 9 , snr: 20.000000, ele:75.000000, azi:
97.000000 , for fix: 1
Satellites in view 1: prn: 21 , snr: 28.000000, ele:68.000000, azi:
275.000000 , for fix: 1
Satellites in view 2: prn: 24 , snr: 22.000000, ele:52.000000, azi:
168.000000 , for fix: 1
Satellites in view 3: prn: 18 , snr: 23.000000, ele:40.000000, azi:
331.000000 , for fix: 1
Satellites in view 4: prn: 15 , snr: 18.000000, ele:28.000000, azi:
39.000000 , for fix: 1
Satellites in view 5: prn: 26 , snr: 24.000000, ele:19.000000, azi:
42.000000 , for fix: 0
Satellites in view 6: prn: 27 , snr: 22.000000, ele:16.000000, azi:
39.000000 , for fix: 1
Satellites in view 7: prn: 5 , snr: 0.000000, ele:15.000000, azi:
159.000000 , for fix: 0
Satellites in view 8: prn: 22 , snr: 42.000000, ele:15.000000, azi:
311.000000 , for fix: 1
Satellites in view 9: prn: 12 , snr: 0.000000, ele:13.000000, azi:
148.000000 , for fix: 0
Satellites in view 10: prn: 14 , snr: 43.000000, ele:13.000000, azi:
256.000000 , for fix: 1
Satellites in view 11: prn: 10 , snr: 0.000000, ele:11.000000, azi:
104.000000 , for fix: 0
Satellites in view 12: prn: 29 , snr: 39.000000, ele:11.000000, azi:
203.000000 , for fix: 1
Satellites in view 13: prn: 30 , snr: 0.000000, ele:4.000000, azi:
180.000000 , for fix: 0
D/GpsLocationProvider( 700):
android_location_GpsLocationProvider_wait_for_event

Can anyone tell me how to give a correct value to
ephemeris_mask,almanac_mask and used_in_fix_mask that base on the
above debug info .

yschandra

unread,
Mar 18, 2009, 8:32:34 AM3/18/09
to android-porting

jun

unread,
Mar 18, 2009, 10:20:48 AM3/18/09
to android-porting
hi yschandra,

i can not access to the site : http://git.koolu.org/?p=freerunner/platform/hardware/gps.git;a=summary
can you paste some code at here. thanks.
> Check the code for Openmoko herehttp://git.koolu.org/?p=freerunner/platform/hardware/gps.git;a=summary- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Mike Lockwood

unread,
Mar 18, 2009, 10:48:57 AM3/18/09
to android...@googlegroups.com
The ephemeris_mask, almanac_mask and used_in_fix_mask are bit fields
based on the PRN for the satellites. The bit numbers are one less
than the PRN number, since the PRNs are numbered starting at 1.

For example, bit 0 of ephemeris_mask is set if we have ephemeris for
PRN 1, bit 1 is set if we have ephemeris for PRN 2, etc.

Mike
--
Mike Lockwood
Google android team

Marcelo

unread,
Mar 18, 2009, 11:22:59 AM3/18/09
to android...@googlegroups.com
2009/3/18 jun <liaoju...@gmail.com>:

> i can not access to the site : http://git.koolu.org/?p=freerunner/platform/hardware/gps.git;a=summary
> can you paste some code at here. thanks.

Sorry, that server was experiencing some trouble. It's back up again.

Marcelo

jun

unread,
Mar 19, 2009, 2:38:13 AM3/19/09
to android-porting
Marcelo,
I have got the code from the site, but there is a bug while give a
value to used_in_fix_mask with this sentence: used_in_fix_mask |=
(1ul << (32 - prn)), It should be: used_in_fix_mask |= (1ul <<
(prn-1)) .

On 3月18日, 下午11时22分, Marcelo <marcelo.magal...@gmail.com> wrote:
> 2009/3/18 jun <liaojunsh...@gmail.com>:

jun

unread,
Mar 19, 2009, 2:44:34 AM3/19/09
to android-porting
Mike Lockwood,

Thanks for you help. And can you tell me how to set ephemeris_mask and
almanac_mask since the gps receiver don't report which satellite has
ephemeris_mask and almanac_mask .

On 3月18日, 下午10时48分, Mike Lockwood <lockw...@android.com> wrote:
> The ephemeris_mask, almanac_mask and used_in_fix_mask are bit fields
> based on the PRN for the satellites. The bit numbers are one less
> than the PRN number, since the PRNs are numbered starting at 1.
>
> For example, bit 0 of ephemeris_mask is set if we have ephemeris for
> PRN 1, bit 1 is set if we have ephemeris for PRN 2, etc.
>
> Mike
>
> On Wed, Mar 18, 2009 at 4:20 AM, liaojunsh...@gmail.com
> Google android team- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Mike Lockwood

unread,
Mar 19, 2009, 8:07:38 AM3/19/09
to android...@googlegroups.com
I don't even know what GPS receiver you are using, so I can't answer
that. But if the information is not available then I would suggest
setting those fields to zero.

Mike

jun

unread,
Mar 19, 2009, 11:10:07 AM3/19/09
to android-porting
Mike,
I am using NXP gps module and its own LIB . The receiver can provides
me which satellites are used for fix position as you have seen the
debug info at the top.I have checked with NXP engineer, and they said
every satellites has ephemeris and almanac. So do i need to set the
fields which satellites are in view or just set the fields that are
used for fix ?

Many Thanks, Mike !
Reply all
Reply to author
Forward
0 new messages