- AltosParse.word(words[i++], "SAT");
- 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();
- cc_gps_sat[chan].svid = AltosParse.parse_int(words[i++]);
- cc_gps_sat[chan].c_n0 = AltosParse.parse_int(words[i++]);
- }
+ if (i < words.length) {
+ AltosParse.word(words[i++], "SAT");
+ 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();
+ cc_gps_sat[chan].svid = AltosParse.parse_int(words[i++]);
+ /* Older versions included SiRF status bits */
+ if (version < 2)
+ i++;
+ cc_gps_sat[chan].c_n0 = AltosParse.parse_int(words[i++]);
+ }
+ } else
+ cc_gps_sat = new AltosGPS.AltosGPSSat[0];