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 <stdio.h>
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
#include "od.h"
|
#include "od.h"
|
||||||
#include "net/ipv6/hdr.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;
|
sixlowpan_frag_t *hdr = (sixlowpan_frag_t *)data;
|
||||||
|
|
||||||
puts("Fragmentation Header (first)");
|
puts("Fragmentation Header (first)");
|
||||||
printf("datagram size: %" PRIu16 "\n",
|
printf("datagram size: %u\n",
|
||||||
(uint16_t) (byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
(byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||||
printf("tag: 0x%" PRIu16 "\n", byteorder_ntohs(hdr->tag));
|
printf("tag: 0x%04x\n", byteorder_ntohs(hdr->tag));
|
||||||
|
|
||||||
/* Print next dispatch */
|
/* Print next dispatch */
|
||||||
sixlowpan_print(data + sizeof(sixlowpan_frag_t),
|
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;
|
sixlowpan_frag_n_t *hdr = (sixlowpan_frag_n_t *)data;
|
||||||
|
|
||||||
puts("Fragmentation Header (subsequent)");
|
puts("Fragmentation Header (subsequent)");
|
||||||
printf("datagram size: %" PRIu16 "\n",
|
printf("datagram size: %u\n",
|
||||||
(uint16_t) (byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
(byteorder_ntohs(hdr->disp_size) & SIXLOWPAN_FRAG_SIZE_MASK));
|
||||||
printf("tag: 0x%" PRIu16 "\n", byteorder_ntohs(hdr->tag));
|
printf("tag: 0x%04x\n", byteorder_ntohs(hdr->tag));
|
||||||
printf("offset: 0x%u\n", (unsigned)hdr->offset);
|
printf("offset: %u\n", (unsigned)hdr->offset);
|
||||||
|
|
||||||
od_hex_dump(data + sizeof(sixlowpan_frag_n_t),
|
od_hex_dump(data + sizeof(sixlowpan_frag_n_t),
|
||||||
size - sizeof(sixlowpan_frag_n_t),
|
size - sizeof(sixlowpan_frag_n_t),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user