- private BluetoothAdapter adapter;
- private ConnectThread connect_thread;
- private BluetoothSocket socket;
- private InputStream input;
- private OutputStream output;
+ private Handler handler;
+
+ private BluetoothAdapter adapter;
+ private BluetoothDevice device;
+ private BluetoothSocket socket;
+ private InputStream input;
+ private OutputStream output;
+
+ // Constructor
+ public AltosBluetooth(BluetoothDevice in_device, Handler in_handler) {
+ adapter = BluetoothAdapter.getDefaultAdapter();
+ device = in_device;
+ handler = in_handler;
+
+ connect_thread = new ConnectThread(device);
+ connect_thread.start();
+
+ input_thread = new Thread(this);
+ input_thread.start();
+ }