/* 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();
/* 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 */
public void update_state(AltosState state) throws InterruptedException {
try {
+ /* Fetch config data from remote */
AltosConfigData config_data = new AltosConfigData(link);
state.set_state(AltosLib.ao_flight_startup);
state.set_serial(config_data.serial);
static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException {
try {
- AltosMs5607 ms5607 = new AltosMs5607(link);
+ AltosMs5607 ms5607 = new AltosMs5607(link, config_data);
if (ms5607 != null) {
state.set_ms5607(ms5607);
cc = AltosLib.MISSING;
}
- public AltosMs5607 (AltosLink link) throws InterruptedException, TimeoutException {
+ public AltosMs5607 (AltosLink link, AltosConfigData config_data) throws InterruptedException, TimeoutException {
this();
- link.printf("c s\nB\n");
+ reserved = config_data.ms5607_reserved;
+ sens = config_data.ms5607_sens;
+ off = config_data.ms5607_off;
+ tcs = config_data.ms5607_tcs;
+ tco = config_data.ms5607_tco;
+ tref = config_data.ms5607_tref;
+ tempsens = config_data.ms5607_tempsens;
+ crc = config_data.ms5607_crc;
+ link.printf("B\n");
for (;;) {
String line = link.get_reply_no_dialog(5000);
if (line == null) {