X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosTelemetryRecordLegacy.java;h=f2f633581922944a89a84fa8405f993ab6822d35;hb=f6db11c3c87725c809c518f5f19b07325faf9c84;hp=756f3ec9ac5f4b92318f619e99d3e405fdc818a9;hpb=941b90a4905e34936d24a25ca90ac04eb6f5a792;p=fw%2Faltos diff --git a/altosui/AltosTelemetryRecordLegacy.java b/altosui/AltosTelemetryRecordLegacy.java index 756f3ec9..f2f63358 100644 --- a/altosui/AltosTelemetryRecordLegacy.java +++ b/altosui/AltosTelemetryRecordLegacy.java @@ -265,8 +265,10 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele flight_vel = map.get_int(AO_TELEM_ADHOC_SPEED, MISSING); flight_pres = map.get_int(AO_TELEM_ADHOC_BARO, MISSING); - if (map.has(AO_TELEM_GPS_STATE)) + if (map.has(AO_TELEM_GPS_STATE)) { gps = new AltosGPS(map); + new_gps = true; + } else gps = null; } @@ -355,6 +357,7 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele } gps = new AltosGPS(words, i, version); + new_gps = true; } public AltosTelemetryRecordLegacy(String line) throws ParseException, AltosCRCException { @@ -414,27 +417,19 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele static final int AO_GPS_DATE_VALID = (1 << 6); static final int AO_GPS_COURSE_VALID = (1 << 7); - static class theLock extends Object { - } - static public theLock lockObject = new theLock(); public AltosTelemetryRecordLegacy(int[] in_bytes, int in_rssi, int in_status) { bytes = in_bytes; - synchronized(lockObject) { - for (int i = 0; i < in_bytes.length - 2; i++) { - if ((i % 10) == 0) - System.out.printf("%3d:", i); - System.out.printf(" %02x", uint8(i)); - if ((i % 10) == 9 || i == in_bytes.length - 3) - System.out.printf("\n"); - } - } version = 4; adjust = 0; - serial = uint16(0); - if (bytes.length == Altos.ao_telemetry_0_8_len + 4) + if (bytes.length == Altos.ao_telemetry_0_8_len + 4) { + serial = uint8(0); adjust = -1; - + } else + serial = uint16(0); + + seen = seen_flight | seen_sensor | seen_temp_volt | seen_deploy; + callsign = string(62, 8); flight = uint16(2); rssi = in_rssi; @@ -475,7 +470,9 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele if ((gps_flags & (AO_GPS_VALID|AO_GPS_RUNNING)) != 0) { gps = new AltosGPS(); + new_gps = true; + seen |= seen_gps_time | seen_gps_lat | seen_gps_lon; gps.nsat = (gps_flags & AO_GPS_NUM_SAT_MASK); gps.locked = (gps_flags & AO_GPS_VALID) != 0; gps.connected = true;