diff options
| author | Bdale Garbee <bdale@gag.com> | 2017-09-18 20:46:47 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2017-09-18 20:46:47 -0600 | 
| commit | 3ead5d54135003702f771191d2c53abb584d1695 (patch) | |
| tree | 03f812123642d41215fbc67ff6a308fb2906d77a /altoslib/AltosTelemetry.java | |
| parent | b94d18396f050b61a5671b4239d2a3eb9b7a835c (diff) | |
| parent | 216ea6388a75c46891dc4687a2eb0c97dc63b136 (diff) | |
Merge branch 'branch-1.8' into debian
Diffstat (limited to 'altoslib/AltosTelemetry.java')
| -rw-r--r-- | altoslib/AltosTelemetry.java | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/altoslib/AltosTelemetry.java b/altoslib/AltosTelemetry.java index 7d576942..f17e1171 100644 --- a/altoslib/AltosTelemetry.java +++ b/altoslib/AltosTelemetry.java @@ -38,6 +38,9 @@ public abstract class AltosTelemetry implements AltosDataProvider {  	/* Mark when we received the packet */  	long		received_time; +	/* Mark frequency packet was received on */ +	public double		frequency = AltosLib.MISSING; +  	static boolean cksum(int[] bytes) {  		int	sum = 0x5a;  		for (int i = 1; i < bytes.length - 1; i++) @@ -50,6 +53,8 @@ public abstract class AltosTelemetry implements AltosDataProvider {  		listener.set_serial(serial());  		if (listener.state == AltosLib.ao_flight_invalid)  			listener.set_state(AltosLib.ao_flight_startup); +		if (frequency != AltosLib.MISSING) +			listener.set_frequency(frequency);  		listener.set_tick(tick());  		listener.set_rssi(rssi(), status());  		listener.set_received_time(received_time); @@ -108,6 +113,10 @@ public abstract class AltosTelemetry implements AltosDataProvider {  		return telem;  	} +	public void set_frequency(double frequency) { +		this.frequency = frequency; +	} +  	public AltosTelemetry() {  		this.received_time = System.currentTimeMillis();  	}  | 
