altosui: Report error message back from libaltos
[fw/altos] / altosui / AltosEepromManage.java
index b46364dbaacdd7efc8c6a13703407f8433ed9405..083c73725d44e4f2fa928ce8532b2fd8f7bb363d 100644 (file)
@@ -44,7 +44,10 @@ public class AltosEepromManage implements ActionListener {
 
        public void finish() {
                if (serial_line != null) {
-                       serial_line.flush_input();
+                       try {
+                               serial_line.flush_input();
+                       } catch (InterruptedException ie) {
+                       }
                        serial_line.close();
                        serial_line = null;
                }
@@ -197,7 +200,7 @@ public class AltosEepromManage implements ActionListener {
                boolean running = false;
 
                frame = given_frame;
-               device = AltosDeviceDialog.show(frame, AltosDevice.product_any);
+               device = AltosDeviceDialog.show(frame, Altos.product_any);
 
                remote = false;
                any_download = false;
@@ -206,7 +209,7 @@ public class AltosEepromManage implements ActionListener {
                if (device != null) {
                        try {
                                serial_line = new AltosSerial(device);
-                               if (!device.matchProduct(AltosDevice.product_telemetrum))
+                               if (device.matchProduct(Altos.product_basestation))
                                        remote = true;
 
                                serial_line.set_frame(frame);
@@ -216,8 +219,7 @@ public class AltosEepromManage implements ActionListener {
                                t.start();
                        } catch (FileNotFoundException ee) {
                                JOptionPane.showMessageDialog(frame,
-                                                             String.format("Cannot open device \"%s\"",
-                                                                           device.toShortString()),
+                                                             ee.getMessage(),
                                                              "Cannot open target device",
                                                              JOptionPane.ERROR_MESSAGE);
                        } catch (AltosSerialInUseException si) {