- private void TeleBT_start(BluetoothDevice d) {
- mAltosBluetooth = new AltosBluetooth(d);
- mAltosBluetooth.add_monitor(telem);
+ 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));
+ }
+
+ private void connected() {
+ sendMessageToClients(Message.obtain(null, AltosDroid.MSG_DEVNAME, device.getName()));
+ setState(STATE_CONNECTED);
+ mTelemetryReader = new TelemetryReader(mAltosBluetooth, mHandler);
+ mTelemetryReader.start();