}
}
+ private void sendMessageToClients(Message m) {
+ for (int i=mClients.size()-1; i>=0; i--) {
+ try {
+ mClients.get(i).send(m);
+ } catch (RemoteException e) {
+ mClients.remove(i);
+ }
+ }
+ }
+
private void stopAltosBluetooth() {
+ if (D) Log.i(TAG, "Stopping BT");
setState(STATE_READY);
if (mAltosBluetooth != null) {
+ if (D) Log.i(TAG, "Closing AltosBluetooth");
mAltosBluetooth.close();
mAltosBluetooth = null;
}
}
private void startAltosBluetooth(BluetoothDevice d) {
+ if (D) Log.i(TAG, "Connecting to " + d.getName());
mAltosBluetooth = new AltosBluetooth(d, mHandler);
setState(STATE_CONNECTING);
}