ghbolivar / android-on-freerunner

Automatically exported from code.google.com/p/android-on-freerunner
0 stars 0 forks source link

GPS fix flag for satellites #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The fix flag for the satellites is wrong as the bits should be read from least 
significant to most significant.

Instead of 
    r->sv_status.used_in_fix_mask |= (1ul << (32 - prn));

it should be:
    r->sv_status.used_in_fix_mask |= (1ul << (prn-1));

You can see the effect of this in my reworked version of the YGPS GPS data 
visualisation app. You can download it here: 
http://www.yunnanexplorer.com/download/androidapps/

Patch is attached which should be applied to both cupcake and master.

Original issue reported on code.google.com by LudwigBr...@gmail.com on 17 Aug 2010 at 8:51

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Ludwig,

Thanks a lot for your input.

Have you tested your fix? Does it work for you?

Attached are patched binaries for those who like to validate.

Let us know if it works fine. We can ask Jim to review when it is functioning 
correctly.

Niels.

Original comment by niels.he...@gmail.com on 17 Aug 2010 at 12:03

Attachments:

GoogleCodeExporter commented 9 years ago
I have tested this on a complete build and it works. 
(I compared the visualisation in my YGPS with a Garmin device and they are the 
same. The wrong version reports fixes for satellites that are not in view.)

I actually wrote some of the original code in that file myself a longer while 
ago and introduced that error simply by not having any access to a 
specification of how this field was to be filled (least significant/most 
significant first). I had to make a guess and it was the wrong one.

There is some more supporting evidence here:
http://osdir.com/ml/android-porting/2009-03/msg00394.html

Original comment by LudwigBr...@gmail.com on 17 Aug 2010 at 1:00

GoogleCodeExporter commented 9 years ago
Hi Ludwig,

Thanks for your prompt feedback.

Jim, could you review the patch and see if this could be added to both Cupcake 
and Master? I had no issues applying the patch and compiling on a local tree.

Kind regards,

Niels.

Original comment by niels.he...@gmail.com on 17 Aug 2010 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by niels.he...@gmail.com on 17 Aug 2010 at 2:48