Export symbols in order to support shared libraries (#54)

* Add BAC_ROUTING compile definition

* Reorder cmake

* Fix OpenSSL support: support both 1.0 and 1.1t pus

* Explicitly export symbols, hidden by default

* Build shared libraries on travis using cmake

* Learn Makefile about static library

* Fix build using mingw with cmake

* Do not cleanup twice or after potential free
This commit is contained in:
Anonymous Maarten
2020-03-06 22:42:03 +01:00
committed by GitHub
parent bb5fafc06a
commit 4a916468c6
174 changed files with 2200 additions and 91 deletions
+2
View File
@@ -99,10 +99,12 @@
#include <sys/un.h>
#include <sys/ioctl.h>
#include <netdb.h>
#include "bacnet/bacnet_stack_exports.h"
/** @file linux/net.h Includes Linux network headers. */
/* Local helper functions for this port */
BACNET_STACK_EXPORT
extern int bip_get_local_netmask(
struct in_addr *netmask);
+18
View File
@@ -32,6 +32,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include "bacnet/bacnet_stack_exports.h"
#include "bacnet/bacdef.h"
#include "bacnet/npdu.h"
#include <termios.h>
@@ -127,15 +128,19 @@ typedef struct shared_mstp_data {
extern "C" {
#endif /* __cplusplus */
BACNET_STACK_EXPORT
bool dlmstp_init(
void *poShared,
char *ifname);
BACNET_STACK_EXPORT
void dlmstp_reset(
void *poShared);
BACNET_STACK_EXPORT
void dlmstp_cleanup(
void *poShared);
/* returns number of bytes sent on success, negative on failure */
BACNET_STACK_EXPORT
int dlmstp_send_pdu(
void *poShared,
BACNET_ADDRESS * dest, /* destination address */
@@ -143,6 +148,7 @@ extern "C" {
unsigned pdu_len); /* number of bytes of data */
/* returns the number of octets in the PDU, or zero on failure */
BACNET_STACK_EXPORT
uint16_t dlmstp_receive(
void *poShared,
BACNET_ADDRESS * src, /* source address */
@@ -157,9 +163,11 @@ extern "C" {
/* nodes. This may be used to allocate more or less of the available link */
/* bandwidth to particular nodes. If Max_Info_Frames is not writable in a */
/* node, its value shall be 1. */
BACNET_STACK_EXPORT
void dlmstp_set_max_info_frames(
void *poShared,
uint8_t max_info_frames);
BACNET_STACK_EXPORT
uint8_t dlmstp_max_info_frames(
void *poShared);
@@ -168,36 +176,46 @@ extern "C" {
/* allowable address for master nodes. The value of Max_Master shall be */
/* less than or equal to 127. If Max_Master is not writable in a node, */
/* its value shall be 127. */
BACNET_STACK_EXPORT
void dlmstp_set_max_master(
void *poShared,
uint8_t max_master);
BACNET_STACK_EXPORT
uint8_t dlmstp_max_master(
void *poShared);
/* MAC address 0-127 */
BACNET_STACK_EXPORT
void dlmstp_set_mac_address(
void *poShared,
uint8_t my_address);
BACNET_STACK_EXPORT
uint8_t dlmstp_mac_address(
void *poShared);
BACNET_STACK_EXPORT
void dlmstp_get_my_address(
void *poShared,
BACNET_ADDRESS * my_address);
BACNET_STACK_EXPORT
void dlmstp_get_broadcast_address(
BACNET_ADDRESS * dest); /* destination address */
/* RS485 Baud Rate 9600, 19200, 38400, 57600, 115200 */
BACNET_STACK_EXPORT
void dlmstp_set_baud_rate(
void *poShared,
uint32_t baud);
BACNET_STACK_EXPORT
uint32_t dlmstp_baud_rate(
void *poShared);
BACNET_STACK_EXPORT
void dlmstp_fill_bacnet_address(
BACNET_ADDRESS * src,
uint8_t mstp_address);
BACNET_STACK_EXPORT
bool dlmstp_sole_master(
void);
+11
View File
@@ -37,36 +37,47 @@
#define RS485_H
#include <stdint.h>
#include "bacnet/bacnet_stack_exports.h"
#include "bacnet/datalink/mstp.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BACNET_STACK_EXPORT
void RS485_Set_Interface(
char *ifname);
BACNET_STACK_EXPORT
const char *RS485_Interface(
void);
BACNET_STACK_EXPORT
void RS485_Initialize(
void);
BACNET_STACK_EXPORT
void RS485_Send_Frame(
volatile struct mstp_port_struct_t *mstp_port, /* port specific data */
uint8_t * buffer, /* frame to send (up to 501 bytes of data) */
uint16_t nbytes); /* number of bytes of data (up to 501) */
BACNET_STACK_EXPORT
void RS485_Check_UART_Data(
volatile struct mstp_port_struct_t *mstp_port); /* port specific data */
BACNET_STACK_EXPORT
uint32_t RS485_Get_Port_Baud_Rate(
volatile struct mstp_port_struct_t *mstp_port);
BACNET_STACK_EXPORT
uint32_t RS485_Get_Baud_Rate(
void);
BACNET_STACK_EXPORT
bool RS485_Set_Baud_Rate(
uint32_t baud);
BACNET_STACK_EXPORT
void RS485_Cleanup(
void);
BACNET_STACK_EXPORT
void RS485_Print_Ports(
void);