projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Don't store computed telemetry fields
[fw/altos]
/
altoslib
/
AltosTelemetryMetrumData.java
diff --git
a/altoslib/AltosTelemetryMetrumData.java
b/altoslib/AltosTelemetryMetrumData.java
index e53f12838836148a604dffe6d4616b204ec671a0..7ba591ed43a08db917bf3c7c7d0dd318ce21944b 100644
(file)
--- a/
altoslib/AltosTelemetryMetrumData.java
+++ b/
altoslib/AltosTelemetryMetrumData.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,28
+16,23
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
6
;
+package org.altusmetrum.altoslib_
11
;
public class AltosTelemetryMetrumData extends AltosTelemetryStandard {
public class AltosTelemetryMetrumData extends AltosTelemetryStandard {
- int ground_pres
;
- int ground_accel
;
- int accel_plus_g
;
- int accel_minus_g
;
+ int ground_pres
() { return int32(8); }
+ int ground_accel
() { return int16(12); }
+ int accel_plus_g
() { return int16(14); }
+ int accel_minus_g
() { return int16(16); }
- public AltosTelemetryMetrumData(int[] bytes) {
+ public AltosTelemetryMetrumData(int[] bytes)
throws AltosCRCException
{
super(bytes);
super(bytes);
-
- ground_pres = int32(8);
- ground_accel = int16(12);
- accel_plus_g = int16(14);
- accel_minus_g = int16(16);
}
public void update_state(AltosState state) {
}
public void update_state(AltosState state) {
- state.set_ground_accel(ground_accel);
- state.set_accel_g(accel_plus_g
, accel_minus_g
);
- state.set_ground_pressure(ground_pres);
+ state.set_ground_accel(ground_accel
()
);
+ state.set_accel_g(accel_plus_g
(), accel_minus_g()
);
+ state.set_ground_pressure(ground_pres
()
);
}
}
}
}