summaryrefslogtreecommitdiff
path: root/altosui/AltosTelemetryRecordRaw.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-12 14:58:34 -0700
committerKeith Packard <keithp@keithp.com>2011-08-13 18:46:12 -0700
commitc7f540330c040c521f9d7626009a406e704a5e41 (patch)
treeac56003938abefc4b0bedcd035f804da2682fae7 /altosui/AltosTelemetryRecordRaw.java
parent18369c58e62bc64b969a7cf8be3103aa33c6d4aa (diff)
altosui: Add companion support to the flight UI and CSV conversion
Shows the companion data in a new tab. Also put companion data into CSV file. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosTelemetryRecordRaw.java')
-rw-r--r--altosui/AltosTelemetryRecordRaw.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/altosui/AltosTelemetryRecordRaw.java b/altosui/AltosTelemetryRecordRaw.java
index 4b34f017..39b2ba07 100644
--- a/altosui/AltosTelemetryRecordRaw.java
+++ b/altosui/AltosTelemetryRecordRaw.java
@@ -33,6 +33,7 @@ public class AltosTelemetryRecordRaw implements AltosTelemetryRecord {
final static int packet_type_configuration = 0x04;
final static int packet_type_location = 0x05;
final static int packet_type_satellite = 0x06;
+ final static int packet_type_companion = 0x07;
final static int PKT_APPEND_STATUS_1_CRC_OK = (1 << 7);
final static int PKT_APPEND_STATUS_1_LQI_MASK = (0x7f);
@@ -89,6 +90,9 @@ public class AltosTelemetryRecordRaw implements AltosTelemetryRecord {
case packet_type_satellite:
r = new AltosTelemetryRecordSatellite(bytes);
break;
+ case packet_type_companion:
+ r = new AltosTelemetryRecordCompanion(bytes);
+ break;
default:
r = new AltosTelemetryRecordRaw(bytes);
break;
@@ -139,9 +143,11 @@ public class AltosTelemetryRecordRaw implements AltosTelemetryRecord {
public AltosRecord update_state(AltosRecord previous) {
AltosRecord next;
- if (previous != null)
+ if (previous != null) {
next = new AltosRecord(previous);
- else
+ while (tick < previous.tick)
+ tick += 65536;
+ } else
next = new AltosRecord();
next.serial = serial;
next.tick = tick;