X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTelemetryService.java;h=393fd2f6f03609856bcb63195360f2e87c0f2387;hp=ffe96946772a114f92c770c1cfb768b09200244a;hb=4420d4a9fc011ed970af506ef771dfb81580b666;hpb=583458772746317b98fced907ec780edff465888 diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java index ffe96946..393fd2f6 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java @@ -1,5 +1,5 @@ /* - * Copyright © 2012 Mike Beattie + * Copyright © 2012 Mike Beattie * * 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); }