static final int AO_LOG_MANUFACTURER = 2000;
static final int AO_LOG_PRODUCT = 2001;
static final int AO_LOG_SERIAL_NUMBER = 2002;
+ static final int AO_LOG_LOG_FORMAT = 2003;
static final int AO_LOG_SOFTWARE_VERSION = 9999;
/* Added to flag invalid records */
/* Telemetry modes */
static final int ao_telemetry_off = 0;
- static final int ao_telemetry_legacy = 1;
- static final int ao_telemetry_split = 2;
+ static final int ao_telemetry_min = 1;
+ static final int ao_telemetry_standard = 1;
+ static final int ao_telemetry_0_9 = 2;
+ static final int ao_telemetry_0_8 = 3;
+ static final int ao_telemetry_max = 3;
+
+ static final String[] ao_telemetry_name = {
+ "Off", "Standard Telemetry", "TeleMetrum v0.9", "TeleMetrum v0.8"
+ };
+
+ static final String launch_sites_url = "http://www.altusmetrum.org/AltOS/launch-sites.txt";
+
+ static final int ao_telemetry_standard_len = 32;
+ static final int ao_telemetry_0_9_len = 95;
+ static final int ao_telemetry_0_8_len = 94;
- static final int ao_telemetry_split_len = 32;
- static final int ao_telemetry_legacy_len = 95;
+ static final int[] ao_telemetry_len = {
+ 0, 32, 95, 94
+ };
static HashMap<String,Integer> string_to_state = new HashMap<String,Integer>();
static final Font value_font = new Font("Monospaced", Font.PLAIN, 22);
static final Font status_font = new Font("SansSerif", Font.BOLD, 24);
- static final int text_width = 16;
+ static final int text_width = 20;
static void initialize_map()
{
map_initialized = true;
}
+ static int telemetry_len(int telemetry) {
+ if (telemetry <= ao_telemetry_max)
+ return ao_telemetry_len[telemetry];
+ throw new IllegalArgumentException(String.format("Invalid telemetry %d",
+ telemetry));
+ }
+
+ static String telemetry_name(int telemetry) {
+ if (telemetry <= ao_telemetry_max)
+ return ao_telemetry_name[telemetry];
+ throw new IllegalArgumentException(String.format("Invalid telemetry %d",
+ telemetry));
+ }
+
static String[] state_to_string = {
"startup",
"idle",
"invalid",
};
+ static String[] state_to_string_capital = {
+ "Startup",
+ "Idle",
+ "Pad",
+ "Boost",
+ "Fast",
+ "Coast",
+ "Drogue",
+ "Main",
+ "Landed",
+ "Invalid",
+ };
+
static public int state(String state) {
if (!map_initialized)
initialize_map();
static final int AO_GPS_NUM_SAT_SHIFT = 0;
static final int AO_GPS_NUM_SAT_MASK = 0xf;
+ static final int AO_LOG_FORMAT_UNKNOWN = 0;
+ static final int AO_LOG_FORMAT_FULL = 1;
+ static final int AO_LOG_FORMAT_TINY = 2;
+ static final int AO_LOG_FORMAT_TELEMETRY = 3;
+ static final int AO_LOG_FORMAT_TELESCIENCE = 4;
+ static final int AO_LOG_FORMAT_NONE = 127;
+
static boolean isspace(int c) {
switch (c) {
case ' ':
}
}
+ int i;
+ for (i = l - 1; i >= 0; i--)
+ if (bytes[s+i] != 0)
+ break;
+
+ l = i + 1;
byte[] b = new byte[l];
- for (int i = 0; i < l; i++)
+ for (i = 0; i < l; i++)
b[i] = (byte) bytes[s+i];
String n = new String(b, unicode_set);
return n;
}
static int usb_vendor_altusmetrum() {
- if (load_library())
- return libaltosConstants.USB_VENDOR_ALTUSMETRUM;
- return 0x000a;
+ load_library();
+ return 0xfffe;
}
static int usb_product_altusmetrum() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_ALTUSMETRUM;
+ load_library();
return 0x000a;
}
static int usb_product_altusmetrum_min() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MIN;
+ load_library();
return 0x000a;
}
static int usb_product_altusmetrum_max() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MAX;
- return 0x000d;
+ load_library();
+ return 0x0013;
}
static int usb_product_telemetrum() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_TELEMETRUM;
+ load_library();
return 0x000b;
}
static int usb_product_teledongle() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_TELEDONGLE;
+ load_library();
return 0x000c;
}
static int usb_product_teleterra() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_TELETERRA;
+ load_library();
return 0x000d;
}
static int usb_product_telebt() {
- if (load_library())
- return libaltosConstants.USB_PRODUCT_TELEBT;
+ load_library();
return 0x000e;
}
+ static int usb_product_telelaunch() {
+ load_library();
+ return 0x000f;
+ }
+
+ static int usb_product_telelco() {
+ load_library();
+ return 0x0010;
+ }
+
+ static int usb_product_telescience() {
+ load_library();
+ return 0x0011;
+ }
+
+ static int usb_product_telepyro() {
+ load_library();
+ return 0x0012;
+ }
+
public final static int vendor_altusmetrum = usb_vendor_altusmetrum();
public final static int product_altusmetrum = usb_product_altusmetrum();
public final static int product_telemetrum = usb_product_telemetrum();
public final static int product_teledongle = usb_product_teledongle();
public final static int product_teleterra = usb_product_teleterra();
public final static int product_telebt = usb_product_telebt();
+ public final static int product_telelaunch = usb_product_telelaunch();
+ public final static int product_tele10 = usb_product_telelco();
+ public final static int product_telescience = usb_product_telescience();
+ public final static int product_telepyro = usb_product_telepyro();
public final static int product_altusmetrum_min = usb_product_altusmetrum_min();
public final static int product_altusmetrum_max = usb_product_altusmetrum_max();
public final static int product_basestation = 0x10000 + 1;
static String bt_product_telebt() {
- if (load_library())
- return libaltosConstants.BLUETOOTH_PRODUCT_TELEBT;
+ load_library();
return "TeleBT";
}
public final static String bt_product_telebt = bt_product_telebt();
- public static AltosBTKnown bt_known = new AltosBTKnown();
+// public static AltosBTKnown bt_known = new AltosBTKnown();
}