- } catch (Exception e) {
- if (D) Log.e(TAG, "Failed to finish connection", e);
- e.printStackTrace();
+
+ input_thread = new Thread(AltosBluetooth.this);
+ input_thread.start();
+
+ // Configure the newly connected device for telemetry
+ print("~\nE 0\n");
+ set_monitor(false);
+
+ // Let TelemetryService know we're connected
+ handler.obtainMessage(TelemetryService.MSG_CONNECTED).sendToTarget();
+
+ // Notify other waiting threads, now that we're connected
+ AltosBluetooth.this.notifyAll();
+
+ // Reset the ConnectThread because we're done
+ connect_thread = null;
+
+ if (D) Log.d(TAG, "ConnectThread: Connect completed");