diff options
author | Keith Packard <keithp@keithp.com> | 2014-01-21 21:34:58 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-01-21 21:34:58 -0800 |
commit | 677fcafd3816b6d8d86b2dc41b840d97b5ccbf07 (patch) | |
tree | 41e4e290033e69607a4f2072e46ee36f7f0a142c | |
parent | 13cf4000bd53ac4af66231d56e24c9eb11178a5f (diff) |
altoslib: Fetch target device config for Fire Igniter npyro value
The code was using the AltosLink config_data, which is always the
locally connected device's configuration. When using the packet link,
that's not terribly useful when asking how many extra pyro channels
are available.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosIgnite.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/altoslib/AltosIgnite.java b/altoslib/AltosIgnite.java index d3c21796..8ab47d1d 100644 --- a/altoslib/AltosIgnite.java +++ b/altoslib/AltosIgnite.java @@ -27,6 +27,7 @@ public class AltosIgnite { boolean link_started; boolean have_npyro = false; int npyro; + AltosConfigData config_data; public final static String None = null; public final static String Apogee = "drogue"; @@ -97,8 +98,12 @@ public class AltosIgnite { } private void get_npyro() throws InterruptedException, TimeoutException { - AltosConfigData config_data = link.config_data(); - npyro = config_data.npyro; + if (config_data == null) + config_data = new AltosConfigData(link); + if (config_data != null) + npyro = config_data.npyro; + else + npyro = 0; have_npyro = true; } |