1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
3 // Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
5 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
6 // at your option, any later version. See the LICENSE.txt file for the text of
8 //-----------------------------------------------------------------------------
9 // Code for communicating with the proxmark3 hardware.
10 //-----------------------------------------------------------------------------
21 #ifndef CMD_BUFFER_SIZE
22 #define CMD_BUFFER_SIZE 50
26 // If TRUE, continue running the uart_receiver thread
29 // Lock around serial port receives
30 pthread_mutex_t recv_lock
;
34 void SetOffline(bool new_offline
);
37 bool OpenProxmark(char *portname
, bool waitCOMPort
, int timeout
);
38 void CloseProxmark(void);
40 void SendCommand(UsbCommand
*c
);
42 void *uart_receiver(void *targ
);
43 void clearCommandBuffer();
44 bool WaitForResponseTimeoutW(uint32_t cmd
, UsbCommand
* response
, size_t ms_timeout
, bool show_warning
);
45 bool WaitForResponseTimeout(uint32_t cmd
, UsbCommand
* response
, size_t ms_timeout
);
46 bool WaitForResponse(uint32_t cmd
, UsbCommand
* response
);
47 bool GetFromBigBuf(uint8_t *dest
, int bytes
, int start_index
, UsbCommand
*response
, size_t ms_timeout
, bool show_warning
);