X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosEepromMetrum2.java;h=1b4cb04a3dfff898ed17fc99b52b21af36538d08;hp=2f43879ec978a902a6adaf82f4ce42210a38c32f;hb=d6445b3739ac2c5dd040efdb97317a6b2a48044a;hpb=b8fa4e9a077e8e04b922d0c434c139ad0a57ee66 diff --git a/altoslib/AltosEepromMetrum2.java b/altoslib/AltosEepromMetrum2.java index 2f43879e..1b4cb04a 100644 --- a/altoslib/AltosEepromMetrum2.java +++ b/altoslib/AltosEepromMetrum2.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_5; +package org.altusmetrum.altoslib_8; import java.io.*; import java.util.*; @@ -49,7 +49,8 @@ public class AltosEepromMetrum2 extends AltosEeprom { /* AO_LOG_GPS_POS elements */ public int latitude() { return data32(0); } public int longitude() { return data32(4); } - public int altitude() { return data16(8); } + public int altitude_low() { return data16(8); } + public int altitude_high() { return data16(10); } /* AO_LOG_GPS_TIME elements */ public int hour() { return data8(0); } @@ -118,7 +119,10 @@ public class AltosEepromMetrum2 extends AltosEeprom { gps = state.make_temp_gps(false); gps.lat = latitude() / 1e7; gps.lon = longitude() / 1e7; - gps.alt = altitude(); + if (state.altitude_32()) + gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16); + else + gps.alt = altitude_low(); break; case AltosLib.AO_LOG_GPS_TIME: gps = state.make_temp_gps(false);