pdu: refactor error logging

just some refactoring of error messages when a PDU packing error occurs
master
Andre Puschmann 4 years ago
parent 49186e2b1f
commit b08a586fd4

@ -354,34 +354,40 @@ uint8_t* sch_pdu::write_packet(srslte::log_ref log_h)
if (buffer_tx->N_bytes != pdu_len) { if (buffer_tx->N_bytes != pdu_len) {
if (log_h) { if (log_h) {
srslte::console("\n------------------------------\n"); srslte::console("------------------------------\n");
for (int i = 0; i < nof_subheaders; i++) { srslte::console("Wrote PDU: pdu_len=%d, expected_pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, "
srslte::console( "onepad=%d, multi=%d\n",
"SUBH %d is_sdu=%d, payload=%d\n", i, subheaders[i].is_sdu(), subheaders[i].get_payload_size()); buffer_tx->N_bytes,
} pdu_len,
srslte::console("Wrote PDU: pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, " header_sz + ce_payload_sz,
"onepad=%d, multi=%d\n", header_sz,
pdu_len, ce_payload_sz,
header_sz + ce_payload_sz, nof_subheaders,
header_sz, last_sdu_idx,
ce_payload_sz, onetwo_padding,
nof_subheaders, num_padding);
last_sdu_idx,
onetwo_padding,
num_padding);
ERROR("Expected PDU len %d bytes but wrote %d\n", pdu_len, buffer_tx->N_bytes);
srslte::console("------------------------------\n"); srslte::console("------------------------------\n");
log_h->error("Wrote PDU: pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, onepad=%d, " log_h->error(
"multi=%d\n", "Wrote PDU: pdu_len=%d, expected_pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, onepad=%d, "
pdu_len, "multi=%d\n",
header_sz + ce_payload_sz, buffer_tx->N_bytes,
header_sz, pdu_len,
ce_payload_sz, header_sz + ce_payload_sz,
nof_subheaders, header_sz,
last_sdu_idx, ce_payload_sz,
onetwo_padding, nof_subheaders,
num_padding); last_sdu_idx,
onetwo_padding,
num_padding);
for (int i = 0; i < nof_subheaders; i++) {
log_h->error("SUBH %d is_sdu=%d, head_size=%d, payload=%d\n",
i,
subheaders[i].is_sdu(),
subheaders[i].get_header_size(i == (nof_subheaders - 1)),
subheaders[i].get_payload_size());
}
} }
return nullptr; return nullptr;

Loading…
Cancel
Save