altosdroid: miscellaneous cleanup
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / AltosBluetooth.java
index bb188d80ca2a1d95186e9150a3ba3cabdbdf163f..18581142efc13679a24d1768af563e538a3e4ff2 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright Â© 2011 Keith Packard <keithp@keithp.com>
- * Copyright Â© 2012 Mike Beattie <mike@ethernal.org>
+ * Copyright © 2011 Keith Packard <keithp@keithp.com>
+ * Copyright © 2012 Mike Beattie <mike@ethernal.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -103,6 +103,7 @@ public class AltosBluetooth extends AltosLink {
                                        input = null;
                                        output = null;
                                        AltosBluetooth.this.notifyAll();
+                                       handler.obtainMessage(TelemetryService.MSG_CONNECT_FAILED).sendToTarget();
                                        if (D) Log.e(TAG, "ConnectThread: Failed to establish connection");
                                        return;
                                }
@@ -147,6 +148,7 @@ public class AltosBluetooth extends AltosLink {
 
        private void connection_failed() {
                if (D) Log.e(TAG, "Bluetooth Socket IO failed!");
+               handler.obtainMessage(TelemetryService.MSG_DISCONNECTED).sendToTarget();
        }
 
        public void print(String data) {