altosui: Add rudimentary MM support to altosui
authorKeith Packard <keithp@keithp.com>
Mon, 18 Jun 2012 02:01:24 +0000 (19:01 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 18 Jun 2012 02:01:24 +0000 (19:01 -0700)
Decoded the MM sensor packets as if they were TM packets.
Add the USB ids.
Add class of 'altimeter' devices and match those instead of just
telemetrum as appropriate.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosTelemetryRecord.java
altosui/AltosIdleMonitorUI.java
altosui/AltosIgnite.java
altosui/AltosUSBDevice.java

index 4292dae8e6bb629f715e94dd27dfb8f4cfe9a2d1..6b6a252d0b1f0e375abd49ecef17a6e73cd98792 100644 (file)
@@ -42,6 +42,7 @@ public abstract class AltosTelemetryRecord {
        final static int packet_type_location = 0x05;
        final static int packet_type_satellite = 0x06;
        final static int packet_type_companion = 0x07;
+       final static int packet_type_MM_sensor = 0x08;
        
        static AltosTelemetryRecord parse_hex(String hex)  throws ParseException, AltosCRCException {
                AltosTelemetryRecord    r;
@@ -75,6 +76,7 @@ public abstract class AltosTelemetryRecord {
                        case packet_type_TM_sensor:
                        case packet_type_Tm_sensor:
                        case packet_type_Tn_sensor:
+                       case packet_type_MM_sensor:
                                r = new AltosTelemetryRecordSensor(bytes, rssi);
                                break;
                        case packet_type_configuration:
index 02295ea98c05fde6c36e5979c88793ab1ebe0414..2ee909374a313d50492dd3e2ffb42e167696218a 100644 (file)
@@ -325,7 +325,7 @@ public class AltosIdleMonitorUI extends AltosFrame implements AltosFlightDisplay
 
                device = AltosDeviceDialog.show(in_owner, Altos.product_any);
                remote = false;
-               if (!device.matchProduct(Altos.product_telemetrum))
+               if (!device.matchProduct(Altos.product_altimeter))
                        remote = true;
 
                serial = device.getSerial();
index c0cd44f1c4197ff05f46b93ab187c561a1f71c71..45d37d167dbff2d23c31d9395b6966159f7cd35c 100644 (file)
@@ -178,7 +178,7 @@ public class AltosIgnite {
                serial = new AltosSerial(device);
                remote = false;
 
-               if (!device.matchProduct(Altos.product_telemetrum))
+               if (!device.matchProduct(Altos.product_altimeter))
                        remote = true;
        }
 }
\ No newline at end of file
index b11a3934b1376906974eab03cdf02b8c698f3817..ed5f8307d178bba720de462c47b358e3f4f4ddf4 100644 (file)
@@ -71,7 +71,12 @@ public class AltosUSBDevice  extends altos_device implements AltosDevice {
                if (want_product == Altos.product_basestation)
                        return matchProduct(Altos.product_teledongle) ||
                                matchProduct(Altos.product_teleterra) ||
-                               matchProduct(Altos.product_telebt);
+                               matchProduct(Altos.product_telebt) ||
+                               matchProduct(Altos.product_megadongle);
+
+               if (want_product == Altos.product_altimeter)
+                       return matchProduct(Altos.product_telemetrum) ||
+                               matchProduct(Altos.product_megametrum);
 
                int have_product = getProduct();