- public AltosEepromRecord (AltosSerial serial_line, int addr)
- throws TimeoutException, ParseException, InterruptedException {
- String line = serial_line.get_reply(5000);
- if (line == null)
- throw new TimeoutException();
- int[] values = ParseHex(line);
-
- if (values == null)
- throw new ParseException(String.format("invalid line %s", line), 0);
- if (values[0] != (addr & 0xff))
- throw new ParseException(String.format("data address out of sync at 0x%x",
- addr), 0);
- if (checksum(values) != 0)
- throw new ParseException(String.format("invalid checksum at 0x%x", addr), 0);
-
- cmd = values[1];
- tick = values[3] + (values[4] << 8);
- a = values[5] + (values[6] << 8);
- b = values[7] + (values[8] << 8);
- data = null;
+ public AltosEepromRecord (AltosEepromChunk chunk, int start) throws ParseException {
+
+ cmd = chunk.data(start);