diff options
| author | Bdale Garbee <bdale@gag.com> | 2016-05-06 17:59:39 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2016-05-06 17:59:39 -0600 | 
| commit | ac7be4a40df88ee3a0992e041635e4ac4cf5ac48 (patch) | |
| tree | ee3c747b2ee98b772e02dce604b58878e9336def /altoslib/AltosIdleFetch.java | |
| parent | b53c78e75879d647935a30acb88fdd69467617a7 (diff) | |
| parent | ce4c8a8ad57515e851207b0a82f3af791bb30d3e (diff) | |
Merge branch 'master' into branch-1.6
Diffstat (limited to 'altoslib/AltosIdleFetch.java')
| -rw-r--r-- | altoslib/AltosIdleFetch.java | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/altoslib/AltosIdleFetch.java b/altoslib/AltosIdleFetch.java index 48db6ab4..0095bb73 100644 --- a/altoslib/AltosIdleFetch.java +++ b/altoslib/AltosIdleFetch.java @@ -15,7 +15,7 @@   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.   */ -package org.altusmetrum.altoslib_9; +package org.altusmetrum.altoslib_10;  import java.io.*;  import java.util.*; @@ -40,7 +40,7 @@ class AltosIdler {  	static final int	idle_sensor_tmini = 14;  	static final int	idle_sensor_tgps = 15; -	public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException, TimeoutException { +	public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException, TimeoutException, AltosUnknownProduct {  		for (int idler : idlers) {  			AltosIdle idle = null;  			switch (idler) { @@ -137,8 +137,9 @@ public class AltosIdleFetch implements AltosStateUpdate {  	double			frequency;  	String			callsign; -	public void update_state(AltosState state) throws InterruptedException { +	public void update_state(AltosState state) throws InterruptedException, AltosUnknownProduct {  		try { +			boolean	matched = false;  			/* Fetch config data from remote */  			AltosConfigData config_data = new AltosConfigData(link);  			state.set_state(AltosLib.ao_flight_stateless); @@ -150,9 +151,12 @@ public class AltosIdleFetch implements AltosStateUpdate {  			for (AltosIdler idler : idlers) {  				if (idler.matches(config_data)) {  					idler.update_state(state, link, config_data); +					matched = true;  					break;  				}  			} +			if (!matched) +				throw new AltosUnknownProduct(config_data.product);  			state.set_received_time(System.currentTimeMillis());  		} catch (TimeoutException te) {  		} | 
