From: Keith Packard Date: Fri, 13 Jun 2014 07:01:46 +0000 (-0700) Subject: altoslib: Call state.set_serial first for telemetry parsing X-Git-Tag: 1.4~51 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=07baa7596b36cf808cd1ee26ff158b1cf8585294 altoslib: Call state.set_serial first for telemetry parsing If we ever get around to supporting multiple simultaneous remote devices, we'll need to notice that the serial changed right away Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosTelemetry.java b/altoslib/AltosTelemetry.java index 62948378..8182ec6b 100644 --- a/altoslib/AltosTelemetry.java +++ b/altoslib/AltosTelemetry.java @@ -43,9 +43,9 @@ public abstract class AltosTelemetry implements AltosStateUpdate { } public void update_state(AltosState state) { + state.set_serial(serial); if (state.state == AltosLib.ao_flight_invalid) state.set_state(AltosLib.ao_flight_startup); - state.set_serial(serial); state.set_tick(tick); state.set_rssi(rssi, status); state.set_received_time(received_time);