kopia lustrzana https://github.com/bristol-seds/pico-tracker
location bugfixes, fixed location test cases
rodzic
9136c4d52d
commit
de619c94a7
|
@ -182,7 +182,8 @@ void location_aprs_zone_update(int32_t lat_hn, int32_t lon_hn)
|
|||
}
|
||||
|
||||
/* Find which aprs zone we are in and save it */
|
||||
for (z = 0; z < 12; z++) { /* For each zone */
|
||||
uint32_t n_zones = sizeof(aprs_zones) / sizeof(struct aprs_zone_t);
|
||||
for (z = 0; z < n_zones; z++) { /* For each zone */
|
||||
|
||||
for (outline = 0; outline < aprs_zones[z].outline_count; outline++) {
|
||||
|
||||
|
|
|
@ -16,15 +16,15 @@ struct location_aprs_tc_params {
|
|||
/* Results out */
|
||||
struct location_aprs_tc_results {
|
||||
bool tx_allow;
|
||||
float frequency;
|
||||
double frequency;
|
||||
} location_aprs_tc_results;
|
||||
/* Function */
|
||||
__verification__ void location_aprs_tc(void) {
|
||||
|
||||
/* Supply co-ords in units of 100 nanodeg */
|
||||
location_aprs_update(
|
||||
(int32_t)(location_aprs_tc_params.lon * 10 * 1000 * 1000),
|
||||
(int32_t)(location_aprs_tc_params.lat * 10 * 1000 * 1000)
|
||||
(int32_t)(location_aprs_tc_params.lat * 10 * 1000 * 1000),
|
||||
(int32_t)(location_aprs_tc_params.lon * 10 * 1000 * 1000)
|
||||
);
|
||||
|
||||
location_aprs_tc_results.tx_allow = location_aprs_active();
|
||||
|
|
|
@ -56,6 +56,15 @@ class location_aprs_tc:
|
|||
# What frequency did we return?
|
||||
freq = float(result['frequency']) / (1000*1000)
|
||||
|
||||
if str(result['tx_allow']).startswith('false'): # No APRS
|
||||
if int(expected_freq) is 0:
|
||||
print_info("{}: NO APRS".format(name, freq))
|
||||
return True
|
||||
else:
|
||||
print_info("{} ({:.1f}, {:.1f}): Expected {:.9f}, Geofence NO APRS".format(
|
||||
name, params.lat, params.lon, expected_freq))
|
||||
return False
|
||||
|
||||
if freq == expected_freq:
|
||||
print_info("{}: {:.3f} MHz".format(name, freq))
|
||||
return True
|
||||
|
|
|
@ -28,8 +28,8 @@ __verification__ void location_aprs_file_tc(void) {
|
|||
|
||||
/* Supply co-ords in units of 100 nanodeg */
|
||||
location_aprs_update(
|
||||
(int32_t)(location_aprs_file_tc_params.lon * 10 * 1000 * 1000),
|
||||
(int32_t)(location_aprs_file_tc_params.lat * 10 * 1000 * 1000)
|
||||
(int32_t)(location_aprs_file_tc_params.lat * 10 * 1000 * 1000),
|
||||
(int32_t)(location_aprs_file_tc_params.lon * 10 * 1000 * 1000)
|
||||
);
|
||||
|
||||
location_aprs_file_tc_results.tx_allow = location_aprs_active();
|
||||
|
|
|
@ -51,12 +51,18 @@ class location_aprs_file_tc:
|
|||
Can use print_info
|
||||
"""
|
||||
freq = float(result['frequency']) / (1000*1000)
|
||||
tx_allow = str(result['tx_allow'])
|
||||
|
||||
print_info("({:.1f}, {:.1f}): {:.3f} MHz".format(
|
||||
params.lat, params.lon, freq))
|
||||
if str(result['tx_allow']).startswith('false'): # No APRS
|
||||
print_info("({:.1f}, {:.1f}): NO APRS".format(
|
||||
params.lat, params.lon))
|
||||
else:
|
||||
print_info("({:.1f}, {:.1f}): {:.3f} MHz".format(
|
||||
params.lat, params.lon, freq))
|
||||
|
||||
self.locations.append({
|
||||
'freq': freq,
|
||||
'tx_allow': tx_allow,
|
||||
'lat': params.lat,
|
||||
'lon': params.lon
|
||||
})
|
||||
|
|
|
@ -22,8 +22,8 @@ __verification__ void location_telemetry_tc(void) {
|
|||
|
||||
/* Supply co-ords in units of 100 nanodeg */
|
||||
location_telemetry_update(
|
||||
(int32_t)(location_telemetry_tc_params.lon * 10 * 1000 * 1000),
|
||||
(int32_t)(location_telemetry_tc_params.lat * 10 * 1000 * 1000)
|
||||
(int32_t)(location_telemetry_tc_params.lat * 10 * 1000 * 1000),
|
||||
(int32_t)(location_telemetry_tc_params.lon * 10 * 1000 * 1000)
|
||||
);
|
||||
|
||||
location_telemetry_tc_results.tx_allow = location_telemetry_active();
|
||||
|
|
File diff suppressed because one or more lines are too long
Ładowanie…
Reference in New Issue