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:
Chris 2018-11-20 10:58:32 +01:00
commit f8c33af1da
7 changed files with 123 additions and 119 deletions

View file

@ -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);

View file

@ -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) {