diff options
author | Keith Packard <keithp@keithp.com> | 2015-02-06 04:45:17 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-02-06 04:45:17 -0800 |
commit | 66e7a8081c07d0d96a31ae34963d430f06dccdfb (patch) | |
tree | db49f2712df6883cb4049f84f0576ad28156287e /altoslib/AltosConfigData.java | |
parent | 14d524782af4f06d7f3722dcc852772ec493c2cc (diff) |
altoslib: Store MS5607 data in AltosConfigData for use by AltosMs5607
When doing 'Monitor Idle', we fetch new config data each iteration and
pass that to each of the readers, including ms5607. Instead of
re-fetching the config data there, just store the ms5607 parameters
when we fetch it the first time and copy it over.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConfigData.java')
-rw-r--r-- | altoslib/AltosConfigData.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index a9e863c7..65f6346a 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -93,6 +93,16 @@ public class AltosConfigData implements Iterable<String> { /* HAS_GYRO */ public int accel_zero_along, accel_zero_across, accel_zero_through; + /* ms5607 data */ + public int ms5607_reserved; + public int ms5607_sens; + public int ms5607_off; + public int ms5607_tcs; + public int ms5607_tco; + public int ms5607_tref; + public int ms5607_tempsens; + public int ms5607_crc; + public static String get_string(String line, String label) throws ParseException { if (line.startsWith(label)) { String quoted = line.substring(label.length()).trim(); @@ -289,6 +299,15 @@ public class AltosConfigData implements Iterable<String> { /* Version also contains MS5607 info, which we ignore here */ + try { ms5607_reserved = get_int(line, "ms5607 reserved:"); } catch (Exception e) {} + try { ms5607_sens = get_int(line, "ms5607 sens:"); } catch (Exception e) {} + try { ms5607_off = get_int(line, "ms5607 off:"); } catch (Exception e) {} + try { ms5607_tcs = get_int(line, "ms5607 tcs:"); } catch (Exception e) {} + try { ms5607_tco = get_int(line, "ms5607 tco:"); } catch (Exception e) {} + try { ms5607_tref = get_int(line, "ms5607 tref:"); } catch (Exception e) {} + try { ms5607_tempsens = get_int(line, "ms5607 tempsens:"); } catch (Exception e) {} + try { ms5607_crc = get_int(line, "ms5607 crc:"); } catch (Exception e) {} + /* Config show replies */ /* HAS_FLIGHT */ |