altosui: provide separate flush_input/flush_output for serial. deal with monitor...
[fw/altos] / ao-tools / altosui / AltosEepromDownload.java
index c2a8d25e8b229d7c6d20d4aaac466001d0eaa7fb..5e43345b6197b845262deb994cc435ffd6812d23 100644 (file)
@@ -223,9 +223,10 @@ public class AltosEepromDownload implements Runnable {
 
        public void run () {
                if (remote) {
-                       serial_line.printf("m 0\n");
                        serial_line.set_channel(AltosPreferences.channel());
-                       serial_line.printf("p\n");
+                       serial_line.set_callsign(AltosPreferences.callsign());
+                       serial_line.printf("p\nE 0\n");
+                       serial_line.flush_input();
                }
 
                monitor = new AltosEepromMonitor(frame, Altos.ao_flight_boost, Altos.ao_flight_landed);
@@ -246,6 +247,7 @@ public class AltosEepromDownload implements Runnable {
                if (remote)
                        serial_line.printf("~");
                monitor.done();
+               serial_line.flush_output();
                serial_line.close();
        }
 
@@ -259,7 +261,6 @@ public class AltosEepromDownload implements Runnable {
                if (device != null) {
                        try {
                                serial_line.open(device);
-                               String name = device.getName();
                                if (!device.matchProduct(AltosDevice.TeleMetrum))
                                        remote = true;
                                eeprom_thread = new Thread(this);