1
0
mirror of https://github.com/stargieg/bacnet-stack synced 2025-10-26 23:35:52 +08:00

update add compile switch for bac objects ai,ao,..

This commit is contained in:
Patrick Grimm
2016-10-30 23:48:37 +01:00
parent f3c7783c67
commit 1b4cb0eee5
55 changed files with 17642 additions and 2775 deletions

View File

@@ -41,7 +41,7 @@
/** @file linux/bip-init.c Initializes BACnet/IP interface (BSD/MAC OS X). */
bool BIP_Debug = true;
bool BIP_Debug = false;
void *get_addr_ptr(
struct sockaddr *sockaddr_ptr)
@@ -90,9 +90,11 @@ static int get_local_address(
struct ifaddrs *ifaddrs_ptr;
int status;
status = getifaddrs(&ifaddrs_ptr);
if (status == -1) {
fprintf(stderr, "Error in 'getifaddrs': %d (%s)\n", errno,
strerror(errno));
if (BIP_Debug) {
if (status == -1) {
fprintf(stderr, "Error in 'getifaddrs': %d (%s)\n", errno,
strerror(errno));
}
}
while (ifaddrs_ptr) {
if ((ifaddrs_ptr->ifa_addr->sa_family == AF_INET) &&
@@ -184,9 +186,14 @@ bool bip_init(
if (ifname) {
bip_set_interface(ifname);
printf("interface %s", ifname);
if (BIP_Debug) {
printf("interface %s\n", ifname);
}
} else {
bip_set_interface("en0");
if (BIP_Debug) {
printf("interface default en0\n");
}
}
/* assumes that the driver has already been initialized */
sock_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -257,7 +264,9 @@ int bip_get_local_netmask(
char *ifname = getenv("BACNET_IFACE"); /* will probably be null */
if (ifname == NULL)
ifname = "en0";
printf("ifname %s", ifname);
if (BIP_Debug) {
printf("ifname %s", ifname);
}
char *request = "netmask";
rv = get_local_address(ifname, netmask, request);