- /**
- * This thread runs while attempting to make an outgoing connection
- * with a device. It runs straight through; the connection either
- * succeeds or fails.
- */
-
- private BluetoothAdapter adapter;
- private ConnectThread connect_thread;
- private BluetoothSocket socket;
- private InputStream input;
- private OutputStream output;
+ private ConnectThread connect_thread = null;
+
+ private BluetoothAdapter adapter;
+ private BluetoothDevice device;
+ private BluetoothSocket socket;
+ private InputStream input;
+ private OutputStream output;
+
+ // Constructor
+ public AltosBluetooth(BluetoothDevice in_device) {
+ adapter = BluetoothAdapter.getDefaultAdapter();
+
+
+ connect_thread = new ConnectThread(device);
+ connect_thread.start();
+ }