Skip to content

Commit

Permalink
gnrc/gnrc_netif_hdr_print: printout timestamp if enabled
Browse files Browse the repository at this point in the history
Signed-off-by: chudov <chudov@gmail.com>
  • Loading branch information
chudov committed May 12, 2023
1 parent 4af0376 commit 3f12c2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sys/net/gnrc/netif/hdr/gnrc_netif_hdr_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: ");

Expand Down
3 changes: 3 additions & 0 deletions tests/gnrc_netif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f12c2f

Please sign in to comment.