+ public static final int ao_flight_stateless = 10;
+
+ /* USB product IDs */
+ public final static int vendor_altusmetrum = 0xfffe;
+
+ public final static int product_altusmetrum = 0x000a;
+ public final static int product_telemetrum = 0x000b;
+ public final static int product_teledongle = 0x000c;
+ public final static int product_easytimer = 0x000d;
+ public final static int product_telebt = 0x000e;
+ public final static int product_telelaunch = 0x000f;
+ public final static int product_telelco = 0x0010;
+ public final static int product_telescience = 0x0011;
+ public final static int product_telepyro =0x0012;
+ public final static int product_telemega = 0x0023;
+ public final static int product_megadongle = 0x0024;
+ public final static int product_telegps = 0x0025;
+ public final static int product_easymini = 0x0026;
+ public final static int product_telemini = 0x0027;
+ public final static int product_easymega = 0x0028;
+ public final static int product_usbtrng = 0x0029;
+ public final static int product_usbrelay = 0x002a;
+ public final static int product_mpusb = 0x002b;
+ public final static int product_altusmetrum_min = 0x000a;
+ public final static int product_altusmetrum_max = 0x002c;
+
+ public final static int product_any = 0x10000;
+ public final static int product_basestation = 0x10000 + 1;
+ public final static int product_altimeter = 0x10000 + 2;
+
+ private static class Product {
+ final String name;
+ final int product;
+
+ Product (String name, int product) {
+ this.name = name;
+ this.product = product;
+ }
+ }
+
+ private static Product[] products = {
+ new Product("telemetrum", product_telemetrum),
+ new Product("teleballoon", product_telemetrum),
+ new Product("teledongle", product_teledongle),
+ new Product("easytimer", product_easytimer),
+ new Product("telebt", product_telebt),
+ new Product("telelaunch", product_telelaunch),
+ new Product("telelco", product_telelco),
+ new Product("telescience", product_telescience),
+ new Product("telepyro", product_telepyro),
+ new Product("telemega", product_telemega),
+ new Product("megadongle", product_megadongle),
+ new Product("telegps", product_telegps),
+ new Product("easymini", product_easymini),
+ new Product("telemini", product_telemini),
+ new Product("easymega", product_easymega)
+ };
+
+ public static int name_to_product(String name) {
+ String low = name.toLowerCase();
+
+ for (int i = 0; i < products.length; i++)
+ if (low.startsWith(products[i].name))
+ return products[i].product;
+ return product_any;
+ }
+
+ public static boolean has_9dof(int device_type) {
+ return device_type == product_telemega || device_type == product_easymega;
+ }
+
+ public static boolean has_radio(int device_type) {
+ return device_type != product_easymini && device_type != product_easymega;
+ }
+
+ public static boolean has_gps(int device_type) {
+ return device_type == product_telemetrum ||
+ device_type == product_telemega ||
+ device_type == product_telegps;
+ }
+
+ /* Bluetooth "identifier" (bluetooth sucks) */
+ public final static String bt_product_telebt = "TeleBT";
+
+ /* "good" voltages */
+
+ public final static double ao_battery_good = 3.8;
+ public final static double ao_igniter_good = 3.5;