X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosEepromGPS.java;h=3c1852c0350258a1ce34830ea28895ed26e9ee53;hb=b825ea71ebcc4a8da3e339ab3e21b0ad47f2e48f;hp=1820cd612a6ca5c5b1d76ae48fcd65db0f25866f;hpb=871fb4753a3b54cc2e22309e80e24dfe9cc54511;p=fw%2Faltos diff --git a/altoslib/AltosEepromGPS.java b/altoslib/AltosEepromGPS.java index 1820cd61..3c1852c0 100644 --- a/altoslib/AltosEepromGPS.java +++ b/altoslib/AltosEepromGPS.java @@ -53,6 +53,17 @@ public class AltosEepromGPS extends AltosEeprom { public int vdop() { return data8(24); } public int mode() { return data8(25); } + public boolean has_seconds() { return cmd == AltosLib.AO_LOG_GPS_TIME; } + + public int seconds() { + switch (cmd) { + case AltosLib.AO_LOG_GPS_TIME: + return second() + 60 * (minute() + 60 * (hour() + 24 * (day() + 31 * month()))); + default: + return 0; + } + } + public AltosEepromGPS (AltosEepromChunk chunk, int start) throws ParseException { parse_chunk(chunk, start); }