altosdroid: convert rogue files to unix line endings
[fw/altos] / altoslib / AltosTelemetryRecordRaw.java
index c21da6fc1cbe26f87eb480f0ecf6fce9477cc6f0..93d0ca504d5b642b21dbaf3a7a332ba31fcc2a7f 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.AltosLib;
+package org.altusmetrum.altoslib_2;
 
 public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
        int[]   bytes;
        int     serial;
        int     tick;
        int     type;
+       int     rssi;
 
        long    received_time;
 
@@ -53,21 +54,24 @@ public class AltosTelemetryRecordRaw extends AltosTelemetryRecord {
                return AltosLib.string(bytes, off + 1, l);
        }
 
-       public AltosTelemetryRecordRaw(int[] in_bytes) {
+       public AltosTelemetryRecordRaw(int[] in_bytes, int in_rssi) {
                bytes = in_bytes;
                serial = uint16(0);
                tick   = uint16(2);
                type   = uint8(4);
+               rssi   = in_rssi;
        }
 
        public AltosRecord update_state(AltosRecord previous) {
                AltosRecord     next;
-               if (previous != null)
+
+               if (previous != null && previous.serial == serial)
                        next = previous.clone();
                else
                        next = new AltosRecordNone();
                next.serial = serial;
                next.tick = tick;
+               next.rssi = rssi;
                return next;
        }