altosui: Capture config and version info in .eeprom files
authorKeith Packard <keithp@keithp.com>
Sat, 31 Jul 2010 17:05:15 +0000 (10:05 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 31 Jul 2010 17:05:15 +0000 (10:05 -0700)
Instead of only writing the serial number to the .eeprom file, write
all of the config values and all of the version reply to the .eeprom
file. The config values, in particular, contain the accelerometer
calibration data which is needed to correctly compute acceleration
from the captured accelerometer data.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosEepromDownload.java

index 756b82d188d552308a857b274d71413b0fd319c0..1f4a278f33bde2a959ae845f9e8fcbb9b262f3f0 100644 (file)
@@ -103,7 +103,7 @@ public class AltosEepromDownload implements Runnable {
                AltosFile               eeprom_name;
                LinkedList<String>      eeprom_pending = new LinkedList<String>();
 
-               serial_line.printf("v\n");
+               serial_line.printf("\nc s\nv\n");
 
                /* Pull the serial number out of the version information */
 
@@ -113,12 +113,13 @@ public class AltosEepromDownload implements Runnable {
                        if (line.startsWith("serial-number")) {
                                try {
                                        serial = Integer.parseInt(line.substring(13).trim());
-                                       eeprom_pending.add(String.format("%s\n", line));
                                } catch (NumberFormatException ne) {
                                        serial = 0;
                                }
                        }
 
+                       eeprom_pending.add(String.format("%s\n", line));
+
                        /* signals the end of the version info */
                        if (line.startsWith("software-version"))
                                break;