summaryrefslogtreecommitdiff
path: root/ao-tools/lib/cc-telem.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-11-15 16:20:18 -0800
committerKeith Packard <keithp@keithp.com>2009-11-15 16:20:18 -0800
commitb0d7e3f9c9322542e9b649bb6ad7f7e5bb99dffa (patch)
tree0f0fcefd67f4bef178ebd282f3151ba93564f55b /ao-tools/lib/cc-telem.c
parent524665fc221b0d483453c67b7211e282cebc8980 (diff)
Stop using SiRF state info.
With the switch to the skytraq GPS unit, we don't have the same level of detail in the GPS stream, so stop reporting that in the telemetry stream, in the UI and writing it to eeprom. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib/cc-telem.c')
-rw-r--r--ao-tools/lib/cc-telem.c17
1 files changed, 12 insertions, 5 deletions
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;