32 #define DEBUG DEBUG_NONE
37 packetutils_serialize_atts(uint8_t *data,
int size)
45 PRINTF(
"packetutils: serializing packet atts");
46 for(i = 0; i < PACKETBUF_NUM_ATTRS; i++) {
47 val = packetbuf_attr(i);
53 data[pos++] = val >> 8;
54 data[pos++] = val & 255;
56 PRINTF(
" %d=%d", i, val);
59 PRINTF(
" (%d)\n", cnt);
66 packetutils_deserialize_atts(
const uint8_t *data,
int size)
72 PRINTF(
"packetutils: deserializing %d packet atts:", cnt);
73 if(cnt > PACKETBUF_NUM_ATTRS) {
74 PRINTF(
" *** too many: %u!\n", PACKETBUF_NUM_ATTRS);
77 for(i = 0; i < cnt; i++) {
78 if(data[pos] >= PACKETBUF_NUM_ATTRS) {
80 PRINTF(
" *** unknown attribute %u\n", data[pos]);
83 PRINTF(
" %d=%d", data[pos], (data[pos + 1] << 8) | data[pos + 2]);
84 packetbuf_set_attr(data[pos], (data[pos + 1] << 8) | data[pos + 2]);
Header file for the Rime buffer (packetbuf) management
A set of debugging macros.