Fix Latin-1 encoded copyright symbols in AltosDroid java code
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TelemetryService.java
index ffe96946772a114f92c770c1cfb768b09200244a..393fd2f6f03609856bcb63195360f2e87c0f2387 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2012 Mike Beattie <mike@ethernal.org>
+ * Copyright Â© 2012 Mike Beattie <mike@ethernal.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -52,6 +52,7 @@ public class TelemetryService extends Service {
        static final int MSG_CONNECT_FAILED    = 5;
        static final int MSG_DISCONNECTED      = 6;
        static final int MSG_TELEMETRY         = 7;
+       static final int MSG_SETFREQUENCY      = 8;
 
        public static final int STATE_NONE       = 0;
        public static final int STATE_READY      = 1;
@@ -126,6 +127,15 @@ public class TelemetryService extends Service {
                        case MSG_TELEMETRY:
                                s.sendMessageToClients(Message.obtain(null, AltosDroid.MSG_TELEMETRY, msg.obj));
                                break;
+                       case MSG_SETFREQUENCY:
+                               if (s.state == STATE_CONNECTED) {
+                                       try {
+                                               s.mAltosBluetooth.set_radio_frequency((Double) msg.obj);
+                                       } catch (InterruptedException e) {
+                                       } catch (TimeoutException e) {
+                                       }
+                               }
+                               break;
                        default:
                                super.handleMessage(msg);
                        }