summaryrefslogtreecommitdiff
path: root/ao-tools
diff options
context:
space:
mode:
Diffstat (limited to 'ao-tools')
-rw-r--r--ao-tools/ao-postflight/ao-postflight.c4
-rw-r--r--ao-tools/lib/cc-logfile.c1
-rw-r--r--ao-tools/lib/cc-telem.c17
-rw-r--r--ao-tools/lib/cc.h1
4 files changed, 14 insertions, 9 deletions
diff --git a/ao-tools/ao-postflight/ao-postflight.c b/ao-tools/ao-postflight/ao-postflight.c
index 733eb38c..c12939aa 100644
--- a/ao-tools/ao-postflight/ao-postflight.c
+++ b/ao-tools/ao-postflight/ao-postflight.c
@@ -360,7 +360,7 @@ analyse_flight(struct cc_flightraw *f, FILE *summary_file, FILE *detail_file,
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++) {
fprintf (gps_file, " %12.7f", (double) f->gps.sats[j].sat[k].c_n);
- if (f->gps.sats[j].sat[k].state == 0xbf)
+ if (f->gps.sats[j].sat[k].svid != 0)
nsat++;
}
fprintf(gps_file, " %d\n", nsat);
@@ -381,7 +381,7 @@ analyse_flight(struct cc_flightraw *f, FILE *summary_file, FILE *detail_file,
}
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++)
- if (f->gps.sats[j].sat[k].state == 0xbf)
+ if (f->gps.sats[j].sat[k].svid != 0)
nsat++;
fprintf(kml_file, "%12.7f, %12.7f, %12.7f <!-- time %12.7f sats %d -->",
diff --git a/ao-tools/lib/cc-logfile.c b/ao-tools/lib/cc-logfile.c
index 3d346bcc..9d086c82 100644
--- a/ao-tools/lib/cc-logfile.c
+++ b/ao-tools/lib/cc-logfile.c
@@ -212,7 +212,6 @@ read_eeprom(const char *line, struct cc_flightraw *f, double *ground_pres, int *
case AO_LOG_GPS_SAT:
sat.time = tick;
sat.svid = a;
- sat.state = (b & 0xff);
sat.c_n = (b >> 8) & 0xff;
gpssat_add(&f->gps, &sat);
break;
diff --git a/ao-tools/lib/cc-telem.c b/ao-tools/lib/cc-telem.c
index 9a2f6155..ccd40ac2 100644
--- a/ao-tools/lib/cc-telem.c
+++ b/ao-tools/lib/cc-telem.c
@@ -178,18 +178,25 @@ cc_telem_parse(const char *input_line, struct cc_telem *telem)
}
if (tracking_pos >= 0 && nword >= tracking_pos + 2 && strcmp(words[tracking_pos], "SAT") == 0) {
int c, n, pos;
+ int per_sat;
+ int state;
+
+ if (version >= 2)
+ per_sat = 2;
+ else
+ per_sat = 3;
cc_parse_int(&n, words[tracking_pos + 1]);
pos = tracking_pos + 2;
- if (nword >= pos + n * 3) {
+ if (nword >= pos + n * per_sat) {
telem->gps_tracking.channels = n;
for (c = 0; c < n; c++) {
cc_parse_int(&telem->gps_tracking.sats[c].svid,
words[pos + 0]);
- cc_parse_hex(&telem->gps_tracking.sats[c].state,
- words[pos + 1]);
+ if (version < 2)
+ cc_parse_hex(&state, words[pos + 1]);
cc_parse_int(&telem->gps_tracking.sats[c].c_n0,
- words[pos + 2]);
- pos += 3;
+ words[pos + per_sat - 1]);
+ pos += per_sat;
}
} else {
telem->gps_tracking.channels = 0;
diff --git a/ao-tools/lib/cc.h b/ao-tools/lib/cc.h
index ebc0db7d..0e8ced8a 100644
--- a/ao-tools/lib/cc.h
+++ b/ao-tools/lib/cc.h
@@ -103,7 +103,6 @@ struct cc_gpselt {
struct cc_gpssat {
double time;
uint16_t svid;
- uint8_t state;
uint8_t c_n;
};