altosuilib: Zap all flash when upgrading TeleGPS from pre-1.9.7
[fw/altos] / altoslib / AltosLink.java
index b713b3dcc9cfebfb0bffc7f145c216b9aea0be79..9346563da1cd5ce230cf235f4131a9c335868449 100644 (file)
@@ -507,6 +507,20 @@ public abstract class AltosLink implements Runnable {
                return ret;
        }
 
+       public void synchronize(int timeout) throws InterruptedException {
+               printf("v\n");
+               for (;;) {
+                       String line = get_reply(timeout);
+
+                       if (line == null)
+                               break;
+                       if (line.startsWith("software-version"))
+                               break;
+                       if (line.startsWith("altos-loader"))
+                               break;
+               }
+       }
+
        public void to_loader() throws InterruptedException {
                printf("X\n");
                flush_output();