altosdroid: lots of debugging statements
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TelemetryService.java
index 1903cc1de2d8c2084cebfebda7cdabad9a3590ac..a61a1eda6b620f7988c4636c6f57c7dbca8cc281 100644 (file)
@@ -102,9 +102,21 @@ public class TelemetryService extends Service {
                }
        }
 
+       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;
                }
@@ -112,6 +124,7 @@ public class TelemetryService extends Service {
        }
 
        private void startAltosBluetooth(BluetoothDevice d) {
+                       if (D) Log.i(TAG, "Connecting to " + d.getName());
                        mAltosBluetooth = new AltosBluetooth(d, mHandler);
                        setState(STATE_CONNECTING);
        }