Add version numbers to java libraries
[fw/altos] / altoslib / AltosTelemetryRecordRaw.java
index 43d0f17a4562456d54eeba072e01a20c6437cb1e..a06348c19d2e379a3733b7cd0e2214b034d34834 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.AltosLib;
-
-import java.lang.*;
-import java.text.*;
-import java.util.HashMap;
+package org.altusmetrum.altoslib_1;
 
 public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
        int[]   bytes;
@@ -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);
        }
@@ -62,10 +62,11 @@ public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
 
        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
-                       next = new AltosRecord();
+                       next = new AltosRecordNone();
                next.serial = serial;
                next.tick = tick;
                return next;