projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ao-usbload: Check target device name to avoid mis-flashing
[fw/altos]
/
altoslib
/
AltosIdleFetch.java
diff --git
a/altoslib/AltosIdleFetch.java
b/altoslib/AltosIdleFetch.java
index 6c0d130ba6571a876eec58cf95413f5572528ddb..8871e9cc1089d6c3aab624052962efa302a3f852 100644
(file)
--- a/
altoslib/AltosIdleFetch.java
+++ b/
altoslib/AltosIdleFetch.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
8
;
+package org.altusmetrum.altoslib_
11
;
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
@@
-40,7
+41,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) {
@@
-134,11
+135,9
@@
public class AltosIdleFetch implements AltosStateUpdate {
AltosLink link;
AltosLink link;
- 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);
@@
-147,12
+146,17
@@
public class AltosIdleFetch implements AltosStateUpdate {
state.set_ground_accel(config_data.accel_cal_plus);
state.set_accel_g(config_data.accel_cal_plus, config_data.accel_cal_minus);
state.set_product(config_data.product);
state.set_ground_accel(config_data.accel_cal_plus);
state.set_accel_g(config_data.accel_cal_plus, config_data.accel_cal_minus);
state.set_product(config_data.product);
+ state.set_firmware_version(config_data.version);
+ state.set_log_space(config_data.log_space);
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) {
}