From 93494aad24080e7a30eb71175fc475223bc98b6f Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Sat, 31 Jul 2010 10:13:18 +0000 Subject: [PATCH] Fix serial string for FreeBSD. I am sure we don't have /dev/ttyUSB*, and since I use /dev/cuau0 with a cross-over cable to connect 2 machines and have a serial console, I guess "/dev/cuau" is the SERIAL_STRING that's expected to work for me. A quick test would be cool however, but I don't own a serial NFC device. --- libnfc/drivers/pn532_uart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libnfc/drivers/pn532_uart.c b/libnfc/drivers/pn532_uart.c index 981a7dc..334671e 100644 --- a/libnfc/drivers/pn532_uart.c +++ b/libnfc/drivers/pn532_uart.c @@ -54,8 +54,15 @@ // MacOS // TODO: find UART connection string for PN53X device on Mac OS X #define SERIAL_STRING "" + #elif defined(__FreeBSD__) + // XXX: Not tested + #define SERIAL_STRING "/dev/cuau" #else - // *BSD, Linux and others POSIX systems + // Linux and maybe some operating systems + // FIXME: We'd rather have an #elif defined(__linux__) or something like + // that and an #else that triggers an error at compile time instead + // of "falling-back" on a value that is likely to not be suitable + // for most operating systems. #define SERIAL_STRING "/dev/ttyUSB" #endif #endif