diff options
author | Keith Packard <keithp@keithp.com> | 2010-07-03 17:42:36 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-07-14 19:10:04 -0700 |
commit | a9ec6be0e92dee01f7aac006ef6f7779c1da1b36 (patch) | |
tree | d509de151b0049301cea622e7777d1b11e53c861 /ao-tools/lib | |
parent | 62294ea3830d3ea261a8761edc9fa6f98201d321 (diff) |
Telemetry code was mis-computing RSSI
The RSSI data from the hardware reports in 1/2 dBm increments, and so
must be divided to report plain RSSI numbers.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib')
-rw-r--r-- | ao-tools/lib/cc-telem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ao-tools/lib/cc-telem.c b/ao-tools/lib/cc-telem.c index ccd40ac2..aa52b7c5 100644 --- a/ao-tools/lib/cc-telem.c +++ b/ao-tools/lib/cc-telem.c @@ -101,6 +101,10 @@ cc_telem_parse(const char *input_line, struct cc_telem *telem) telem->flight = 0; cc_parse_int(&telem->rssi, words[5]); + if (version <= 2) { + /* Older telemetry versions mis-computed the rssi value */ + telem->rssi = (telem->rssi + 74) / 2 - 74; + } cc_parse_string(telem->state, sizeof (telem->state), words[9]); cc_parse_int(&telem->tick, words[10]); cc_parse_int(&telem->accel, words[12]); |