[ariss] add ariss routines. These are geofenced only by areas where aprs is disallowed

main-solar-only
Richard Meadows 2016-03-24 14:06:24 +00:00
rodzic 8604bef59a
commit 3408c801a8
7 zmienionych plików z 90 dodań i 6 usunięć

Wyświetl plik

@ -254,6 +254,15 @@
#define APRS_USE_GEOFENCE 1
#define APRS_POWER RF_POWER_14dBm
/**
* ARISS APRS
* Geofence used is only "no aprs"
*/
#define ARISS_ENABLE 1
#define ARISS_USE_PREDICT 0
#define ARISS_USE_GEOFENCE 0
#define ARISS_FREQUENCY 145825000
/**
* Prefix
*/

Wyświetl plik

@ -37,7 +37,8 @@ void location_prefix_update(int32_t lon_hn, int32_t lat_hn);
/* Decisions */
bool location_telemetry_active(void);
bool location_aprs_active(void);
bool location_aprs_could_tx(void);
bool location_aprs_should_tx(void);
int32_t location_aprs_frequency(void);
char* location_aprs_call(void);
char* location_prefix(void);

Wyświetl plik

@ -340,10 +340,22 @@ bool location_telemetry_active(void)
/* Are we in a telemetry zone? */
return (current_telemetry_outline != -1);
}
/**
* Returns if aprs could be transmitted in the current location
*/
bool location_aprs_could_tx(void)
{
/* true if aprs disallowed */
uint8_t no_aprs = (current_no_aprs_outline != -1);
return !no_aprs;
}
/**
* Returns if aprs should be transmitted in the current location
*/
bool location_aprs_active(void)
bool location_aprs_should_tx(void)
{
/* true if aprs disallowed */
uint8_t no_aprs = (current_no_aprs_outline != -1);
@ -354,7 +366,7 @@ bool location_aprs_active(void)
return in_zone && (!no_aprs);
}
/**
* Returns the aprs frequency in the current zone.
* Returns the local aprs frequency in the current zone.
*
* Where aprs is inactive this function return 144.8MHz anyhow
*/

Wyświetl plik

@ -201,6 +201,43 @@ void aprs_telemetry(struct tracker_datapoint* dp)
idle(IDLE_TELEMETRY_ACTIVE);
}
}
/**
* ARISS telemetry
*/
void ariss_telemetry(struct tracker_datapoint* dp)
{
struct tracker_datapoint* backlog_dp_ptr;
if (gps_is_locked() == GPS_NO_LOCK) return; /* Don't bother with no GPS */
char* prefix = location_prefix();
char* call = location_aprs_call();
/* Set location */
aprs_set_datapoint(dp);
/* Set callsign and path */
aprs_set_callsign(call);
aprs_set_path(APRS_PATH_ARISS);
/* Set comment */
backlog_dp_ptr = get_backlog();
if (backlog_dp_ptr != NULL) { /* Backlog comment if we can */
aprs_set_backlog_comment(backlog_dp_ptr, prefix);
} else {
aprs_set_comment(prefix);
}
/* Set frequency */
telemetry_aprs_set_frequency(ARISS_FREQUENCY);
/* Transmit packet and wait */
telemetry_start(TELEMETRY_APRS, 0xFFFF);
while (telemetry_active()) {
idle(IDLE_TELEMETRY_ACTIVE);
}
}
/**
* Pips telemetry
*/

Wyświetl plik

@ -38,6 +38,7 @@
void rtty_telemetry(struct tracker_datapoint* dp);
void contestia_telemetry(struct tracker_datapoint* dp);
void aprs_telemetry(struct tracker_datapoint* dp);
void ariss_telemetry(struct tracker_datapoint* dp);
void pips_telemetry(void);
@ -74,10 +75,11 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
#endif
#endif /* TELEMETRY_ENABLE */
/* APRS */
#if APRS_ENABLE
#if APRS_USE_GEOFENCE
if (location_aprs_active()) {
if (location_aprs_should_tx()) { /* transmit only when we *should* */
#endif
/* APRS */
@ -87,6 +89,29 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
}
#endif
#endif /* APRS_ENABLE */
/* ARISS */
#if ARISS_ENABLE
#if ARISS_USE_PREDICT
if (true) { /* todo */
#endif
#if ARISS_USE_GEOFENCE
if (location_aprs_could_tx()) { /* transmit anywhere it's no disallowed */
#endif
/* ARISS */
ariss_telemetry(dp);
#if ARISS_USE_GEOFENCE
}
#endif
#if ARISS_USE_PREDICT
}
#endif
#endif /* ARISS_ENABLE */
#endif /* RF_TX_ENABLE */
}

Wyświetl plik

@ -36,7 +36,7 @@ __verification__ void location_aprs_tc(void) {
);
location_aprs_tc_results.tx_allow = location_aprs_active();
location_aprs_tc_results.tx_allow = location_aprs_could_tx();
location_aprs_tc_results.frequency = location_aprs_frequency();
location_aprs_tc_results.prefix = location_prefix();
location_aprs_tc_results.callsign = aprs_callsign(location_aprs_call());

Wyświetl plik

@ -32,6 +32,6 @@ __verification__ void location_aprs_file_tc(void) {
(int32_t)(location_aprs_file_tc_params.lon * 10 * 1000 * 1000)
);
location_aprs_file_tc_results.tx_allow = location_aprs_active();
location_aprs_file_tc_results.tx_allow = location_aprs_could_tx();
location_aprs_file_tc_results.frequency = location_aprs_frequency();
}