diff options
| author | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2013-05-16 00:36:23 -0600 | 
| commit | 02d111b1b53ef01fc6e9ab6c4bc60b8af1be0067 (patch) | |
| tree | 8356f4a019969ee99a45e264c87d38555cf316cc /altoslib/AltosTelemetryRecordRaw.java | |
| parent | 7a2e1f05adad990a6b161865267abf07ffec7a7e (diff) | |
| parent | 7699a55aed3a9a7daeb4c6a5a9a280f43edf455f (diff) | |
Merge branch 'branch-1.2' into debian
Diffstat (limited to 'altoslib/AltosTelemetryRecordRaw.java')
| -rw-r--r-- | altoslib/AltosTelemetryRecordRaw.java | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/altoslib/AltosTelemetryRecordRaw.java b/altoslib/AltosTelemetryRecordRaw.java index fbb373d5..f94789bb 100644 --- a/altoslib/AltosTelemetryRecordRaw.java +++ b/altoslib/AltosTelemetryRecordRaw.java @@ -15,13 +15,14 @@   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.   */ -package org.altusmetrum.AltosLib; +package org.altusmetrum.altoslib_1;  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 AltosRecord(); +			next = new AltosRecordNone();  		next.serial = serial;  		next.tick = tick; +		next.rssi = rssi;  		return next;  	}  | 
