Complete macOS + PN532 UART support
This commit is contained in:
parent
9f3c859c3b
commit
8c1bf6f56f
@ -201,13 +201,6 @@ them in a modprobe conf file. This file is provided within libnfc archive:
|
||||
|
||||
sudo cp contrib/linux/blacklist-libnfc.conf /etc/modprobe.d/blacklist-libnfc.conf
|
||||
|
||||
PN532 UART on macOS:
|
||||
--------------------
|
||||
|
||||
- Receiving error: "Unable to set serial port speed to 115200 baud. Speed value must be one of those defined in termios(3)."
|
||||
- The PN532 High Speed UART (HSU) requires a baud rate of 115200, however macOS may use the incorrect `termios.h` (valid path: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/termios.h) preventing the detection of the `B115200` definition producing the error above.
|
||||
- Solution: Either add `-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/termios.h` as an include path before the rest of your includes or manually add `#define B115200 115200`.
|
||||
|
||||
FEITIAN bR500 and R502:
|
||||
-----------------------
|
||||
|
||||
|
||||
@ -47,7 +47,11 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __APPLE__
|
||||
#include <sys/termios.h>
|
||||
#else
|
||||
#include <termios.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
@ -49,7 +49,11 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __APPLE__
|
||||
#include <sys/termios.h>
|
||||
#else
|
||||
#include <termios.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
@ -47,7 +47,11 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __APPLE__
|
||||
#include <sys/termios.h>
|
||||
#else
|
||||
#include <termios.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -95,6 +99,19 @@ const char *serial_ports_device_radix[] = { "ttyUSB", "ttyS", "ttyACM", "ttyAMA"
|
||||
// Work-around to claim uart interface using the c_iflag (software input processing) from the termios struct
|
||||
# define CCLAIMED 0x80000000
|
||||
|
||||
// If macOS and still haven't detected required baud rates, set them as we do have support for some
|
||||
#ifdef __APPLE__
|
||||
#ifndef B57600
|
||||
#define B57600 57600
|
||||
#endif
|
||||
#ifndef B115200
|
||||
#define B115200 115200
|
||||
#endif
|
||||
#ifndef B230400
|
||||
#define B230400 230400
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct serial_port_unix {
|
||||
int fd; // Serial port file descriptor
|
||||
struct termios termios_backup; // Terminal info before using the port
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user