altoslib/altosui: Add TeleMini-v1.0 eeprom support
[fw/altos] / altosui / AltosEepromDownload.java
index 931b55fd087e1334b96a46a9e78eee293a18ce1a..f034d73c81193dbe44756f052dcbbb7d8db16b4d 100644 (file)
@@ -23,7 +23,7 @@ import java.io.*;
 import java.util.*;
 import java.text.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altoslib_2.*;
 
 public class AltosEepromDownload implements Runnable {
 
@@ -61,9 +61,9 @@ public class AltosEepromDownload implements Runnable {
                        AltosGPS                gps = state.gps;
 
                        if (gps != null &&
-                           gps.year != AltosRecord.MISSING &&
-                           gps.month != AltosRecord.MISSING &&
-                           gps.day != AltosRecord.MISSING)
+                           gps.year != AltosLib.MISSING &&
+                           gps.month != AltosLib.MISSING &&
+                           gps.day != AltosLib.MISSING)
                        {
                                eeprom_name = new AltosFile(gps.year, gps.month, gps.day,
                                                            state.serial, state.flight, "eeprom");
@@ -100,7 +100,10 @@ public class AltosEepromDownload implements Runnable {
                state.set_serial(flights.config_data.serial);
 
                for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += record_length) {
-                       AltosEeprom r = eechunk.eeprom(i, log_format);
+                       AltosEeprom r = eechunk.eeprom(i, log_format, state);
+
+                       if (r == null)
+                               continue;
 
                        record_length = r.record_length();