X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosEepromDownload.java;h=5e43345b6197b845262deb994cc435ffd6812d23;hp=f2fcd09e687c3d3fb9e85b4eabb7e920b021b87c;hb=ae02b1590439d5c8dfb472cf1f83a14fdcfbaf11;hpb=d8bf05f7ad55964c9bce0551e58f4ef6c9f721ad diff --git a/ao-tools/altosui/AltosEepromDownload.java b/ao-tools/altosui/AltosEepromDownload.java index f2fcd09e..5e43345b 100644 --- a/ao-tools/altosui/AltosEepromDownload.java +++ b/ao-tools/altosui/AltosEepromDownload.java @@ -84,7 +84,7 @@ public class AltosEepromDownload implements Runnable { } JFrame frame; - altos_device device; + AltosDevice device; AltosSerial serial_line; boolean remote; Thread eeprom_thread; @@ -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,12 +247,13 @@ public class AltosEepromDownload implements Runnable { if (remote) serial_line.printf("~"); monitor.done(); + serial_line.flush_output(); serial_line.close(); } 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 +261,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();