rx-debugging: always dump symbols on packet boundaries

This commit is contained in:
Thomas Kolb 2024-07-20 22:30:27 +02:00
parent 12e727be00
commit 38010ea672

View file

@ -253,8 +253,9 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
float complex samples2dump[sample_count];
size_t nsamples2dump = 0;
float complex samples2dump2[sample_count];
size_t nsamples2dump2 = 0;
static float complex samples2dump_s[8192];
static size_t nsamples2dump_s = 0;
// cache configuration flags
bool is_central_node = options_is_flag_set(OPTIONS_FLAG_IS_CENTRAL_NODE);
@ -431,7 +432,10 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
var_array_cf_append(&rx->packet_debug_info.data_symbols, mixed_sample);
samples2dump2[nsamples2dump2++] = mixed_sample;
if(nsamples2dump_s < sizeof(samples2dump_s)/sizeof(samples2dump_s[0])) {
samples2dump_s[nsamples2dump_s++] = mixed_sample;
}
if(symbol_counter < rx->payload_len_symbols) {
unsigned int sym_demod;
modem_demodulate(rx->payload_demod, mixed_sample, &sym_demod);
@ -450,6 +454,9 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
unsigned char payload_enc[rx->payload_len_enc_bytes];
unsigned char payload[rx->payload_len_bytes+1];
dump_array_cf(samples2dump_s, nsamples2dump_s, 1.0f/(SYMBOL_RATE), "/tmp/rx_dbg2.cpx64");
nsamples2dump_s = 0;
// store debug info about the data
rx->packet_debug_info.data_rssi = agc_crcf_get_rssi(rx->agc);
rx->packet_debug_info.data_evm = -1e38f; // FIXME
@ -508,7 +515,6 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
assert(nsamples2dump <= (sizeof(samples2dump) / sizeof(samples2dump[0])));
dump_array_cf(samples2dump, nsamples2dump, 1.0f/(RRC_SPS * SYMBOL_RATE), "/tmp/rx_dbg.cpx64");
dump_array_cf(samples2dump2, nsamples2dump2, 1.0f/(SYMBOL_RATE), "/tmp/rx_dbg2.cpx64");
return OK;
}