kopia lustrzana https://github.com/DL7AD/pecanpico10
Add radio step and chan to all config sections.
rodzic
5ad245387a
commit
e4d37c8faa
|
|
@ -11,19 +11,21 @@ const conf_t conf_flash_default = {
|
|||
// Primary position transmission thread
|
||||
.pos_pri = {
|
||||
.thread_conf = {
|
||||
.active = false,
|
||||
.cycle = TIME_S2I(120),
|
||||
.active = true,
|
||||
.cycle = TIME_S2I(300),
|
||||
.init_delay = TIME_S2I(5)
|
||||
},
|
||||
.radio_conf = {
|
||||
.pwr = 0x7F,
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.freq = 144000000,
|
||||
.step = 12500,
|
||||
.chan = 94,
|
||||
.mod = MOD_AFSK,
|
||||
.preamble = 200
|
||||
},
|
||||
|
||||
.call = "DL7AD-13",
|
||||
.path = "WIDE1-1",
|
||||
.call = "VK2GJ-15",
|
||||
.path = "WIDE2-1",
|
||||
.symbol = SYM_DIGIPEATER,
|
||||
|
||||
.tel_enc_cycle = TIME_S2I(10800),
|
||||
|
|
@ -38,6 +40,8 @@ const conf_t conf_flash_default = {
|
|||
.radio_conf = {
|
||||
.pwr = 0x7F,
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.step = 12500,
|
||||
.chan = 0,
|
||||
.mod = MOD_AFSK,
|
||||
.preamble = 200
|
||||
},
|
||||
|
|
@ -60,6 +64,8 @@ const conf_t conf_flash_default = {
|
|||
.radio_conf = {
|
||||
.pwr = 0x7F,
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.step = 12500,
|
||||
.chan = 0,
|
||||
.mod = MOD_AFSK,
|
||||
.preamble = 200,
|
||||
.redundantTx = true
|
||||
|
|
@ -82,6 +88,8 @@ const conf_t conf_flash_default = {
|
|||
.radio_conf = {
|
||||
.pwr = 0x7F,
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.step = 12500,
|
||||
.chan = 0,
|
||||
.mod = MOD_AFSK,
|
||||
.preamble = 200
|
||||
},
|
||||
|
|
@ -104,6 +112,8 @@ const conf_t conf_flash_default = {
|
|||
.radio_conf = {
|
||||
.pwr = 0x7F,
|
||||
.freq = FREQ_APRS_DYNAMIC,
|
||||
.step = 12500,
|
||||
.chan = 0,
|
||||
.mod = MOD_AFSK,
|
||||
.preamble = 200
|
||||
},
|
||||
|
|
|
|||
|
|
@ -165,7 +165,8 @@ void send_aprs_message(BaseSequentialStream *chp, int argc, char *argv[])
|
|||
packet_t packet = aprs_encode_message(conf_sram.rx.call,
|
||||
conf_sram.rx.path,
|
||||
argv[0], argv[1], false);
|
||||
transmitOnRadio(packet, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(packet,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
|
|||
|
|
@ -127,14 +127,38 @@ THD_FUNCTION(pktRadioManager, arg) {
|
|||
} /* End case PKT_RADIO_RX_STOP. */
|
||||
|
||||
case PKT_RADIO_TX: {
|
||||
/* TODO: Switch on encoding. */
|
||||
if(rx_active)
|
||||
pktPauseDecoder(handler);
|
||||
switch(task_object->type) {
|
||||
case DECODE_AFSK: {
|
||||
/*
|
||||
* TODO: The 446x driver currently pauses decoding
|
||||
* Consider moving it to here.
|
||||
*/
|
||||
/* switch(mod)
|
||||
{
|
||||
case MOD_2FSK:
|
||||
Si446x_send2FSK(pp, freq, step, chan, pwr, 9600);
|
||||
break;
|
||||
case MOD_AFSK:
|
||||
Si446x_sendAFSK(pp, freq, step, chan, pwr);
|
||||
break;
|
||||
}*/
|
||||
//=============================
|
||||
pktStartDecoder(handler);
|
||||
radio_squelch_t sq = task_object->squelch;
|
||||
//radio_freq_t freq = task_object->base_frequency;
|
||||
//channel_hz_t step = task_object->step_hz;
|
||||
radio_ch_t chan = task_object->channel;
|
||||
/* TODO: Use channel only to start receive. */
|
||||
Si446x_receiveNoLock(chan, sq, MOD_AFSK);
|
||||
rx_active = true;
|
||||
break;
|
||||
} /* End case PKT_RADIO_RX. */
|
||||
|
||||
/* TODO: Transmit code migrates into here... */
|
||||
|
||||
if(rx_active)
|
||||
pktResumeDecoder(handler);
|
||||
case DECODE_NOT_SET:
|
||||
case DECODE_FSK: {
|
||||
break;
|
||||
}
|
||||
} /* End switch on task_object->type. */
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,8 @@ static bool aprs_decode_message(packet_t pp)
|
|||
TRACE_INFO("RX > Message: Position query");
|
||||
trackPoint_t* trackPoint = getLastTrackPoint();
|
||||
packet_t pp = aprs_encode_position(conf_sram.rx.call, conf_sram.rx.path, conf_sram.rx.symbol, trackPoint);
|
||||
transmitOnRadio(pp, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(pp,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
@ -394,7 +395,8 @@ static bool aprs_decode_message(packet_t pp)
|
|||
|
||||
TRACE_INFO("RX > Message: Directs query");
|
||||
packet_t pp = aprs_encode_query_answer_aprsd(conf_sram.rx.call, conf_sram.rx.path, src);
|
||||
transmitOnRadio(pp, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(pp,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
@ -406,7 +408,8 @@ static bool aprs_decode_message(packet_t pp)
|
|||
char buf[16];
|
||||
chsnprintf(buf, sizeof(buf), "ack%s", msg_id_rx);
|
||||
packet_t pp = aprs_encode_message(conf_sram.rx.call, conf_sram.rx.path, src, buf, true);
|
||||
transmitOnRadio(pp, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(pp,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
@ -487,7 +490,8 @@ static bool aprs_decode_message(packet_t pp)
|
|||
char buf[16];
|
||||
chsnprintf(buf, sizeof(buf), "ack%s", msg_id_rx);
|
||||
packet_t pp = aprs_encode_message(conf_sram.rx.call, conf_sram.rx.path, src, buf, true);
|
||||
transmitOnRadio(pp, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(pp,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
@ -511,7 +515,8 @@ static void aprs_digipeat(packet_t pp)
|
|||
packet_t result = digipeat_match(0, pp, conf_sram.rx.call, conf_sram.rx.call, alias_re, wide_re, 0, preempt, NULL);
|
||||
if(result != NULL) { // Should be digipeated
|
||||
dedupe_remember(result, 0);
|
||||
transmitOnRadio(result, conf_sram.rx.radio_conf.freq,
|
||||
transmitOnRadio(result,
|
||||
conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
|
|
|
|||
|
|
@ -327,11 +327,12 @@ static void transmit_image_packet(const uint8_t *image, uint32_t image_len, thd_
|
|||
base91_encode(&pkt[6], pkt_base91, 174);
|
||||
|
||||
packet_t packet = aprs_encode_data_packet(conf->call, conf->path, 'I', pkt_base91);
|
||||
transmitOnRadio(packet, conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -362,11 +363,12 @@ static void transmit_image_packets(const uint8_t *image, uint32_t image_len, thd
|
|||
// Proccess redundant transmission from last cycle
|
||||
if(strlen((char*)pkt_base91) && conf->radio_conf.redundantTx) {
|
||||
packet_t packet = aprs_encode_data_packet(conf->call, conf->path, 'I', pkt_base91);
|
||||
transmitOnRadio(packet, conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
}
|
||||
|
||||
// Encode packet
|
||||
|
|
@ -399,11 +401,12 @@ static void transmit_image_packets(const uint8_t *image, uint32_t image_len, thd
|
|||
base91_encode(&pkt[6], pkt_base91, 174);
|
||||
|
||||
packet_t packet = aprs_encode_data_packet(conf->call, conf->path, 'I', pkt_base91);
|
||||
transmitOnRadio(packet, conf_sram.rx.radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
|
||||
chThdSleep(TIME_MS2I(10)); // Leave other threads some time
|
||||
|
||||
|
|
|
|||
|
|
@ -162,11 +162,12 @@ THD_FUNCTION(logThread, arg)
|
|||
packet_t packet = aprs_encode_data_packet(conf->call, conf->path, 'L', pkt_base91); // Encode packet
|
||||
|
||||
// Transmit packet
|
||||
transmitOnRadio(packet, conf->radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
} else {
|
||||
TRACE_INFO("LOG > No log point in memory");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,20 +42,22 @@ THD_FUNCTION(posThread, arg)
|
|||
|
||||
// Encode/Transmit position packet
|
||||
packet_t packet = aprs_encode_position(conf->call, conf->path, conf->symbol, trackPoint);
|
||||
transmitOnRadio(packet, conf->radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
chThdSleep(TIME_S2I(5));
|
||||
|
||||
// Encode/Transmit APRSD packet
|
||||
packet_t pp = aprs_encode_query_answer_aprsd(conf->call, conf->path, conf->call);
|
||||
transmitOnRadio(pp, conf->radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(pp,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
|
||||
// Telemetry encoding parameter transmission
|
||||
if(conf->tel_enc_cycle != 0 && last_conf_transmission + conf->tel_enc_cycle < chVTGetSystemTime())
|
||||
|
|
@ -68,11 +70,12 @@ THD_FUNCTION(posThread, arg)
|
|||
for(uint8_t type=0; type<4; type++)
|
||||
{
|
||||
packet = aprs_encode_telemetry_configuration(conf->call, conf->path, type);
|
||||
transmitOnRadio(packet, conf->radio_conf.freq,
|
||||
conf_sram.rx.radio_conf.step,
|
||||
conf_sram.rx.radio_conf.chan,
|
||||
conf_sram.rx.radio_conf.pwr,
|
||||
conf_sram.rx.radio_conf.mod);
|
||||
transmitOnRadio(packet,
|
||||
conf->radio_conf.freq,
|
||||
conf->radio_conf.step,
|
||||
conf->radio_conf.chan,
|
||||
conf->radio_conf.pwr,
|
||||
conf->radio_conf.mod);
|
||||
chThdSleep(TIME_S2I(5));
|
||||
}
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue