Skip to content

Commit

Permalink
Merge #19589
Browse files Browse the repository at this point in the history
19589: gnrc/gnrc_netif_hdr_print: printout timestamp if enabled r=benpicco a=chudov



Co-authored-by: chudov <chudov@gmail.com>
  • Loading branch information
bors[bot] and chudov committed May 15, 2023
2 parents 4b4d77a + 516df5c commit ac3b0de
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 " ", (uint32_t)(hdr->timestamp / NS_PER_SEC),
(uint32_t)(hdr->timestamp % NS_PER_SEC));
#endif
printf("lqi: %u\n", (unsigned) hdr->lqi);
printf("flags: ");

Expand Down
3 changes: 3 additions & 0 deletions tests/net/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 ac3b0de

Please sign in to comment.