Fixed MacOS specific usage during FreeBSD 11.4 build (#745)
* Fixed path of exports header in BSD ports. * Fixed MacOS specific include in BSD ports. * Fixed MacOS specific IOSSIOSPEED and IOSSDATALAT usage in BSD ports
This commit is contained in:
+9
-1
@@ -42,8 +42,11 @@
|
||||
|
||||
#include "dlmstp_bsd.h"
|
||||
|
||||
/*macOS-darwin includes*/
|
||||
#if defined(__APPLE__) || defined(__darwin__)
|
||||
#include <IOKit/serial/ioss.h>
|
||||
#else
|
||||
#include <sys/serial.h>
|
||||
#endif
|
||||
|
||||
/* Posix serial programming reference:
|
||||
https://www.msweet.org/serial/serial.html
|
||||
@@ -716,6 +719,8 @@ static int openSerialPort(const char *const bsdPath)
|
||||
options.c_cflag &= ~CSTOPB; /* 1 Stop Bit */
|
||||
options.c_cflag &= ~CSIZE;
|
||||
options.c_cflag |= CS8; /* Use 8 bit words */
|
||||
|
||||
#if defined(__APPLE__) || defined(__darwin__)
|
||||
/* The IOSSIOSPEED ioctl can be used to set arbitrary baud rates other than
|
||||
* those specified by POSIX. The driver for the underlying serial hardware
|
||||
* ultimately determines which baud rates can be used. This ioctl sets both
|
||||
@@ -726,6 +731,7 @@ static int openSerialPort(const char *const bsdPath)
|
||||
printf("Error calling ioctl(..., IOSSIOSPEED, ...) %s - %s(%d).\n",
|
||||
bsdPath, strerror(errno), errno);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Print the new input and output baud rates. Note that the IOSSIOSPEED
|
||||
ioctl interacts with the serial driver directly, bypassing the termios
|
||||
@@ -778,6 +784,7 @@ static int openSerialPort(const char *const bsdPath)
|
||||
|
||||
printf("Handshake lines currently set to %d\n", handshake);
|
||||
|
||||
#if defined(__APPLE__) || defined(__darwin__)
|
||||
unsigned long mics = 1UL;
|
||||
|
||||
/* Set the receive latency in microseconds. Serial drivers use this value to
|
||||
@@ -793,6 +800,7 @@ static int openSerialPort(const char *const bsdPath)
|
||||
strerror(errno), errno);
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Success */
|
||||
return fileDescriptor;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#define RS485_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "bacnet/bacnet_stack_exports.h"
|
||||
#include "bacnet/basic/sys/bacnet_stack_exports.h"
|
||||
#include "bacnet/datalink/mstp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user