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