net: contiki: Fix debug prints in MAC layer files

Make debug messages fit in one line which is much more readable.

Change-Id: Ia0087bdea03d2eb34fca104850cf3acd3f61ebe6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2016-03-16 12:39:57 +02:00
commit a0d9613033
4 changed files with 27 additions and 21 deletions

View file

@ -211,7 +211,7 @@ create_frame(struct net_buf *buf, int do_create)
frame802154_create(&params, packetbuf_hdrptr(buf), hdr_len);
PRINTF("15.4-OUT: %2X ", params.fcf.frame_type);
PRINTLLADDR(params.dest_addr);
PRINTLLADDR((const uip_lladdr_t *)params.dest_addr);
PRINTF(" %d %u (%u)\n", hdr_len, packetbuf_datalen(buf), packetbuf_totlen(buf));
return hdr_len;
@ -248,7 +248,8 @@ parse(struct net_buf *buf)
if(frame.dest_pid != mac_src_pan_id &&
frame.dest_pid != FRAME802154_BROADCASTPANDID) {
/* Packet to another PAN */
PRINTF("15.4: for another pan %u\n", frame.dest_pid);
PRINTF("15.4: for another pan %u (0x%x)\n", frame.dest_pid,
frame.dest_pid);
return FRAMER_FAILED;
}
if(!is_broadcast_addr(frame.fcf.dest_addr_mode, frame.dest_addr)) {
@ -274,8 +275,9 @@ parse(struct net_buf *buf)
#endif /* LLSEC802154_SECURITY_LEVEL */
PRINTF("15.4-IN: %2X ", frame.fcf.frame_type);
PRINTLLADDR(packetbuf_addr(buf, PACKETBUF_ADDR_SENDER));
PRINTLLADDR(packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTLLADDR((const uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_SENDER));
PRINTF(" ");
PRINTLLADDR((const uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTF(" %d %u (%u)\n", hdr_len, packetbuf_datalen(buf), packetbuf_totlen(buf));
#ifdef FRAMER_802154_HANDLER

View file

@ -81,8 +81,9 @@ parse(struct net_buf *buf)
packetbuf_set_addr(buf, PACKETBUF_ADDR_RECEIVER, &(hdr->receiver));
PRINTF("PNULLMAC-IN: ");
PRINTLLADDR(packetbuf_addr(buf, PACKETBUF_ADDR_SENDER));
PRINTLLADDR(packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTLLADDR((const uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_SENDER));
PRINTF(" ");
PRINTLLADDR((const uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTF(" %u (%u)\n", packetbuf_datalen(buf), sizeof(struct nullmac_hdr));
return sizeof(struct nullmac_hdr);

View file

@ -355,7 +355,7 @@ packet_input(struct net_buf *buf)
} else
#endif /* NULLRDC_802154_AUTOACK */
if(NETSTACK_FRAMER.parse(buf) < 0) {
PRINTF("nullrdc: failed to parse %u\n", packetbuf_datalen(buf));
PRINTF("nullrdc: failed to parse msg len %u\n", packetbuf_datalen(buf));
#if NULLRDC_ADDRESS_FILTER
} else if(!linkaddr_cmp(packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER),
&linkaddr_node_addr) &&

View file

@ -160,9 +160,9 @@ send_packet(struct net_buf *buf, mac_callback_t sent, void *ptr)
if(packetbuf_hdralloc(buf, len)) {
frame802154_create(&params, packetbuf_hdrptr(buf), len);
PRINTF("6MAC-UT: type %X\ndest:", params.fcf.frame_type);
PRINTF("6MAC-UT: type %X dest ", params.fcf.frame_type);
PRINTLLADDR((uip_lladdr_t *)params.dest_addr);
PRINTF("\nlen %u datalen %u (totlen %u)\n", len, packetbuf_datalen(buf),
PRINTF(" len %u datalen %u (totlen %u)\n", len, packetbuf_datalen(buf),
packetbuf_totlen(buf));
ret = NETSTACK_RADIO.send(buf, packetbuf_hdrptr(buf), packetbuf_totlen(buf));
@ -214,7 +214,8 @@ input_packet(struct net_buf *buf)
if(frame.dest_pid != mac_src_pan_id &&
frame.dest_pid != FRAME802154_BROADCASTPANDID) {
/* Not broadcast or for our PAN */
PRINTF("6MAC: for another pan %u\n", frame.dest_pid);
PRINTF("6MAC: for another pan %u (0x%x)\n", frame.dest_pid,
frame.dest_pid);
goto error;
}
if(!is_broadcast_addr(frame.fcf.dest_addr_mode, frame.dest_addr)) {
@ -223,9 +224,11 @@ input_packet(struct net_buf *buf)
if(!linkaddr_cmp(packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER),
&linkaddr_node_addr)) {
/* Not for this node */
PRINTF("6MAC: not for us\n");
PRINTF("6MAC: we are "); PRINTLLADDR((uip_lladdr_t *)&linkaddr_node_addr); PRINTF("\n");
PRINTF("6MAC: recipient is "); PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER)); PRINTF("\n");
PRINTF("6MAC: not for us, we are ");
PRINTLLADDR((uip_lladdr_t *)&linkaddr_node_addr);
PRINTF(" recipient is ");
PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTF("\n");
goto error;
}
#endif
@ -233,11 +236,11 @@ input_packet(struct net_buf *buf)
}
packetbuf_set_addr(buf, PACKETBUF_ADDR_SENDER, (linkaddr_t *)&frame.src_addr);
PRINTF("6MAC-IN: type 0x%X\nsender:", frame.fcf.frame_type);
PRINTF("6MAC-IN: type 0x%X sender ", frame.fcf.frame_type);
PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_SENDER));
PRINTF("\nreceiver:");
PRINTF(" receiver ");
PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(buf, PACKETBUF_ADDR_RECEIVER));
PRINTF("\nlen %u\n", packetbuf_datalen(buf));
PRINTF(" len %u\n", packetbuf_datalen(buf));
return NETSTACK_MAC.input(buf);
} else {
PRINTF("6MAC: failed to parse hdr\n");