Skip to content

Commit 5a7fd0e

Browse files
finikorggalak
authored andcommitted
usb: netusb: ecm: Print packet hexdump only for VERBOSE_DEBUG
Use VERBOSE_DEBUG to enable net_pkt_hexdump(). Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 4496e99 commit 5a7fd0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

subsys/usb/class/netusb/function_ecm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ static int ecm_send(struct net_pkt *pkt)
253253
size_t len = net_pkt_get_len(pkt);
254254
int ret;
255255

256-
net_pkt_hexdump(pkt, "<");
256+
if (IS_ENABLED(VERBOSE_DEBUG)) {
257+
net_pkt_hexdump(pkt, "<");
258+
}
257259

258260
if (len > sizeof(tx_buf)) {
259261
LOG_WRN("Trying to send too large packet, drop");
@@ -308,6 +310,10 @@ static void ecm_read_cb(u8_t ep, int size, void *priv)
308310
goto done;
309311
}
310312

313+
if (IS_ENABLED(VERBOSE_DEBUG)) {
314+
net_pkt_hexdump(pkt, ">");
315+
}
316+
311317
netusb_recv(pkt);
312318

313319
done:

0 commit comments

Comments
 (0)