+/*\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
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
\r
Handler handler;\r
\r
+ TelemetryService service;\r
AltosLink link;\r
AltosRecord previous;\r
\r
if (record == null)\r
break;\r
state = new AltosState(record, state);\r
-\r
- handler.obtainMessage(TelemetryService.MSG_TELEMETRY, state).sendToTarget();\r
+ service.sendTelemetry(state);\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
+ service.sendCrcErrors(crc_errors);\r
}\r
}\r
} catch (InterruptedException ee) {\r
}\r
}\r
\r
- public TelemetryReader (AltosLink in_link, Handler in_handler) {\r
+ public TelemetryReader (TelemetryService in_service, AltosLink in_link, Handler in_handler) {\r
+ service = in_service;\r
link = in_link;\r
handler = in_handler;\r
\r