altosdroid: Skip updating hidden UI elements
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TelemetryService.java
index da5e044f0abc5b122416b996c4c81149ccb07c11..4ec353e30e88ff2d298b8bea8cb7005607061699 100644 (file)
@@ -44,7 +44,7 @@ import android.location.LocationManager;
 import android.location.LocationListener;
 import android.location.Criteria;
 
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_5.*;
 
 
 public class TelemetryService extends Service implements LocationListener {
@@ -61,6 +61,7 @@ public class TelemetryService extends Service implements LocationListener {
        static final int MSG_TELEMETRY         = 7;
        static final int MSG_SETFREQUENCY      = 8;
        static final int MSG_CRC_ERROR         = 9;
+       static final int MSG_SETBAUD           = 10;
 
        public static final int STATE_NONE       = 0;
        public static final int STATE_READY      = 1;
@@ -162,6 +163,11 @@ public class TelemetryService extends Service implements LocationListener {
                                        }
                                }
                                break;
+                       case MSG_SETBAUD:
+                               if (s.state == STATE_CONNECTED) {
+                                       s.mAltosBluetooth.set_telemetry_rate((Integer) msg.obj);
+                               }
+                               break;
                        default:
                                super.handleMessage(msg);
                        }