mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 16:29:34 +00:00
condense print_packet output
This commit is contained in:
parent
667b238148
commit
8421031d4a
@ -32,16 +32,15 @@ void print_packet(volatile packet_t *p) {
|
|||||||
#define PER_ROW 16
|
#define PER_ROW 16
|
||||||
if(p) {
|
if(p) {
|
||||||
printf("len 0x%02x\n\r",p->length);
|
printf("len 0x%02x\n\r",p->length);
|
||||||
for(j=0, k=0; j < ((p->length)%PER_ROW)-1; j++) {
|
for(j=0, k=0; j <= ((p->length)%PER_ROW); j++) {
|
||||||
for(i=0; i < PER_ROW; i++, k++) {
|
for(i=0; i < PER_ROW; i++, k++) {
|
||||||
if(k >= (p->length + 1) ) { goto out; } /* + 1 since first byte is len+2 */
|
if(k >= (p->length + 1) ) { goto out; } /* + 1 since first byte is len+2 */
|
||||||
printf("%02x ",p->data[j*PER_ROW+i]);
|
printf("%02x ",p->data[j*PER_ROW+i]);
|
||||||
}
|
}
|
||||||
printf("\n\r");
|
printf("\n\r");
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
printf("\n\r");
|
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user