Make more generic to try and work on mk2

This commit is contained in:
Neale Pickett 2012-06-27 00:06:23 -06:00
parent 2d1a2e5951
commit 373b237be9
1 changed files with 4 additions and 9 deletions

13
hdjd.c
View File

@ -35,7 +35,7 @@ main(int argc, char **argv)
} }
while (1) { while (1) {
uint8_t data[12]; uint8_t data[80];
int transferred; int transferred;
int i; int i;
@ -45,15 +45,10 @@ main(int argc, char **argv)
break; break;
} }
if (transferred % 3 > 0) { for (i = 0; i < transferred; i += 1) {
fprintf(stderr, "WARNING: ignoring packet of length %d\n", printf("%02x ", data[i]);
transferred);
continue;
}
for (i = 0; i < transferred; i += 3) {
printf("%02x %02x %02x\n", data[i], data[i + 1], data[i + 2]);
} }
printf("\n");
} }
if (ret < 0) { if (ret < 0) {