mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sixlowpan: use generic format strings instead of inttypes.h macros
We had bad experiences with those in the past when used with newlib-nano ;-)
This commit is contained in:
parent
ecfff3e812
commit
c6d46057b0
@ -13,7 +13,6 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "od.h"
|
||||
#include "net/ipv6/hdr.h"
|
||||
@ -40,9 +39,9 @@ void sixlowpan_print(uint8_t *data, size_t size)
|
||||
sixlowpan_frag_t *hdr = (sixlowpan_frag_t *)data;
|
||||
|
||||
puts("Fragmentation Header (first)");
|
||||
printf("datagram size: %" PRIu16 "\n",
|
||||
(uint16_t) (byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||
printf("tag: 0x%" PRIu16 "\n", byteorder_ntohs(hdr->tag));
|
||||
printf("datagram size: %u\n",
|
||||
(byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||
printf("tag: 0x%04x\n", byteorder_ntohs(hdr->tag));
|
||||
|
||||
/* Print next dispatch */
|
||||
sixlowpan_print(data + sizeof(sixlowpan_frag_t),
|
||||
@ -52,10 +51,10 @@ void sixlowpan_print(uint8_t *data, size_t size)
|
||||
sixlowpan_frag_n_t *hdr = (sixlowpan_frag_n_t *)data;
|
||||
|
||||
puts("Fragmentation Header (subsequent)");
|
||||
printf("datagram size: %" PRIu16 "\n",
|
||||
(uint16_t) (byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||
printf("tag: 0x%" PRIu16 "\n", byteorder_ntohs(hdr->tag));
|
||||
printf("offset: 0x%u\n", (unsigned)hdr->offset);
|
||||
printf("datagram size: %u\n",
|
||||
(byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||
printf("tag: 0x%04x\n", byteorder_ntohs(hdr->tag));
|
||||
printf("offset: %u\n", (unsigned)hdr->offset);
|
||||
|
||||
od_hex_dump(data + sizeof(sixlowpan_frag_n_t),
|
||||
size - sizeof(sixlowpan_frag_n_t),
|
||||
|
Loading…
Reference in New Issue
Block a user