/*\r
- * Copyright © 2011 Keith Packard <keithp@keithp.com>\r
- * Copyright © 2012 Mike Beattie <mike@ethernal.org>\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
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