diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-02 13:53:08 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-02 13:53:08 -0700 |
commit | 2dfc4bc92b11252f17103f28198a702a3fdc2b2d (patch) | |
tree | 8bceb5e35f4c40a8767da1926c0044dcfc36ee1c /altoslib/AltosConfigData.java | |
parent | 027b1470c7a2d007eaab5c8d49f772b0c7559b80 (diff) |
altosui: Add configuration UI for beeper tone
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConfigData.java')
-rw-r--r-- | altoslib/AltosConfigData.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index edaf4601..750faa71 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -70,6 +70,9 @@ public class AltosConfigData implements Iterable<String> { /* HAS_APRS */ public int aprs_interval; + /* HAS_BEEP */ + public int beep; + /* Storage info replies */ public int storage_size; public int storage_erase_unit; @@ -210,6 +213,8 @@ public class AltosConfigData implements Iterable<String> { aprs_interval = -1; + beep = -1; + storage_size = -1; storage_erase_unit = -1; stored_flight = 0; @@ -286,6 +291,9 @@ public class AltosConfigData implements Iterable<String> { /* HAS_APRS */ try { aprs_interval = get_int(line, "APRS interval:"); } catch (Exception e) {} + /* HAS_BEEP */ + try { beep = get_int(line, "Beeper setting:"); System.out.printf ("beeper now %d\n", beep); } catch (Exception e) {} + /* Storage info replies */ try { storage_size = get_int(line, "Storage size:"); } catch (Exception e) {} try { storage_erase_unit = get_int(line, "Storage erase unit:"); } catch (Exception e) {} @@ -409,8 +417,13 @@ public class AltosConfigData implements Iterable<String> { if (npyro > 0) pyros = source.pyros(); + /* HAS_APRS */ if (aprs_interval >= 0) aprs_interval = source.aprs_interval(); + + /* HAS_BEEP */ + if (beep >= 0) + beep = source.beep(); } public void set_values(AltosConfigValues dest) { @@ -449,6 +462,7 @@ public class AltosConfigData implements Iterable<String> { else dest.set_pyros(null); dest.set_aprs_interval(aprs_interval); + dest.set_beep(beep); } public void save(AltosLink link, boolean remote) throws InterruptedException, TimeoutException { @@ -515,6 +529,10 @@ public class AltosConfigData implements Iterable<String> { if (aprs_interval >= 0) link.printf("c A %d\n", aprs_interval); + /* HAS_BEEP */ + if (beep >= 0) + link.printf("c b %d\n", beep); + link.printf("c w\n"); link.flush_output(); } |