return AltosLib.MISSING;
}
- static double tele_mini_voltage(int sensor) {
+ static double tele_mini_3_adc(int raw) {
+ return raw / 4095.0;
+ }
+
+ static public double tele_mini_3_battery_voltage(int v_batt) {
+ if (v_batt != AltosLib.MISSING)
+ return 3.3 * tele_mini_3_adc(v_batt) * (5.6 + 10.0) / 10.0;
+ return AltosLib.MISSING;
+ }
+
+ static double tele_mini_3_pyro_voltage(int raw) {
+ if (raw != AltosLib.MISSING)
+ return 3.3 * tele_mini_3_adc(raw) * (100.0 + 27.0) / 27.0;
+ return AltosLib.MISSING;
+ }
+
+ static double tele_mini_2_voltage(int sensor) {
double supply = 3.3;
return sensor / 32767.0 * supply * 127/27;
case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
eeprom = new AltosEepromMetrum2(this, offset);
break;
- case AltosLib.AO_LOG_FORMAT_TELEMINI:
+ case AltosLib.AO_LOG_FORMAT_TELEMINI2:
+ case AltosLib.AO_LOG_FORMAT_TELEMINI3:
case AltosLib.AO_LOG_FORMAT_EASYMINI:
eeprom = new AltosEepromMini(this, offset);
break;
case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
body = new AltosEepromIterable(AltosEepromMetrum2.read(input));
break;
- case AltosLib.AO_LOG_FORMAT_TELEMINI:
+ case AltosLib.AO_LOG_FORMAT_TELEMINI2:
+ case AltosLib.AO_LOG_FORMAT_TELEMINI3:
case AltosLib.AO_LOG_FORMAT_EASYMINI:
body = new AltosEepromIterable(AltosEepromMini.read(input));
break;
public int sense_m() { return data16(8); }
public int v_batt() { return data16(10); }
- double voltage(AltosState state, int sensor) {
+ private double battery_voltage(AltosState state, int sensor) {
if (state.log_format == AltosLib.AO_LOG_FORMAT_EASYMINI)
return AltosConvert.easy_mini_voltage(sensor, state.serial);
- else
- return AltosConvert.tele_mini_voltage(sensor);
+ if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI2)
+ return AltosConvert.tele_mini_2_voltage(sensor);
+ if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI3)
+ return AltosConvert.tele_mini_3_battery_voltage(sensor);
+ return -1;
+ }
+
+ private double pyro_voltage(AltosState state, int sensor) {
+ if (state.log_format == AltosLib.AO_LOG_FORMAT_EASYMINI)
+ return AltosConvert.easy_mini_voltage(sensor, state.serial);
+ if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI2)
+ return AltosConvert.tele_mini_2_voltage(sensor);
+ if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI3)
+ return AltosConvert.tele_mini_3_pyro_voltage(sensor);
+ return -1;
}
public void update_state(AltosState state) {
break;
case AltosLib.AO_LOG_SENSOR:
state.set_ms5607(pres(), temp());
- state.set_apogee_voltage(voltage(state, sense_a()));
- state.set_main_voltage(voltage(state, sense_m()));
- state.set_battery_voltage(voltage(state, v_batt()));
+ state.set_apogee_voltage(pyro_voltage(state, sense_a()));
+ state.set_main_voltage(pyro_voltage(state, sense_m()));
+ state.set_battery_voltage(battery_voltage(state, v_batt()));
break;
}
}
static final int idle_sensor_metrum = 11;
static final int idle_sensor_mega = 12;
static final int idle_sensor_emini = 13;
- static final int idle_sensor_tmini = 14;
+ static final int idle_sensor_tmini2 = 14;
static final int idle_sensor_tgps = 15;
+ static final int idle_sensor_tmini3 = 16;
public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException, TimeoutException, AltosUnknownProduct {
for (int idler : idlers) {
case idle_sensor_emini:
AltosSensorEMini.update_state(state, link, config_data);
break;
- case idle_sensor_tmini:
+ case idle_sensor_tmini2:
AltosSensorTMini.update_state(state, link, config_data);
break;
case idle_sensor_tgps:
AltosSensorTGPS.update_state(state, link, config_data);
break;
+ case idle_sensor_tmini3:
+ AltosSensorTMini3.update_state(state, link, config_data);
+ break;
}
if (idle != null)
idle.update_state(state);
new AltosIdler("TeleMini-v2",
AltosIdler.idle_ms5607,
- AltosIdler.idle_sensor_tmini),
+ AltosIdler.idle_sensor_tmini2),
+
+ new AltosIdler("TeleMini-v3",
+ AltosIdler.idle_ms5607,
+ AltosIdler.idle_sensor_tmini3),
new AltosIdler("TeleMetrum-v1",
AltosIdler.idle_gps,
public static final int AO_LOG_FORMAT_TELEMEGA_OLD = 5;
public static final int AO_LOG_FORMAT_EASYMINI = 6;
public static final int AO_LOG_FORMAT_TELEMETRUM = 7;
- public static final int AO_LOG_FORMAT_TELEMINI = 8;
+ public static final int AO_LOG_FORMAT_TELEMINI2 = 8;
public static final int AO_LOG_FORMAT_TELEGPS = 9;
public static final int AO_LOG_FORMAT_TELEMEGA = 10;
+ public static final int AO_LOG_FORMAT_DETHERM = 11;
+ public static final int AO_LOG_FORMAT_TELEMINI3 = 12;
public static final int AO_LOG_FORMAT_NONE = 127;
public static boolean isspace(int c) {
+++ /dev/null
-/*
- * Copyright © 2012 Keith Packard <keithp@keithp.com>
- *
- * 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; 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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-package org.altusmetrum.altoslib_11;
-
-import java.util.concurrent.TimeoutException;
-
-public class AltosSensorTMini {
- public int tick;
- public int apogee;
- public int main;
- public int batt;
-
- static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException {
- try {
- AltosSensorTMini sensor_tmini = new AltosSensorTMini(link);
-
- if (sensor_tmini == null)
- return;
- state.set_battery_voltage(AltosConvert.tele_mini_voltage(sensor_tmini.batt));
- state.set_apogee_voltage(AltosConvert.tele_mini_voltage(sensor_tmini.apogee));
- state.set_main_voltage(AltosConvert.tele_mini_voltage(sensor_tmini.main));
-
- } catch (TimeoutException te) {
- }
- }
-
- public AltosSensorTMini(AltosLink link) throws InterruptedException, TimeoutException {
- String[] items = link.adc();
- for (int i = 0; i < items.length;) {
- if (items[i].equals("tick:")) {
- tick = Integer.parseInt(items[i+1]);
- i += 2;
- continue;
- }
- if (items[i].equals("apogee:")) {
- apogee = Integer.parseInt(items[i+1]);
- i += 2;
- continue;
- }
- if (items[i].equals("main:")) {
- main = Integer.parseInt(items[i+1]);
- i += 2;
- continue;
- }
- if (items[i].equals("batt:")) {
- batt = Integer.parseInt(items[i+1]);
- i += 2;
- continue;
- }
- i++;
- }
- }
-}
-
--- /dev/null
+/*
+ * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ *
+ * 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; 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_11;
+
+import java.util.concurrent.TimeoutException;
+
+public class AltosSensorTMini2 {
+ public int tick;
+ public int apogee;
+ public int main;
+ public int batt;
+
+ static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException {
+ try {
+ AltosSensorTMini2 sensor_tmini = new AltosSensorTMini2(link);
+
+ if (sensor_tmini == null)
+ return;
+ state.set_battery_voltage(AltosConvert.tele_mini_2_voltage(sensor_tmini.batt));
+ state.set_apogee_voltage(AltosConvert.tele_mini_2_voltage(sensor_tmini.apogee));
+ state.set_main_voltage(AltosConvert.tele_mini_2_voltage(sensor_tmini.main));
+
+ } catch (TimeoutException te) {
+ }
+ }
+
+ public AltosSensorTMini2(AltosLink link) throws InterruptedException, TimeoutException {
+ String[] items = link.adc();
+ for (int i = 0; i < items.length;) {
+ if (items[i].equals("tick:")) {
+ tick = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("apogee:")) {
+ apogee = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("main:")) {
+ main = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("batt:")) {
+ batt = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ i++;
+ }
+ }
+}
+
--- /dev/null
+/*
+ * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ *
+ * 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; 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_11;
+
+import java.util.concurrent.TimeoutException;
+
+public class AltosSensorTMini3 {
+ public int tick;
+ public int apogee;
+ public int main;
+ public int batt;
+
+ static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException {
+ try {
+ AltosSensorTMini3 sensor_tmini = new AltosSensorTMini3(link);
+
+ if (sensor_tmini == null)
+ return;
+ state.set_battery_voltage(AltosConvert.tele_mini_3_battery_voltage(sensor_tmini.batt));
+ state.set_apogee_voltage(AltosConvert.tele_mini_3_pyro_voltage(sensor_tmini.apogee));
+ state.set_main_voltage(AltosConvert.tele_mini_3_pyro_voltage(sensor_tmini.main));
+
+ } catch (TimeoutException te) {
+ }
+ }
+
+ public AltosSensorTMini3(AltosLink link) throws InterruptedException, TimeoutException {
+ String[] items = link.adc();
+ for (int i = 0; i < items.length;) {
+ if (items[i].equals("tick:")) {
+ tick = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("apogee:")) {
+ apogee = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("main:")) {
+ main = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ if (items[i].equals("batt:")) {
+ batt = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ i++;
+ }
+ }
+}
+
final static int packet_type_mega_data = 0x09;
final static int packet_type_metrum_sensor = 0x0a;
final static int packet_type_metrum_data = 0x0b;
- final static int packet_type_mini = 0x10;
+ final static int packet_type_mini2 = 0x10;
+ final static int packet_type_mini3 = 0x11;
static AltosTelemetry parse_hex(String hex) throws ParseException, AltosCRCException {
AltosTelemetry telem = null;
+++ /dev/null
-/*
- * Copyright © 2011 Keith Packard <keithp@keithp.com>
- *
- * 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; 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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-package org.altusmetrum.altoslib_11;
-
-
-public class AltosTelemetryMini extends AltosTelemetryStandard {
- int state;
-
- int v_batt;
- int sense_a;
- int sense_m;
-
- int pres;
- int temp;
-
- int acceleration;
- int speed;
- int height;
-
- int ground_pres;
-
- public AltosTelemetryMini(int[] bytes) {
- super(bytes);
-
- state = int8(5);
-
- v_batt = int16(6);
- sense_a = int16(8);
- sense_m = int16(10);
-
- pres = int32(12);
- temp = int16(16);
-
- acceleration = int16(18);
- speed = int16(20);
- height = int16(22);
-
- ground_pres = int32(24);
- }
-
- public void update_state(AltosState state) {
- super.update_state(state);
-
- state.set_state(this.state);
-
- state.set_battery_voltage(AltosConvert.tele_mini_voltage(v_batt));
- state.set_apogee_voltage(AltosConvert.tele_mini_voltage(sense_a));
- state.set_main_voltage(AltosConvert.tele_mini_voltage(sense_m));
-
- state.set_ground_pressure(ground_pres);
-
- state.set_pressure(pres);
- state.set_temperature(temp/100.0);
-
- state.set_kalman(height, speed/16.0, acceleration/16.0);
- }
-}
--- /dev/null
+/*
+ * Copyright © 2011 Keith Packard <keithp@keithp.com>
+ *
+ * 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; 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_11;
+
+
+public class AltosTelemetryMini2 extends AltosTelemetryStandard {
+ int state;
+
+ int v_batt;
+ int sense_a;
+ int sense_m;
+
+ int pres;
+ int temp;
+
+ int acceleration;
+ int speed;
+ int height;
+
+ int ground_pres;
+
+ public AltosTelemetryMini2(int[] bytes) {
+ super(bytes);
+
+ state = int8(5);
+
+ v_batt = int16(6);
+ sense_a = int16(8);
+ sense_m = int16(10);
+
+ pres = int32(12);
+ temp = int16(16);
+
+ acceleration = int16(18);
+ speed = int16(20);
+ height = int16(22);
+
+ ground_pres = int32(24);
+ }
+
+ public void update_state(AltosState state) {
+ super.update_state(state);
+
+ state.set_state(this.state);
+
+ state.set_battery_voltage(AltosConvert.tele_mini_2_voltage(v_batt));
+ state.set_apogee_voltage(AltosConvert.tele_mini_2_voltage(sense_a));
+ state.set_main_voltage(AltosConvert.tele_mini_2_voltage(sense_m));
+
+ state.set_ground_pressure(ground_pres);
+
+ state.set_pressure(pres);
+ state.set_temperature(temp/100.0);
+
+ state.set_kalman(height, speed/16.0, acceleration/16.0);
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2017 Keith Packard <keithp@keithp.com>
+ *
+ * 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; 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_11;
+
+
+public class AltosTelemetryMini3 extends AltosTelemetryStandard {
+
+ int state;
+
+ int v_batt;
+ int sense_a;
+ int sense_m;
+
+ int pres;
+ int temp;
+
+ int acceleration;
+ int speed;
+ int height_16;
+
+ int ground_pres;
+
+ public AltosTelemetryMini3(int[] bytes) {
+ super(bytes);
+
+ state = int8(5);
+
+ v_batt = int16(6);
+ sense_a = int16(8);
+ sense_m = int16(10);
+
+ pres = int32(12);
+ temp = int16(16);
+
+ acceleration = int16(18);
+ speed = int16(20);
+ height_16 = int16(22);
+
+ ground_pres = int32(24);
+ }
+
+ public void update_state(AltosState state) {
+ super.update_state(state);
+
+ state.set_state(this.state);
+
+ state.set_battery_voltage(AltosConvert.tele_mini_3_battery_voltage(v_batt));
+
+ state.set_apogee_voltage(AltosConvert.tele_mini_3_pyro_voltage(sense_a));
+ state.set_main_voltage(AltosConvert.tele_mini_3_pyro_voltage(sense_m));
+
+ state.set_pressure(pres);
+ state.set_temperature(temp/100.0);
+
+ state.set_kalman(extend_height(state, height_16),
+ speed/16.0, acceleration/16.0);
+
+ state.set_ground_pressure(ground_pres);
+ }
+}
case packet_type_metrum_data:
telem = new AltosTelemetryMetrumData(bytes);
break;
- case packet_type_mini:
- telem = new AltosTelemetryMini(bytes);
+ case packet_type_mini2:
+ telem = new AltosTelemetryMini2(bytes);
+ break;
+ case packet_type_mini3:
+ telem = new AltosTelemetryMini3(bytes);
break;
default:
telem = new AltosTelemetryRaw(bytes);
AltosSensorMM.java \
AltosSensorEMini.java \
AltosSensorTM.java \
- AltosSensorTMini.java \
+ AltosSensorTMini2.java \
+ AltosSensorTMini3.java \
AltosSensorMega.java \
AltosSensorMetrum.java \
AltosSensorTGPS.java \
AltosTelemetryMap.java \
AltosTelemetryMegaSensor.java \
AltosTelemetryMegaData.java \
- AltosTelemetryMini.java \
+ AltosTelemetryMini2.java \
+ AltosTelemetryMini3.java \
AltosTelemetryMetrumSensor.java \
AltosTelemetryMetrumData.java \
AltosTelemetryReader.java \