kopia lustrzana https://github.com/bristol-seds/pico-tracker
[ariss] add ariss routines. These are geofenced only by areas where aprs is disallowed
rodzic
8604bef59a
commit
3408c801a8
|
@ -254,6 +254,15 @@
|
||||||
#define APRS_USE_GEOFENCE 1
|
#define APRS_USE_GEOFENCE 1
|
||||||
#define APRS_POWER RF_POWER_14dBm
|
#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
|
* Prefix
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,7 +37,8 @@ void location_prefix_update(int32_t lon_hn, int32_t lat_hn);
|
||||||
|
|
||||||
/* Decisions */
|
/* Decisions */
|
||||||
bool location_telemetry_active(void);
|
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);
|
int32_t location_aprs_frequency(void);
|
||||||
char* location_aprs_call(void);
|
char* location_aprs_call(void);
|
||||||
char* location_prefix(void);
|
char* location_prefix(void);
|
||||||
|
|
|
@ -340,10 +340,22 @@ bool location_telemetry_active(void)
|
||||||
/* Are we in a telemetry zone? */
|
/* Are we in a telemetry zone? */
|
||||||
return (current_telemetry_outline != -1);
|
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
|
* 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 */
|
/* true if aprs disallowed */
|
||||||
uint8_t no_aprs = (current_no_aprs_outline != -1);
|
uint8_t no_aprs = (current_no_aprs_outline != -1);
|
||||||
|
@ -354,7 +366,7 @@ bool location_aprs_active(void)
|
||||||
return in_zone && (!no_aprs);
|
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
|
* Where aprs is inactive this function return 144.8MHz anyhow
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -201,6 +201,43 @@ void aprs_telemetry(struct tracker_datapoint* dp)
|
||||||
idle(IDLE_TELEMETRY_ACTIVE);
|
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
|
* Pips telemetry
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
void rtty_telemetry(struct tracker_datapoint* dp);
|
void rtty_telemetry(struct tracker_datapoint* dp);
|
||||||
void contestia_telemetry(struct tracker_datapoint* dp);
|
void contestia_telemetry(struct tracker_datapoint* dp);
|
||||||
void aprs_telemetry(struct tracker_datapoint* dp);
|
void aprs_telemetry(struct tracker_datapoint* dp);
|
||||||
|
void ariss_telemetry(struct tracker_datapoint* dp);
|
||||||
void pips_telemetry(void);
|
void pips_telemetry(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,10 +75,11 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
|
||||||
#endif
|
#endif
|
||||||
#endif /* TELEMETRY_ENABLE */
|
#endif /* TELEMETRY_ENABLE */
|
||||||
|
|
||||||
|
|
||||||
/* APRS */
|
/* APRS */
|
||||||
#if APRS_ENABLE
|
#if APRS_ENABLE
|
||||||
#if APRS_USE_GEOFENCE
|
#if APRS_USE_GEOFENCE
|
||||||
if (location_aprs_active()) {
|
if (location_aprs_should_tx()) { /* transmit only when we *should* */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* APRS */
|
/* APRS */
|
||||||
|
@ -87,6 +89,29 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* APRS_ENABLE */
|
#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 */
|
#endif /* RF_TX_ENABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.frequency = location_aprs_frequency();
|
||||||
location_aprs_tc_results.prefix = location_prefix();
|
location_aprs_tc_results.prefix = location_prefix();
|
||||||
location_aprs_tc_results.callsign = aprs_callsign(location_aprs_call());
|
location_aprs_tc_results.callsign = aprs_callsign(location_aprs_call());
|
||||||
|
|
|
@ -32,6 +32,6 @@ __verification__ void location_aprs_file_tc(void) {
|
||||||
(int32_t)(location_aprs_file_tc_params.lon * 10 * 1000 * 1000)
|
(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();
|
location_aprs_file_tc_results.frequency = location_aprs_frequency();
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue