1
0
Fork 0

Logging fix

This commit is contained in:
Shawn Nock 2019-07-18 14:20:24 -04:00
parent 6e241ea8c1
commit 4f5029ed2e
1 changed files with 9 additions and 10 deletions

View File

@ -229,17 +229,16 @@ static void process_unack(void)
}
*/
static void h5_print_header(h5_hdr_t *hdr, const char *str)
static void h5_print_header(h5_hdr_t *hdr)
{
char const *label = str ? str : "";
if (hdr->is_reliable) {
LOG_DBG("%s REL: seq %u ack %u crc %u type %u len %u",
label, hdr->seq, hdr->ack,
LOG_DBG("REL: seq %u ack %u crc %u type %u len %u",
hdr->seq, hdr->ack,
hdr->checksum, hdr->packet_type,
hdr->len);
} else {
LOG_DBG("%s UNREL: ack %u crc %u type %u len %u",
label, hdr->ack, hdr->checksum,
LOG_DBG("UNREL: ack %u crc %u type %u len %u",
hdr->ack, hdr->checksum,
hdr->packet_type, hdr->len);
}
}
@ -525,13 +524,13 @@ static void unproc_thread(void) {
buf = net_buf_get(&h5.unprocessed_queue, K_FOREVER);
h5_hdr_t hdr = {0};
int r;
if ((r = pull_header1(buf, &hdr) < 0)) {
LOG_WRN("Bad h5 header: %d", r);
int r = pull_header1(buf, &hdr);
if (r < 0) {
LOG_WRN("Bad h5 header: %d, dropping packet", r);
goto next;
}
h5_print_header(&hdr, "unproc_thread");
h5_print_header(&hdr);
struct net_buf *rx_buf = NULL;