altosui: Set callsign when fetching eeprom data over the air
[fw/altos] / ao-tools / altosui / AltosEepromDownload.java
index f2fcd09e687c3d3fb9e85b4eabb7e920b021b87c..02a71118c331e72c0af2fb4d6d76d6b043defe49 100644 (file)
@@ -84,7 +84,7 @@ public class AltosEepromDownload implements Runnable {
        }
 
        JFrame                  frame;
-       altos_device            device;
+       AltosDevice             device;
        AltosSerial             serial_line;
        boolean                 remote;
        Thread                  eeprom_thread;
@@ -225,6 +225,7 @@ public class AltosEepromDownload implements Runnable {
                if (remote) {
                        serial_line.printf("m 0\n");
                        serial_line.set_channel(AltosPreferences.channel());
+                       serial_line.set_callsign(AltosPreferences.callsign());
                        serial_line.printf("p\n");
                }
 
@@ -251,7 +252,7 @@ public class AltosEepromDownload implements Runnable {
 
        public AltosEepromDownload(JFrame given_frame) {
                frame = given_frame;
-               device = AltosDeviceDialog.show(frame, null);
+               device = AltosDeviceDialog.show(frame, AltosDevice.Any);
 
                serial_line = new AltosSerial();
                remote = false;
@@ -259,7 +260,7 @@ public class AltosEepromDownload implements Runnable {
                if (device != null) {
                        try {
                                serial_line.open(device);
-                               if (!device.getProduct().startsWith("TeleMetrum"))
+                               if (!device.matchProduct(AltosDevice.TeleMetrum))
                                        remote = true;
                                eeprom_thread = new Thread(this);
                                eeprom_thread.start();