projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Clean everything, even if we don't have compilers
[fw/altos]
/
altoslib
/
AltosTelemetryRecordRaw.java
diff --git
a/altoslib/AltosTelemetryRecordRaw.java
b/altoslib/AltosTelemetryRecordRaw.java
index 43d0f17a4562456d54eeba072e01a20c6437cb1e..51dd704dc81c319477af3b4416ca4238829f97ca 100644
(file)
--- a/
altoslib/AltosTelemetryRecordRaw.java
+++ b/
altoslib/AltosTelemetryRecordRaw.java
@@
-17,10
+17,6
@@
package org.altusmetrum.AltosLib;
package org.altusmetrum.AltosLib;
-import java.lang.*;
-import java.text.*;
-import java.util.HashMap;
-
public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
int[] bytes;
int serial;
public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
int[] bytes;
int serial;
@@
-49,6
+45,10
@@
public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
return AltosLib.uint32(bytes, off + 1);
}
return AltosLib.uint32(bytes, off + 1);
}
+ public int int32(int off) {
+ return AltosLib.int32(bytes, off + 1);
+ }
+
public String string(int off, int l) {
return AltosLib.string(bytes, off + 1, l);
}
public String string(int off, int l) {
return AltosLib.string(bytes, off + 1, l);
}
@@
-62,10
+62,11
@@
public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
public AltosRecord update_state(AltosRecord previous) {
AltosRecord next;
public AltosRecord update_state(AltosRecord previous) {
AltosRecord next;
- if (previous != null)
- next = new AltosRecord(previous);
+
+ if (previous != null && previous.serial == serial)
+ next = previous.clone();
else
else
- next = new AltosRecord();
+ next = new AltosRecord
None
();
next.serial = serial;
next.tick = tick;
return next;
next.serial = serial;
next.tick = tick;
return next;