altosdroid: initial implementation of telemetry logging.
[fw/altos] / altoslib / AltosTelemetryRecordRaw.java
index 43d0f17a4562456d54eeba072e01a20c6437cb1e..fbb373d54dcdfb9beaba3e3610150b255cd47ac2 100644 (file)
 
 package org.altusmetrum.AltosLib;
 
-import java.lang.*;
-import java.text.*;
-import java.util.HashMap;
-
 public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
        int[]   bytes;
        int     serial;
@@ -49,6 +45,10 @@ public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
                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);
        }
@@ -63,7 +63,7 @@ public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
        public AltosRecord update_state(AltosRecord previous) {
                AltosRecord     next;
                if (previous != null)
-                       next = new AltosRecord(previous);
+                       next = previous.clone();
                else
                        next = new AltosRecord();
                next.serial = serial;