TD reports "not-connected" when GPS has 0 sats
authorKeith Packard <keithp@keithp.com>
Tue, 6 Apr 2010 07:55:19 +0000 (00:55 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 6 Apr 2010 07:55:19 +0000 (00:55 -0700)
ao-tools/altosui/AltosGPS.java

index 92a1701..c3b368e 100644 (file)
@@ -108,7 +108,12 @@ public class AltosGPS {
                        gps_time = new AltosGPSTime();
                }
                AltosParse.word(words[i++], "SAT");
-               int tracking_channels = AltosParse.parse_int(words[i++]);
+               int tracking_channels = 0;
+               if (words[i].equals("not-connected"))
+                       tracking_channels = 0;
+               else
+                       tracking_channels = AltosParse.parse_int(words[i]);
+               i++;
                cc_gps_sat = new AltosGPS.AltosGPSSat[tracking_channels];
                for (int chan = 0; chan < tracking_channels; chan++) {
                        cc_gps_sat[chan] = new AltosGPS.AltosGPSSat();