altosui: New AltosSerial.set_radio function sets channel/call
[fw/altos] / ao-tools / altosui / AltosEepromDownload.java
index 912ff476df8bbb69013db1d872f06384da09ebd8..02fc36f298cfc6922710aaace084a6fa091e1eb0 100644 (file)
@@ -97,7 +97,7 @@ public class AltosEepromDownload implements Runnable {
                /* Pull the serial number out of the version information */
 
                for (;;) {
-                       String  line = serial_line.get_reply(1000);
+                       String  line = serial_line.get_reply(5000);
 
                        if (line == null)
                                throw new TimeoutException();
@@ -127,7 +127,7 @@ public class AltosEepromDownload implements Runnable {
                        any_valid = false;
                        monitor.set_value(state_names[state], state, block - state_block);
                        for (addr = 0; addr < 0x100;) {
-                               String  line = serial_line.get_reply(1000);
+                               String  line = serial_line.get_reply(5000);
                                if (line == null)
                                        throw new TimeoutException();
                                int[] values = ParseHex(line);
@@ -216,8 +216,7 @@ public class AltosEepromDownload implements Runnable {
 
        public void run () {
                if (remote) {
-                       serial_line.set_channel(AltosPreferences.channel(device.getSerial()));
-                       serial_line.set_callsign(AltosPreferences.callsign());
+                       serial_line.set_radio();
                        serial_line.printf("p\nE 0\n");
                        serial_line.flush_input();
                }
@@ -232,14 +231,14 @@ public class AltosEepromDownload implements Runnable {
                        CaptureLog();
                } catch (IOException ee) {
                        JOptionPane.showMessageDialog(frame,
-                                                     device.toString(),
+                                                     device.toShortString(),
                                                      ee.getLocalizedMessage(),
                                                      JOptionPane.ERROR_MESSAGE);
                } catch (InterruptedException ie) {
                } catch (TimeoutException te) {
                        JOptionPane.showMessageDialog(frame,
                                                      String.format("Connection to \"%s\" failed",
-                                                                   device.toString()),
+                                                                   device.toShortString()),
                                                      "Connection Failed",
                                                      JOptionPane.ERROR_MESSAGE);
                }
@@ -266,18 +265,18 @@ public class AltosEepromDownload implements Runnable {
                        } catch (FileNotFoundException ee) {
                                JOptionPane.showMessageDialog(frame,
                                                              String.format("Cannot open device \"%s\"",
-                                                                           device.toString()),
+                                                                           device.toShortString()),
                                                              "Cannot open target device",
                                                              JOptionPane.ERROR_MESSAGE);
                        } catch (AltosSerialInUseException si) {
                                JOptionPane.showMessageDialog(frame,
                                                              String.format("Device \"%s\" already in use",
-                                                                           device.toString()),
+                                                                           device.toShortString()),
                                                              "Device in use",
                                                              JOptionPane.ERROR_MESSAGE);
                        } catch (IOException ee) {
                                JOptionPane.showMessageDialog(frame,
-                                                             device.toString(),
+                                                             device.toShortString(),
                                                              ee.getLocalizedMessage(),
                                                              JOptionPane.ERROR_MESSAGE);
                        }