From: Keith Packard Date: Sun, 8 Jun 2014 04:02:26 +0000 (-0700) Subject: altos: Use 0x80 to indicate valid state value in the GPS location packet X-Git-Tag: 1.3.2.4~10 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=08550425fca3da73d8f16de567a2c956b85d676e;hp=d8b271502bfd1301b2244e3be5e8c9917a9c624a altos: Use 0x80 to indicate valid state value in the GPS location packet And only set this for tracker products; other products place state in separate state packets Signed-off-by: Keith Packard --- diff --git a/src/kernel/ao_telemetry.c b/src/kernel/ao_telemetry.c index 7850f738..2292d229 100644 --- a/src/kernel/ao_telemetry.c +++ b/src/kernel/ao_telemetry.c @@ -334,7 +334,9 @@ ao_send_location(void) ao_xmemcpy(&telemetry.location.flags, &ao_gps_data.flags, 26); - telemetry.location.state = ao_flight_state; +#if HAS_TRACKER + telemetry.location.state = ao_flight_state | AO_GPS_STATE_VALID; +#endif telemetry.location.tick = ao_gps_tick; ao_mutex_put(&ao_gps_mutex); ao_radio_send(&telemetry, sizeof (telemetry)); diff --git a/src/kernel/ao_telemetry.h b/src/kernel/ao_telemetry.h index 1aeda264..050bbf72 100644 --- a/src/kernel/ao_telemetry.h +++ b/src/kernel/ao_telemetry.h @@ -93,6 +93,8 @@ struct ao_telemetry_configuration { #define AO_GPS_MODE_MANUAL 'M' #define AO_GPS_MODE_SIMULATED 'S' +#define AO_GPS_STATE_VALID 0x80 + struct ao_telemetry_location { uint16_t serial; /* 0 */ uint16_t tick; /* 2 */