- } 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();
+ Message msg = handler.obtainMessage(TelemetryService.MSG_CONNECTED);
+ Bundle b = new Bundle();
+ b.putString(TelemetryService.KEY_DEVNAME, name);
+ msg.setData(b);
+ handler.sendMessage(msg);
+
+ // Notify other waiting threads, now that we're connected
+ AltosBluetooth.this.notifyAll();
+
+ if (D) Log.i(TAG, "ConnectThread: Connect completed");