Merge branch 'master' into droid-gps
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TelemetryReader.java
index bfa5db5c01815a039357b1f4f007b84f9262cff3..716ec5894c9df42c5e0a975591ba8464c42e91bd 100644 (file)
@@ -1,3 +1,22 @@
+/*\r
+ * Copyright © 2011 Keith Packard <keithp@keithp.com>\r
+ * Copyright © 2012 Mike Beattie <mike@ethernal.org>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; version 2 of the License.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License along\r
+ * with this program; if not, write to the Free Software Foundation, Inc.,\r
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.\r
+ */\r
+\r
+\r
 package org.altusmetrum.AltosDroid;\r
 \r
 import java.text.*;\r
@@ -6,7 +25,7 @@ import java.util.concurrent.*;
 import android.util.Log;\r
 import android.os.Handler;\r
 \r
-import org.altusmetrum.AltosLib.*;\r
+import org.altusmetrum.altoslib_1.*;\r
 \r
 \r
 public class TelemetryReader extends Thread {\r
@@ -49,12 +68,12 @@ public class TelemetryReader extends Thread {
                                        if (record == null)\r
                                                break;\r
                                        state = new AltosState(record, state);\r
-\r
                                        handler.obtainMessage(TelemetryService.MSG_TELEMETRY, state).sendToTarget();\r
                                } catch (ParseException pp) {\r
                                        Log.e(TAG, String.format("Parse error: %d \"%s\"", pp.getErrorOffset(), pp.getMessage()));\r
                                } catch (AltosCRCException ce) {\r
                                        ++crc_errors;\r
+                                       handler.obtainMessage(TelemetryService.MSG_CRC_ERROR, new Integer(crc_errors)).sendToTarget();\r
                                }\r
                        }\r
                } catch (InterruptedException ee) {\r