diff options
| author | Mike Beattie <mike@ethernal.org> | 2012-08-28 17:35:11 +1200 |
|---|---|---|
| committer | Mike Beattie <mike@ethernal.org> | 2012-08-28 17:35:11 +1200 |
| commit | 03563c765d8b0ab3689c91b2b533c68e11650577 (patch) | |
| tree | ec341cecae0f7f9a82dee10e15c4a412e64513cc /altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | |
| parent | ed653a1e6dc8884cb171af1406fd0999ef125a4d (diff) | |
altosdroid: Add new "TelemetryReader" class to handle Telemetry
* Add MSG_TELEMETRY messages to both AltosDroid and TelemetryService
to handle passing of AltosState object all the way back to the UI.
* Remove linkedblockinglist from TelemetryService
* (MSG_TELEMETRY is a rename of MSG_INCOMING_TELEM in AltosDroid)
* commented code in case statement inside AltosDroind - won't work with
the objects it is currently passed.
* Add new "MSG_DEVCONFIG" message to AltosDroid - allows TelemetryService
to pass information about the connected device back to the UI.
Signed-off-by: Mike Beattie <mike@ethernal.org>
Diffstat (limited to 'altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java')
| -rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index 33da9346..cf982eac 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -60,8 +60,9 @@ public class AltosDroid extends Activity { // Message types sent from the TelemetryService Handler public static final int MSG_STATE_CHANGE = 1; public static final int MSG_DEVNAME = 2; - public static final int MSG_INCOMING_TELEM = 3; - public static final int MSG_TOAST = 4; + public static final int MSG_TOAST = 3; + public static final int MSG_DEVCONFIG = 4; + public static final int MSG_TELEMETRY = 5; // Intent request codes private static final int REQUEST_CONNECT_DEVICE = 1; @@ -111,11 +112,12 @@ public class AltosDroid extends Activity { break; } break; - case MSG_INCOMING_TELEM: - byte[] buf = (byte[]) msg.obj; + case MSG_DEVCONFIG: + case MSG_TELEMETRY: + //byte[] buf = (byte[]) msg.obj; // construct a string from the buffer - String telem = new String(buf); - ad.mSerialView.append(telem); + //String telem = new String(buf); + //ad.mSerialView.append(telem); break; case MSG_DEVNAME: // save the connected device's name |
