diff options
author | Keith Packard <keithp@keithp.com> | 2015-09-12 19:20:49 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-10-13 13:54:28 -0700 |
commit | 0afa07d3c1dcb5e301fcb8b4edfecdd961662478 (patch) | |
tree | bd0742a81d3ef60933358fa5151e5d49910cacbe /altoslib/AltosEepromFile.java | |
parent | 7064bc685aebeef07711e525dea4d5fbe33d235b (diff) |
altoslib: Hide 'state' member and use accessor function
Someone was smashing the state to 'landed' when no packets had been
received for a while. Found that by making it impossible for anyone
outside of AltosState to change the value.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosEepromFile.java')
-rw-r--r-- | altoslib/AltosEepromFile.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index 33d4f63b..002b7fff 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -72,7 +72,7 @@ public class AltosEepromFile extends AltosStateIterable { headers = new AltosEepromIterable(AltosEepromHeader.read(input)); start = headers.state(); - if (start.state != AltosLib.ao_flight_stateless) + if (start.state() != AltosLib.ao_flight_stateless) start.set_state(AltosLib.ao_flight_pad); if (start.log_format == AltosLib.MISSING) { @@ -117,7 +117,7 @@ public class AltosEepromFile extends AltosStateIterable { for (AltosEeprom eeprom : body) { eeprom.update_state(state); state.finish_update(); - if (state.state >= AltosLib.ao_flight_boost) { + if (state.state() >= AltosLib.ao_flight_boost) { start.set_boost_tick(state.tick); break; } |