diff options
author | Bdale Garbee <bdale@gag.com> | 2014-09-09 23:28:39 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2014-09-09 23:28:39 -0600 |
commit | 16405fd3eb6f82ef3a709e3ed30fc48faef7b547 (patch) | |
tree | c111819b3ba0c9357af41c81b798326b9df7adad /src/test/ao_aprs_test.c | |
parent | 5a2f6ed6210844f7284fbf9f7ecba68c8a14fa52 (diff) | |
parent | 28bd5057252e61bc5b1a35a00bc1f9fdfde097f7 (diff) |
Merge branch 'branch-1.5' into debian
Conflicts:
ChangeLog
Releasing
altosui/Instdrv/NSIS/Includes/java.nsh
altosui/altos-windows.nsi.in
configure.ac
doc/Makefile
doc/altusmetrum.xsl
micropeak/micropeak-windows.nsi.in
telegps/telegps-windows.nsi.in
Diffstat (limited to 'src/test/ao_aprs_test.c')
-rw-r--r-- | src/test/ao_aprs_test.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/test/ao_aprs_test.c b/src/test/ao_aprs_test.c index 86cf527a..ae505dea 100644 --- a/src/test/ao_aprs_test.c +++ b/src/test/ao_aprs_test.c @@ -21,6 +21,8 @@ #include <stdint.h> #include <stdarg.h> +#define HAS_GPS 1 + #include <ao_telemetry.h> #define AO_GPS_NUM_SAT_MASK (0xf << 0) @@ -97,41 +99,14 @@ audio_gap(int secs) #endif } -#include <math.h> - -int -ao_aprs_encode_altitude_expensive(int meters) -{ - double feet = meters / 0.3048; - - double encode = log(feet) / log(1.002); - return floor(encode + 0.5); -} - // This is where we go after reset. int main(int argc, char **argv) { - int e, x; - int a; - - for (a = 1; a < 100000; a++) { - e = ao_aprs_encode_altitude(a); - x = ao_aprs_encode_altitude_expensive(a); - - if (e != x) { - double back_feet, back_meters; - back_feet = pow(1.002, e); - back_meters = back_feet * 0.3048; - fprintf (stderr, "APRS altitude encoding failure: altitude %d actual %d expected %d actual meters %f\n", - a, e, x, back_meters); - } - } - audio_gap(1); ao_gps_data.latitude = (45.0 + 28.25 / 60.0) * 10000000; ao_gps_data.longitude = (-(122 + 44.2649 / 60.0)) * 10000000; - ao_gps_data.altitude = 84; + AO_TELEMETRY_LOCATION_SET_ALTITUDE(&ao_gps_data, 84); ao_gps_data.flags = (AO_GPS_VALID|AO_GPS_RUNNING); /* Transmit one packet */ |