diff options
| author | Keith Packard <keithp@keithp.com> | 2011-07-16 17:38:00 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-07-16 17:48:51 -0700 |
| commit | 941b90a4905e34936d24a25ca90ac04eb6f5a792 (patch) | |
| tree | 7a0e7000b813db31ab607fec4b781e4609839788 /altosui/AltosTelemetryRecordRaw.java | |
| parent | 7ef786276b5d5c7d17c3fe4f36aa41db61a9742f (diff) | |
altosui: Generalize and centralize telemetry constants, parse v0.8 telemetry
Move telemetry constants to Altos class, adding functions to compute
names and lengths. Generalize users of these values to use all of the
known values.
Add support for v0.8 TeleMetrum telemetry
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosTelemetryRecordRaw.java')
| -rw-r--r-- | altosui/AltosTelemetryRecordRaw.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/altosui/AltosTelemetryRecordRaw.java b/altosui/AltosTelemetryRecordRaw.java index e6c4cfc8..4b34f017 100644 --- a/altosui/AltosTelemetryRecordRaw.java +++ b/altosui/AltosTelemetryRecordRaw.java @@ -72,7 +72,7 @@ public class AltosTelemetryRecordRaw implements AltosTelemetryRecord { /* length, data ..., rssi, status, checksum -- 4 bytes extra */ switch (bytes.length) { - case Altos.ao_telemetry_split_len + 4: + case Altos.ao_telemetry_standard_len + 4: int type = Altos.uint8(bytes, 4 + 1); switch (type) { case packet_type_TM_sensor: @@ -94,7 +94,10 @@ public class AltosTelemetryRecordRaw implements AltosTelemetryRecord { break; } break; - case Altos.ao_telemetry_legacy_len + 4: + case Altos.ao_telemetry_0_9_len + 4: + r = new AltosTelemetryRecordLegacy(bytes, rssi, status); + break; + case Altos.ao_telemetry_0_8_len + 4: r = new AltosTelemetryRecordLegacy(bytes, rssi, status); break; default: |
