diff --git a/sys/net/gnrc/netif/hdr/gnrc_netif_hdr_print.c b/sys/net/gnrc/netif/hdr/gnrc_netif_hdr_print.c index fa382fd9355ac..382e40891d213 100644 --- a/sys/net/gnrc/netif/hdr/gnrc_netif_hdr_print.c +++ b/sys/net/gnrc/netif/hdr/gnrc_netif_hdr_print.c @@ -24,6 +24,11 @@ void gnrc_netif_hdr_print(gnrc_netif_hdr_t *hdr) printf("if_pid: %u ", (unsigned) hdr->if_pid); printf("rssi: %d ", (signed) hdr->rssi); +#if IS_USED(MODULE_GNRC_NETIF_TIMESTAMP) + /* Only last 32 bits are printed due to printf from avg-libc doesn't support 64-bit values */ + printf(" timestamp: %" PRIu32".%09" PRIu32" ", hdr->timestamp / NS_PER_SEC, + hdr->timestamp % NS_PER_SEC); +#endif printf("lqi: %u\n", (unsigned) hdr->lqi); printf("flags: "); diff --git a/tests/gnrc_netif/Makefile b/tests/gnrc_netif/Makefile index 2e91ce872ad81..38c6a0625d293 100644 --- a/tests/gnrc_netif/Makefile +++ b/tests/gnrc_netif/Makefile @@ -11,6 +11,9 @@ USEMODULE += netdev_ieee802154 USEMODULE += netdev_test USEMODULE += od +# uncomment the line to have and see timestamp in the netif header +#USEMODULE += gnrc_netif_timestamp + # deactivate automatically emitted packets from IPv6 neighbor discovery CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ARSM=0 CFLAGS += -DCONFIG_GNRC_IPV6_NIB_SLAAC=0