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 92a17018a6775566269e4c1c1ccd26c02f61b098..c3b368e26b47ce022f5e34068bf227e49d3bb7e1 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();