#ifdef _WIN32
# define unlink(x)
+#else
+# include <unistd.h>
#endif
static serial_port sp;
byte_t* prx = prxcmd;
size_t rxlen;
while (true) {
- rxlen = sizeof(UsbCommand) - (prx-prxcmd);
- if (uart_receive(sp,prx,&rxlen)) {
+ if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-prxcmd), &rxlen)) {
prx += rxlen;
if ((prx-prxcmd) >= sizeof(UsbCommand)) {
return;
fprintf(stderr,"Waiting for Proxmark to appear on %s",serial_port_name);
do {
- sleep(1);
+ msleep(1000);
fprintf(stderr, ".");
} while (!OpenProxmark(0));
fprintf(stderr," Found.\n");