kopia lustrzana https://github.com/DL7AD/pecanpico10
Restructure config APRS and DIGI settings/layout
rodzic
64180130e9
commit
2196dee766
|
|
@ -124,7 +124,10 @@ const conf_t conf_flash_default = {
|
|||
.active = true,
|
||||
.init_delay = TIME_S2I(20)
|
||||
},
|
||||
.rx = { // The receive identity for APRS
|
||||
// Default APRS frequency when geofence not resolved
|
||||
.freq = 145175000,
|
||||
// The receive identity for APRS
|
||||
.rx = {
|
||||
.radio_conf = {
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.mod = MOD_AFSK,
|
||||
|
|
@ -134,36 +137,36 @@ const conf_t conf_flash_default = {
|
|||
.call = "VK2GJ-4",
|
||||
.symbol = SYM_ANTENNA // Use this symbol in message responses
|
||||
},
|
||||
.tx = { // The transmit identity for digipeat transmit and messages responses
|
||||
// The transmit identity for digipeat transmit and messages responses
|
||||
.digi = {
|
||||
.radio_conf = {
|
||||
.freq = FREQ_APRS_RECEIVE,
|
||||
.pwr = 0x7F,
|
||||
.mod = MOD_AFSK,
|
||||
.cca = 0x4F
|
||||
},
|
||||
.active = true,
|
||||
// Node tx identity
|
||||
.call = "VK2GJ-5",
|
||||
.path = "WIDE2-1",
|
||||
.symbol = SYM_DIGIPEATER,
|
||||
.beacon = true,
|
||||
.gps = false,
|
||||
// A set location if GPS not enabled or unable to acquire lock.
|
||||
.lat = -337331175, // Degress (1e-7)
|
||||
.lon = 1511143478, // Degrees (1e-7)
|
||||
.alt = 144, // Alt in metres
|
||||
.beacon = true, // Set to have digi beacon position and telem
|
||||
.cycle = TIME_S2I(60*30), // Position and telem beacon interval
|
||||
.gps = false, // Set to have digi use GPS for position
|
||||
// A set location if GPS not enabled or unable to acquire lock.
|
||||
.lat = -337331175, // Degrees (1e-7)
|
||||
.lon = 1511143478, // Degrees (1e-7)
|
||||
.alt = 144, // Altitude in metres
|
||||
|
||||
.tel_enc_cycle = TIME_S2I(60*180) // How often to send telemetry config
|
||||
},
|
||||
// The base station identity
|
||||
.base = {
|
||||
// The base station identity
|
||||
// Tracker originated messages can be sent to this call sign sent
|
||||
// Tracker originated messages will be sent to this call sign if enabled
|
||||
.enabled = true,
|
||||
.call = "VK2GJ-7",
|
||||
.path = "WIDE2-1",
|
||||
},
|
||||
.dig_active = true,
|
||||
.freq = 145175000 // Default APRS frequency when geofence not resolved
|
||||
},
|
||||
|
||||
// Power control
|
||||
|
|
|
|||
|
|
@ -62,139 +62,141 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
radio_freq_t freq; // 0: APRS region frequency (determined by geofencing), f>0 static frequency
|
||||
mod_t mod;
|
||||
link_speed_t speed;
|
||||
radio_squelch_t rssi;
|
||||
mod_t mod;
|
||||
link_speed_t speed;
|
||||
radio_squelch_t rssi;
|
||||
} radio_rx_conf_t; // Radio / Modulation
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
sysinterval_t init_delay;
|
||||
sysinterval_t send_spacing;
|
||||
sleep_conf_t sleep_conf;
|
||||
sysinterval_t cycle; // Cycle time (0: continously)
|
||||
sysinterval_t duration;
|
||||
bool active;
|
||||
sysinterval_t init_delay;
|
||||
sysinterval_t send_spacing;
|
||||
sleep_conf_t sleep_conf;
|
||||
sysinterval_t cycle; // Cycle time (0: continously)
|
||||
sysinterval_t duration;
|
||||
} thread_conf_t; // Thread
|
||||
|
||||
typedef struct {
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool aprs_msg;
|
||||
sysinterval_t tel_enc_cycle;
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool aprs_msg;
|
||||
sysinterval_t tel_enc_cycle;
|
||||
} thd_pos_conf_t;
|
||||
|
||||
typedef struct {
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
|
||||
resolution_t res; // Picture resolution
|
||||
uint8_t quality; // SSDV Quality ranging from 0-7
|
||||
uint32_t buf_size; // SRAM buffer size for the picture
|
||||
resolution_t res; // Picture resolution
|
||||
uint8_t quality; // SSDV Quality ranging from 0-7
|
||||
uint32_t buf_size; // SRAM buffer size for the picture
|
||||
} thd_img_conf_t;
|
||||
|
||||
typedef struct {
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
thread_conf_t thread_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
|
||||
uint8_t density; // Density of log points being sent out in 1/x (value 10 => 10%)
|
||||
uint8_t density; // Density of log points being sent out in 1/x (value 10 => 10%)
|
||||
} thd_log_conf_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
radio_rx_conf_t radio_conf;
|
||||
aprs_sym_t symbol;
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
radio_rx_conf_t radio_conf;
|
||||
aprs_sym_t symbol;
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
} thd_rx_conf_t;
|
||||
|
||||
typedef struct {
|
||||
radio_tx_conf_t radio_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
} thd_tx_conf_t;
|
||||
|
||||
typedef struct {
|
||||
radio_tx_conf_t radio_conf;
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool enabled;
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool enabled;
|
||||
} thd_base_conf_t;
|
||||
|
||||
typedef struct {
|
||||
radio_tx_conf_t radio_conf;
|
||||
bool active; // Digipeater active flag
|
||||
radio_tx_conf_t radio_conf;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool enabled;
|
||||
bool beacon;
|
||||
bool gps;
|
||||
gps_coord_t lat;
|
||||
gps_coord_t lon;
|
||||
gps_alt_t alt;
|
||||
sysinterval_t cycle; // Beacon interval (0: continously)
|
||||
sysinterval_t tel_enc_cycle;
|
||||
|
||||
// Protocol
|
||||
char call[AX25_MAX_ADDR_LEN];
|
||||
char path[16];
|
||||
aprs_sym_t symbol;
|
||||
bool enabled;
|
||||
bool beacon;
|
||||
bool gps;
|
||||
gps_coord_t lat;
|
||||
gps_coord_t lon;
|
||||
gps_alt_t alt;
|
||||
sysinterval_t cycle; // Beacon interval (0: continously)
|
||||
sysinterval_t tel_enc_cycle;
|
||||
} thd_digi_conf_t;
|
||||
|
||||
/* APRS configuration. */
|
||||
typedef struct {
|
||||
thread_conf_t thread_conf;
|
||||
thd_rx_conf_t rx;
|
||||
thd_digi_conf_t tx;
|
||||
thd_digi_conf_t digi;
|
||||
thd_base_conf_t base; // Base station receiving unsolicited sends
|
||||
bool dig_active; // Digipeater active flag
|
||||
|
||||
radio_freq_t freq; // Default APRS frequency if no GPS
|
||||
} thd_aprs_conf_t;
|
||||
|
||||
typedef struct {
|
||||
thd_pos_conf_t pos_pri; // Primary position thread configuration
|
||||
thd_pos_conf_t pos_sec; // Secondary position thread configuration
|
||||
thd_pos_conf_t pos_pri; // Primary position thread configuration
|
||||
thd_pos_conf_t pos_sec; // Secondary position thread configuration
|
||||
|
||||
thd_img_conf_t img_pri; // Primary image thread configuration
|
||||
thd_img_conf_t img_sec; // Secondary image thread configuration
|
||||
thd_img_conf_t img_pri; // Primary image thread configuration
|
||||
thd_img_conf_t img_sec; // Secondary image thread configuration
|
||||
|
||||
thd_log_conf_t log; // Log transmission configuration
|
||||
thd_aprs_conf_t aprs;
|
||||
thd_log_conf_t log; // Log transmission configuration
|
||||
thd_aprs_conf_t aprs;
|
||||
|
||||
bool keep_cam_switched_on; // Keep camera switched on and initialized, this makes image capturing faster but takes a lot of power over long time
|
||||
bool keep_cam_switched_on; // Keep camera switched on and initialized, this makes image capturing faster but takes a lot of power over long time
|
||||
|
||||
volt_level_t gps_on_vbat; // Battery voltage threshold at which GPS is switched on
|
||||
volt_level_t gps_off_vbat; // Battery voltage threshold at which GPS is switched off
|
||||
volt_level_t gps_onper_vbat; // Battery voltage threshold at which GPS is kept switched on all time. This value must be larger
|
||||
// When gps_on_vbat and gps_off_vbat otherwise this value has no effect. Value 0 disables this feature
|
||||
uint32_t gps_pressure; // Air pressure below which GPS is switched to airborne mode
|
||||
gps_hp_model_t gps_low_alt; // Model to use when air pressure is above gps_pa_threshold
|
||||
gps_lp_model_t gps_high_alt; // Model to use when air pressure is below gps_pa_threshold
|
||||
uint32_t magic; // Key that indicates if the flash is loaded or has been updated
|
||||
uint16_t crc; // CRC to verify content
|
||||
volt_level_t gps_on_vbat; // Battery voltage threshold at which GPS is switched on
|
||||
volt_level_t gps_off_vbat; // Battery voltage threshold at which GPS is switched off
|
||||
volt_level_t gps_onper_vbat; // Battery voltage threshold at which GPS is kept switched on all time. This value must be larger
|
||||
// When gps_on_vbat and gps_off_vbat otherwise this value has no effect. Value 0 disables this feature
|
||||
uint32_t gps_pressure; // Air pressure below which GPS is switched to airborne mode
|
||||
gps_hp_model_t gps_low_alt; // Model to use when air pressure is above gps_pa_threshold
|
||||
gps_lp_model_t gps_high_alt; // Model to use when air pressure is below gps_pa_threshold
|
||||
uint32_t magic; // Key that indicates if the flash is loaded or has been updated
|
||||
uint16_t crc; // CRC to verify content
|
||||
} conf_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t type;
|
||||
char name[64];
|
||||
size_t size;
|
||||
void *ptr;
|
||||
uint8_t type;
|
||||
char name[64];
|
||||
size_t size;
|
||||
void *ptr;
|
||||
} conf_command_t;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -266,20 +266,20 @@ void usb_cmd_send_aprs_message(BaseSequentialStream *chp, int argc, char *argv[]
|
|||
chprintf(chp, "Message: %s\r\n", m);
|
||||
|
||||
/* Send with ack request (last arg true). */
|
||||
packet_t packet = aprs_encode_message(conf_sram.aprs.tx.call,
|
||||
conf_sram.aprs.tx.path,
|
||||
packet_t packet = aprs_encode_message(conf_sram.aprs.digi.call,
|
||||
conf_sram.aprs.digi.path,
|
||||
argv[0], m, true);
|
||||
if(packet == NULL) {
|
||||
TRACE_WARN("CMD > No free packet objects");
|
||||
return;
|
||||
}
|
||||
transmitOnRadio(packet,
|
||||
conf_sram.aprs.tx.radio_conf.freq,
|
||||
conf_sram.aprs.digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf_sram.aprs.tx.radio_conf.pwr,
|
||||
conf_sram.aprs.tx.radio_conf.mod,
|
||||
conf_sram.aprs.tx.radio_conf.cca);
|
||||
conf_sram.aprs.digi.radio_conf.pwr,
|
||||
conf_sram.aprs.digi.radio_conf.mod,
|
||||
conf_sram.aprs.digi.radio_conf.cca);
|
||||
|
||||
chprintf(chp, "Message sent!\r\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ const conf_command_t command_list[] = {
|
|||
|
||||
{TYPE_INT, "aprs.rx.freq", sizeof(conf_sram.aprs.rx.radio_conf.freq), &conf_sram.aprs.rx.radio_conf.freq },
|
||||
{TYPE_INT, "aprs.rx.mod", sizeof(conf_sram.aprs.rx.radio_conf.mod), &conf_sram.aprs.rx.radio_conf.mod },
|
||||
{TYPE_INT, "aprs.rx.speed", sizeof(conf_sram.aprs.rx.radio_conf.speed), &conf_sram.aprs.tx.radio_conf.speed },
|
||||
{TYPE_INT, "aprs.rx.speed", sizeof(conf_sram.aprs.rx.radio_conf.speed), &conf_sram.aprs.rx.radio_conf.speed },
|
||||
{TYPE_STR, "aprs.rx.call", sizeof(conf_sram.aprs.rx.call), &conf_sram.aprs.rx.call },
|
||||
|
||||
{TYPE_INT, "aprs.base.freq", sizeof(conf_sram.aprs.base.radio_conf.freq), &conf_sram.aprs.base.radio_conf.freq },
|
||||
|
|
@ -144,20 +144,20 @@ const conf_command_t command_list[] = {
|
|||
{TYPE_INT, "aprs.base.cca", sizeof(conf_sram.aprs.base.radio_conf.cca), &conf_sram.aprs.base.radio_conf.cca },
|
||||
{TYPE_STR, "aprs.base.call", sizeof(conf_sram.aprs.base.call), &conf_sram.aprs.base.call },
|
||||
|
||||
{TYPE_INT, "aprs.tx.freq", sizeof(conf_sram.aprs.tx.radio_conf.freq), &conf_sram.aprs.tx.radio_conf.freq },
|
||||
{TYPE_INT, "aprs.tx.pwr", sizeof(conf_sram.aprs.tx.radio_conf.pwr), &conf_sram.aprs.tx.radio_conf.pwr },
|
||||
{TYPE_INT, "aprs.tx.mod", sizeof(conf_sram.aprs.tx.radio_conf.mod), &conf_sram.aprs.tx.radio_conf.mod },
|
||||
{TYPE_INT, "aprs.tx.cca", sizeof(conf_sram.aprs.tx.radio_conf.cca), &conf_sram.aprs.tx.radio_conf.cca },
|
||||
{TYPE_STR, "aprs.tx.call", sizeof(conf_sram.aprs.tx.call), &conf_sram.aprs.tx.call },
|
||||
{TYPE_STR, "aprs.tx.path", sizeof(conf_sram.aprs.tx.path), &conf_sram.aprs.tx.path },
|
||||
{TYPE_INT, "aprs.tx.symbol", sizeof(conf_sram.aprs.tx.symbol), &conf_sram.aprs.tx.symbol },
|
||||
{TYPE_INT, "aprs.tx.beacon", sizeof(conf_sram.aprs.tx.beacon), &conf_sram.aprs.tx.beacon },
|
||||
{TYPE_INT, "aprs.tx.gps", sizeof(conf_sram.aprs.tx.gps), &conf_sram.aprs.tx.gps },
|
||||
{TYPE_INT, "aprs.tx.lat", sizeof(conf_sram.aprs.tx.lat), &conf_sram.aprs.tx.lat },
|
||||
{TYPE_INT, "aprs.tx.lon", sizeof(conf_sram.aprs.tx.lon), &conf_sram.aprs.tx.lon },
|
||||
{TYPE_INT, "aprs.tx.alt", sizeof(conf_sram.aprs.tx.alt), &conf_sram.aprs.tx.alt },
|
||||
{TYPE_INT, "aprs.tx.cycle" , sizeof(conf_sram.aprs.tx.cycle), &conf_sram.aprs.tx.cycle },
|
||||
{TYPE_INT, "aprs.dig_active", sizeof(conf_sram.aprs.dig_active), &conf_sram.aprs.dig_active },
|
||||
{TYPE_INT, "aprs.digi.freq", sizeof(conf_sram.aprs.digi.radio_conf.freq), &conf_sram.aprs.digi.radio_conf.freq },
|
||||
{TYPE_INT, "aprs.digi.pwr", sizeof(conf_sram.aprs.digi.radio_conf.pwr), &conf_sram.aprs.digi.radio_conf.pwr },
|
||||
{TYPE_INT, "aprs.digi.mod", sizeof(conf_sram.aprs.digi.radio_conf.mod), &conf_sram.aprs.digi.radio_conf.mod },
|
||||
{TYPE_INT, "aprs.digi.cca", sizeof(conf_sram.aprs.digi.radio_conf.cca), &conf_sram.aprs.digi.radio_conf.cca },
|
||||
{TYPE_STR, "aprs.digi.call", sizeof(conf_sram.aprs.digi.call), &conf_sram.aprs.digi.call },
|
||||
{TYPE_STR, "aprs.digi.path", sizeof(conf_sram.aprs.digi.path), &conf_sram.aprs.digi.path },
|
||||
{TYPE_INT, "aprs.digi.symbol", sizeof(conf_sram.aprs.digi.symbol), &conf_sram.aprs.digi.symbol },
|
||||
{TYPE_INT, "aprs.digi.beacon", sizeof(conf_sram.aprs.digi.beacon), &conf_sram.aprs.digi.beacon },
|
||||
{TYPE_INT, "aprs.digi.gps", sizeof(conf_sram.aprs.digi.gps), &conf_sram.aprs.digi.gps },
|
||||
{TYPE_INT, "aprs.digi.lat", sizeof(conf_sram.aprs.digi.lat), &conf_sram.aprs.digi.lat },
|
||||
{TYPE_INT, "aprs.digi.lon", sizeof(conf_sram.aprs.digi.lon), &conf_sram.aprs.digi.lon },
|
||||
{TYPE_INT, "aprs.digi.alt", sizeof(conf_sram.aprs.digi.alt), &conf_sram.aprs.digi.alt },
|
||||
{TYPE_INT, "aprs.digi.cycle", sizeof(conf_sram.aprs.digi.cycle), &conf_sram.aprs.digi.cycle },
|
||||
{TYPE_INT, "aprs.digi.digi_active", sizeof(conf_sram.aprs.digi.active), &conf_sram.aprs.digi.active },
|
||||
{TYPE_INT, "aprs.freq", sizeof(conf_sram.aprs.freq), &conf_sram.aprs.freq },
|
||||
{TYPE_INT, "keep_cam_switched_on", sizeof(conf_sram.keep_cam_switched_on), &conf_sram.keep_cam_switched_on },
|
||||
{TYPE_INT, "gps_on_vbat", sizeof(conf_sram.gps_on_vbat), &conf_sram.gps_on_vbat },
|
||||
|
|
@ -1088,14 +1088,14 @@ static bool aprs_decode_message(packet_t pp) {
|
|||
aprs_identity_t identity = {0};
|
||||
|
||||
strcpy(identity.src, src);
|
||||
strcpy(identity.call, conf_sram.aprs.tx.call);
|
||||
strcpy(identity.call, conf_sram.aprs.digi.call);
|
||||
/* TODO: define a length for path. */
|
||||
strcpy(identity.path, conf_sram.aprs.tx.path);
|
||||
identity.symbol = conf_sram.aprs.tx.symbol;
|
||||
identity.freq = conf_sram.aprs.tx.radio_conf.freq;
|
||||
identity.pwr = conf_sram.aprs.tx.radio_conf.pwr;
|
||||
identity.mod = conf_sram.aprs.tx.radio_conf.mod;
|
||||
identity.cca = conf_sram.aprs.tx.radio_conf.cca;
|
||||
strcpy(identity.path, conf_sram.aprs.digi.path);
|
||||
identity.symbol = conf_sram.aprs.digi.symbol;
|
||||
identity.freq = conf_sram.aprs.digi.radio_conf.freq;
|
||||
identity.pwr = conf_sram.aprs.digi.radio_conf.pwr;
|
||||
identity.mod = conf_sram.aprs.digi.radio_conf.mod;
|
||||
identity.cca = conf_sram.aprs.digi.radio_conf.cca;
|
||||
|
||||
/* Check which nodes are enabled to accept APRS messages. */
|
||||
bool pos_pri = !strcmp(conf_sram.pos_pri.call, dest)
|
||||
|
|
@ -1125,9 +1125,9 @@ static bool aprs_decode_message(packet_t pp) {
|
|||
/* Other parameters come from tx identity. */
|
||||
}
|
||||
|
||||
bool aprs_tx = !strcmp(conf_sram.aprs.tx.call, dest)
|
||||
bool aprs_tx = !strcmp(conf_sram.aprs.digi.call, dest)
|
||||
&& (conf_sram.aprs.thread_conf.active)
|
||||
&& (conf_sram.aprs.dig_active);
|
||||
&& (conf_sram.aprs.digi.active);
|
||||
/* Default already set tx parameters. */
|
||||
|
||||
/* Check if this is message and address is one of the nodes on this device. */
|
||||
|
|
@ -1246,18 +1246,18 @@ static void aprs_digipeat(packet_t pp) {
|
|||
|
||||
if(!dedupe_check(pp, 0)) { // Last identical packet older than 10 seconds
|
||||
packet_t result = digipeat_match(0, pp, conf_sram.aprs.rx.call,
|
||||
conf_sram.aprs.tx.call, alias_re,
|
||||
conf_sram.aprs.digi.call, alias_re,
|
||||
wide_re, 0, preempt, NULL);
|
||||
if(result != NULL) { // Should be digipeated
|
||||
dedupe_remember(result, 0);
|
||||
/* If transmit fails the packet buffer is released. */
|
||||
if(!transmitOnRadio(result,
|
||||
conf_sram.aprs.tx.radio_conf.freq,
|
||||
conf_sram.aprs.digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf_sram.aprs.tx.radio_conf.pwr,
|
||||
conf_sram.aprs.tx.radio_conf.mod,
|
||||
conf_sram.aprs.tx.radio_conf.cca)) {
|
||||
conf_sram.aprs.digi.radio_conf.pwr,
|
||||
conf_sram.aprs.digi.radio_conf.mod,
|
||||
conf_sram.aprs.digi.radio_conf.cca)) {
|
||||
TRACE_INFO("RX > Failed to digipeat packet");
|
||||
} /* TX failed. */
|
||||
} /* Should be digipeated. */
|
||||
|
|
@ -1344,7 +1344,7 @@ void aprs_decode_packet(packet_t pp) {
|
|||
}
|
||||
|
||||
// Digipeat packet
|
||||
if(conf_sram.aprs.dig_active && digipeat) {
|
||||
if(conf_sram.aprs.digi.active && digipeat) {
|
||||
aprs_digipeat(pp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,9 +370,9 @@ THD_FUNCTION(collectorThread, arg) {
|
|||
} else if(conf_sram.pos_sec.thread_conf.active) { // Only secondary position thread is active
|
||||
data_cycle_time = conf_sram.pos_sec.thread_conf.cycle;
|
||||
(*useGPS)++;
|
||||
} else if(conf_sram.aprs.thread_conf.active && conf_sram.aprs.tx.beacon) { // APRS beacon is active
|
||||
data_cycle_time = conf_sram.aprs.tx.cycle;
|
||||
if(conf_sram.aprs.tx.gps) {
|
||||
} else if(conf_sram.aprs.thread_conf.active && conf_sram.aprs.digi.beacon) { // DIGI beacon is active
|
||||
data_cycle_time = conf_sram.aprs.digi.cycle;
|
||||
if(conf_sram.aprs.digi.gps) {
|
||||
(*useGPS)++;
|
||||
}
|
||||
} else { // There must be an error
|
||||
|
|
@ -427,9 +427,9 @@ THD_FUNCTION(collectorThread, arg) {
|
|||
TRACE_INFO("COLL > Using fixed location");
|
||||
getTime(&time);
|
||||
unixTimestamp2Date(&time, tp->gps_time);
|
||||
tp->gps_alt = conf_sram.aprs.tx.alt;
|
||||
tp->gps_lat = conf_sram.aprs.tx.lat;
|
||||
tp->gps_lon = conf_sram.aprs.tx.lon;
|
||||
tp->gps_alt = conf_sram.aprs.digi.alt;
|
||||
tp->gps_lat = conf_sram.aprs.digi.lat;
|
||||
tp->gps_lon = conf_sram.aprs.digi.lon;
|
||||
tp->gps_state = GPS_FIXED;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
|
||||
// Set telemetry configuration transmission variables
|
||||
sysinterval_t last_conf_transmission =
|
||||
chVTGetSystemTime() - conf->tx.tel_enc_cycle;
|
||||
chVTGetSystemTime() - conf->digi.tel_enc_cycle;
|
||||
sysinterval_t time = chVTGetSystemTime();
|
||||
|
||||
while(true) {
|
||||
|
|
@ -39,35 +39,35 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
if(!p_sleep(&conf->thread_conf.sleep_conf)) {
|
||||
|
||||
// Telemetry encoding parameter transmissions
|
||||
if(conf->tx.tel_enc_cycle != 0 && last_conf_transmission
|
||||
+ conf->tx.tel_enc_cycle < chVTGetSystemTime()) {
|
||||
if(conf->digi.tel_enc_cycle != 0 && last_conf_transmission
|
||||
+ conf->digi.tel_enc_cycle < chVTGetSystemTime()) {
|
||||
|
||||
TRACE_INFO("BCN > Transmit telemetry configuration");
|
||||
|
||||
// Encode and transmit telemetry config packet
|
||||
for(uint8_t type = 0; type < APRS_NUM_TELEM_GROUPS; type++) {
|
||||
packet_t packet = aprs_encode_telemetry_configuration(
|
||||
conf->tx.call,
|
||||
conf->tx.path,
|
||||
conf->tx.call,
|
||||
conf->digi.call,
|
||||
conf->digi.path,
|
||||
conf->digi.call,
|
||||
type);
|
||||
if(packet == NULL) {
|
||||
TRACE_WARN("BCN > No free packet objects for"
|
||||
" telemetry config transmission");
|
||||
} else {
|
||||
if(!transmitOnRadio(packet,
|
||||
conf->tx.radio_conf.freq,
|
||||
conf->digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf->tx.radio_conf.pwr,
|
||||
conf->tx.radio_conf.mod,
|
||||
conf->tx.radio_conf.cca)) {
|
||||
conf->digi.radio_conf.pwr,
|
||||
conf->digi.radio_conf.mod,
|
||||
conf->digi.radio_conf.cca)) {
|
||||
TRACE_ERROR("BCN > Failed to transmit telemetry config");
|
||||
}
|
||||
}
|
||||
chThdSleep(TIME_S2I(5));
|
||||
}
|
||||
last_conf_transmission += conf->tx.tel_enc_cycle;
|
||||
last_conf_transmission += conf->digi.tel_enc_cycle;
|
||||
}
|
||||
|
||||
if(dataPoint->gps_state == GPS_FIXED
|
||||
|
|
@ -77,21 +77,21 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
TRACE_INFO("BCN > Transmit position and telemetry");
|
||||
|
||||
// Encode/Transmit position packet
|
||||
packet_t packet = aprs_encode_position_and_telemetry(conf->tx.call,
|
||||
conf->tx.path,
|
||||
conf->tx.symbol,
|
||||
packet_t packet = aprs_encode_position_and_telemetry(conf->digi.call,
|
||||
conf->digi.path,
|
||||
conf->digi.symbol,
|
||||
dataPoint, true);
|
||||
if(packet == NULL) {
|
||||
TRACE_WARN("BCN > No free packet objects"
|
||||
" for position transmission");
|
||||
} else {
|
||||
if(!transmitOnRadio(packet,
|
||||
conf->tx.radio_conf.freq,
|
||||
conf->digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf->tx.radio_conf.pwr,
|
||||
conf->tx.radio_conf.mod,
|
||||
conf->tx.radio_conf.cca)) {
|
||||
conf->digi.radio_conf.pwr,
|
||||
conf->digi.radio_conf.mod,
|
||||
conf->digi.radio_conf.cca)) {
|
||||
TRACE_ERROR("BCN > failed to transmit beacon data");
|
||||
}
|
||||
chThdSleep(TIME_S2I(5));
|
||||
|
|
@ -112,7 +112,7 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
* There is no acknowledgment requested.
|
||||
*/
|
||||
packet = aprs_compose_aprsd_message(
|
||||
conf->tx.call,
|
||||
conf->digi.call,
|
||||
conf->base.path,
|
||||
call);
|
||||
if(packet == NULL) {
|
||||
|
|
@ -120,12 +120,12 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
"or badly formed APRSD message");
|
||||
} else {
|
||||
if(!transmitOnRadio(packet,
|
||||
conf->tx.radio_conf.freq,
|
||||
conf->digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf->tx.radio_conf.pwr,
|
||||
conf->tx.radio_conf.mod,
|
||||
conf->tx.radio_conf.cca
|
||||
conf->digi.radio_conf.pwr,
|
||||
conf->digi.radio_conf.mod,
|
||||
conf->digi.radio_conf.cca
|
||||
)) {
|
||||
TRACE_ERROR("BCN > Failed to transmit APRSD data");
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ THD_FUNCTION(bcnThread, arg) {
|
|||
continue;
|
||||
}
|
||||
} /* psleep */
|
||||
time = waitForTrigger(time, conf->tx.cycle);
|
||||
time = waitForTrigger(time, conf->digi.cycle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,12 +118,12 @@ THD_FUNCTION(posThread, arg)
|
|||
"or badly formed APRSD message");
|
||||
} else {
|
||||
if(!transmitOnRadio(packet,
|
||||
conf_sram.aprs.tx.radio_conf.freq,
|
||||
conf_sram.aprs.digi.radio_conf.freq,
|
||||
0,
|
||||
0,
|
||||
conf_sram.aprs.tx.radio_conf.pwr,
|
||||
conf_sram.aprs.tx.radio_conf.mod,
|
||||
conf_sram.aprs.tx.radio_conf.cca
|
||||
conf_sram.aprs.digi.radio_conf.pwr,
|
||||
conf_sram.aprs.digi.radio_conf.mod,
|
||||
conf_sram.aprs.digi.radio_conf.cca
|
||||
)) {
|
||||
TRACE_ERROR("POS > Failed to transmit APRSD data");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ void start_user_threads(void)
|
|||
|
||||
if(conf_sram.log.thread_conf.active) start_logging_thread(&conf_sram.log);
|
||||
|
||||
if(conf_sram.aprs.thread_conf.active && conf_sram.aprs.tx.beacon)
|
||||
if(conf_sram.aprs.thread_conf.active && conf_sram.aprs.digi.beacon)
|
||||
start_beacon_thread(&conf_sram.aprs);
|
||||
|
||||
if(conf_sram.aprs.thread_conf.active) {
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue