X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/cd00aa3043b507ed10bf79a37b83b88741d176d7..aa81a8d3f11255c86b1de9e77c65ce700fb3a79e:/client/usb.c diff --git a/client/usb.c b/client/usb.c index c326aeca..e7573fea 100644 --- a/client/usb.c +++ b/client/usb.c @@ -1,11 +1,12 @@ #include #include +#include +#include #include #include #include #include -#include "translate.h" #include "prox.h" #include "proxmark3.h" @@ -14,7 +15,7 @@ static unsigned int claimed_iface = 0; unsigned char return_on_error = 0; unsigned char error_occured = 0; -void SendCommand(UsbCommand *c, BOOL wantAck) { +void SendCommand(UsbCommand *c, bool wantAck) { int ret; #if 0 @@ -50,7 +51,7 @@ void SendCommand(UsbCommand *c, BOOL wantAck) { } } -int ReceiveCommandP(UsbCommand *c) { +bool ReceiveCommandPoll(UsbCommand *c) { int ret; bzero(c, sizeof(UsbCommand)); @@ -95,11 +96,11 @@ int ReceiveCommandP(UsbCommand *c) { #endif } - return ret; + return ret > 0; } void ReceiveCommand(UsbCommand *c) { - while(ReceiveCommandP(c)<0) {} + while(!ReceiveCommandPoll(c)) {} } usb_dev_handle* findProxmark(int verbose, unsigned int *iface) {