projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Deal with TeleMetrum v2.0 MMA6555 being inverted
[fw/altos]
/
altoslib
/
AltosIdleFetch.java
diff --git
a/altoslib/AltosIdleFetch.java
b/altoslib/AltosIdleFetch.java
index 3e96f3b8e054ef993d6ab20d46a3bdabc11ce300..0095bb732899d81ffa445db1049bc5aece33efcb 100644
(file)
--- a/
altoslib/AltosIdleFetch.java
+++ b/
altoslib/AltosIdleFetch.java
@@
-40,7
+40,7
@@
class AltosIdler {
static final int idle_sensor_tmini = 14;
static final int idle_sensor_tgps = 15;
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) {
for (int idler : idlers) {
AltosIdle idle = null;
switch (idler) {
@@
-137,8
+137,9
@@
public class AltosIdleFetch implements AltosStateUpdate {
double frequency;
String callsign;
double frequency;
String callsign;
- public void update_state(AltosState state) throws InterruptedException {
+ public void update_state(AltosState state) throws InterruptedException
, AltosUnknownProduct
{
try {
try {
+ boolean matched = false;
/* Fetch config data from remote */
AltosConfigData config_data = new AltosConfigData(link);
state.set_state(AltosLib.ao_flight_stateless);
/* 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);
for (AltosIdler idler : idlers) {
if (idler.matches(config_data)) {
idler.update_state(state, link, config_data);
+ matched = true;
break;
}
}
break;
}
}
+ if (!matched)
+ throw new AltosUnknownProduct(config_data.product);
state.set_received_time(System.currentTimeMillis());
} catch (TimeoutException te) {
}
state.set_received_time(System.currentTimeMillis());
} catch (TimeoutException te) {
}