+ System.out.printf("Checking log erased\n");
+
+ if (is_log_erased()) {
+ System.out.printf("Fetching config data\n");
+ AltosConfigData config_data = link.config_data();
+ System.out.printf("version %s\n", config_data.version);
+ /* Completely erase TeleGPS flash when firmware is old */
+ if (config_data.compare_version("1.9.7") < 0)
+ {
+ if (!do_notify_erase(config_data))
+ throw new IOException(String.format("%s: not erasing log",
+ device.toShortString()));
+ System.out.printf("Erasing log\n");
+ link.printf("Z DoIt\n");
+ link.synchronize(120 * 1000);
+ }
+ }
+