X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosTelemetryMetrumData.java;h=c97c7379f84801221225255fcca67dd137e74d51;hp=6d59346728bdeedec3f3ee552048599bdfba069f;hb=HEAD;hpb=cb23b992be8ba40c97d8988c134a814a13ccd58c diff --git a/altoslib/AltosTelemetryMetrumData.java b/altoslib/AltosTelemetryMetrumData.java index 6d593467..c97c7379 100644 --- 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 - * 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 @@ -15,28 +16,23 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_7; +package org.altusmetrum.altoslib_14; 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); - - ground_pres = int32(8); - ground_accel = int16(12); - accel_plus_g = int16(14); - accel_minus_g = int16(16); } - 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); + public void provide_data(AltosDataListener listener, AltosCalData cal_data) { + cal_data.set_ground_accel(ground_accel()); + cal_data.set_accel_plus_minus(accel_plus_g(), accel_minus_g()); + cal_data.set_ground_pressure(ground_pres()); } }