mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
CHG: FPC connector tests. Device -> Client communications works.
Adjust armsrc/Makefile and client/Makefile to include the -DWITH_FPC flag to compile with FPC enabled.
This commit is contained in:
parent
aa3b322d0f
commit
f8c33af1da
7 changed files with 123 additions and 119 deletions
|
@ -118,8 +118,12 @@ serial_port uart_open(const char* pcPortName)
|
|||
tcflush(sp->fd, TCIOFLUSH);
|
||||
|
||||
#ifdef WITH_FPC
|
||||
uart_set_speed(sp, 115200);
|
||||
if ( uart_set_speed(sp, 115200) ) {
|
||||
printf("[=] UART Setting serial baudrate 115200 [FPC enabled]\n");
|
||||
} else {
|
||||
uart_set_speed(sp, 9600);
|
||||
printf("[=] UART Setting serial baudrate 9600 [FPC enabled]\n");
|
||||
}
|
||||
#else
|
||||
// set speed, works for UBUNTU 14.04
|
||||
bool success = uart_set_speed(sp, 460800);
|
||||
|
|
|
@ -86,12 +86,20 @@ serial_port uart_open(const char* pcPortName) {
|
|||
}
|
||||
// all zero's configure: no timeout for read/write used.
|
||||
// took settings from libnfc/buses/uart.c
|
||||
#ifdef WITH_FPC
|
||||
sp->ct.ReadIntervalTimeout = 1000;
|
||||
sp->ct.ReadTotalTimeoutMultiplier = 0;
|
||||
sp->ct.ReadTotalTimeoutConstant = 1500;
|
||||
sp->ct.WriteTotalTimeoutMultiplier = 1000;
|
||||
sp->ct.WriteTotalTimeoutConstant = 0;
|
||||
#else
|
||||
sp->ct.ReadIntervalTimeout = 30;
|
||||
sp->ct.ReadTotalTimeoutMultiplier = 0;
|
||||
sp->ct.ReadTotalTimeoutConstant = 30;
|
||||
sp->ct.WriteTotalTimeoutMultiplier = 30;
|
||||
sp->ct.WriteTotalTimeoutConstant = 0;
|
||||
|
||||
#endif
|
||||
|
||||
if (!SetCommTimeouts(sp->hPort, &sp->ct)) {
|
||||
uart_close(sp);
|
||||
printf("[!] UART error while setting comm time outs\n");
|
||||
|
@ -101,7 +109,12 @@ serial_port uart_open(const char* pcPortName) {
|
|||
PurgeComm(sp->hPort, PURGE_RXABORT | PURGE_RXCLEAR);
|
||||
|
||||
#ifdef WITH_FPC
|
||||
uart_set_speed(sp, 115200);
|
||||
if ( uart_set_speed(sp, 115200) ) {
|
||||
printf("[=] UART Setting serial baudrate 115200 [FPC enabled]\n");
|
||||
} else {
|
||||
uart_set_speed(sp, 9600);
|
||||
printf("[=] UART Setting serial baudrate 9600 [FPC enabled]\n");
|
||||
}
|
||||
#else
|
||||
bool success = uart_set_speed(sp, 460800);
|
||||
if (success) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue