X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/f0ba6342218d4eb264668655e3c24ad74d99c0f4..17331e14ee99bebaef8d84fba44a90818bc5c817:/client/proxmark3.c diff --git a/client/proxmark3.c b/client/proxmark3.c index 38a97716..ae4ad7c0 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -67,6 +67,7 @@ struct main_loop_arg { //} byte_t rx[0x1000000]; +byte_t* prx = rx; static void *uart_receiver(void *targ) { struct receiver_arg *arg = (struct receiver_arg*)targ; @@ -75,18 +76,19 @@ static void *uart_receiver(void *targ) { while (arg->run) { rxlen = sizeof(UsbCommand); - if (uart_receive(sp,rx,&rxlen)) { - if ((rxlen % sizeof(UsbCommand)) != 0) { - PrintAndLog("ERROR: received %03zd bytes, which does not seem to be one or more command(s)\n",rxlen ); + if (uart_receive(sp,prx,&rxlen)) { + prx += rxlen; + if (((prx-rx) % sizeof(UsbCommand)) != 0) { continue; } - cmd_count = rxlen / sizeof(UsbCommand); -// printf("received %zd bytes, which represents %zd commands\n",rxlen, cmd_count); + cmd_count = (prx-rx) / sizeof(UsbCommand); + // printf("received %d bytes, which represents %d commands\n",(prx-rx), cmd_count); for (size_t i=0; i\n\n",argv[0]);