Page 1 of 1

GPS satellites count

Posted: 26 Feb 2017 08:15
by fagci
How can I get this?

Best regards.

Re: GPS satellites count

Posted: 26 Feb 2017 22:17
by Martin
Hi,

The variable satellites of trigger GPS Status Event should allow to determine this information.

Regards,
Martin

Re: GPS satellites count

Posted: 27 Feb 2017 01:38
by fagci
Wow! So informative information about satellites here!
I think it is about status only.

TY, Martin!

Re: GPS satellites count

Posted: 02 Mar 2017 15:05
by ewill
Is there a formula that you could suggest for getting the number of satellites used in fix?

Thank you in advance for the assistance.

Re: GPS satellites count

Posted: 02 Mar 2017 16:44
by fagci

Code: Select all

uif = 0;

satellitesList = newList();

for(s in satellites) {
  p = split(s, ';');
  satellite = newMap();
  for(pv in p) {
    kv = split(pv, '=');
    satellite[kv[0]] = eval(kv[1]);
  }
  addElement(satellitesList, satellite);
}
log(satellitesList);
for(s in satellitesList) {
  if(s['used_in_fix']) uif = uif + 1;
}

log(uif);
maybe eval() isn't necessary

Re: GPS satellites count

Posted: 02 Mar 2017 17:17
by ewill
Thank you very much for the assistance. I didn't realize that it would be that complex.

Re: GPS satellites count

Posted: 02 Mar 2017 17:29
by fagci
You can do it with fromJSON(), but it more complex...

If you want only satellites used in fix, you can use something like if(search(s, 'used_in_fix=true')){}