From 0afa07d3c1dcb5e301fcb8b4edfecdd961662478 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 12 Sep 2015 19:20:49 -0700 Subject: 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 --- altoslib/AltosState.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'altoslib/AltosState.java') diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index cf4fb9b0..12cd5adf 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -284,7 +284,7 @@ public class AltosState implements Cloneable, Serializable { } } - public int state; + private int state; public int flight; public int serial; public int altitude_32; @@ -1056,6 +1056,10 @@ public class AltosState implements Cloneable, Serializable { } } + public int state() { + return state; + } + public void set_device_type(int device_type) { this.device_type = device_type; switch (device_type) { -- cgit v1.2.3