- private void TeleBT_start(BluetoothDevice d) {
- mAltosBluetooth = new AltosBluetooth(d);
- mAltosBluetooth.add_monitor(telem);
+ private void startAltosBluetooth(BluetoothDevice d) {
+ if (D) Log.i(TAG, "Connecting to " + d.getName());
+ mAltosBluetooth = new AltosBluetooth(d, mHandler);
+ setState(STATE_CONNECTING);
+ }
+
+ private synchronized void setState(int s) {
+ if (D) Log.d(TAG, "setState() " + state + " -> " + s);
+ state = s;
+
+ sendMessageToClients(Message.obtain(null, AltosDroid.MSG_STATE_CHANGE, state, -1));