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,13 +354,10 @@ uint8_t* sch_pdu::write_packet(srslte::log_ref log_h)
if (buffer_tx->N_bytes != pdu_len) {
if (log_h) {
srslte::console("\n------------------------------\n");
for (int i = 0; i < nof_subheaders; i++) {
srslte::console(
"SUBH %d is_sdu=%d, payload=%d\n", i, subheaders[i].is_sdu(), subheaders[i].get_payload_size());
}
srslte::console("Wrote PDU: pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, "
srslte::console("------------------------------\n");
srslte::console("Wrote PDU: pdu_len=%d, expected_pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, "
"onepad=%d, multi=%d\n",
buffer_tx->N_bytes,
pdu_len,
header_sz + ce_payload_sz,
header_sz,
@ -369,11 +366,12 @@ uint8_t* sch_pdu::write_packet(srslte::log_ref log_h)
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");
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(
"Wrote PDU: pdu_len=%d, expected_pdu_len=%d, header_and_ce=%d (%d+%d), nof_subh=%d, last_sdu=%d, onepad=%d, "
"multi=%d\n",
buffer_tx->N_bytes,
pdu_len,
header_sz + ce_payload_sz,
header_sz,
@ -382,6 +380,14 @@ uint8_t* sch_pdu::write_packet(srslte::log_ref log_h)
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;

Loading…
Cancel
Save