Added externs declarations to header files to handle C++ compilation.
Cleaned up BACnet/IP API a little.
This commit is contained in:
@@ -79,7 +79,7 @@ bool bip_init(void)
|
||||
// bind the socket to the local port number and IP address
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
sin.sin_port = bip_get_port();
|
||||
sin.sin_port = htons(bip_get_port());
|
||||
memset(&(sin.sin_zero), '\0', 8);
|
||||
rv = bind(sock_fd,
|
||||
(const struct sockaddr*)&sin, sizeof(struct sockaddr));
|
||||
|
||||
@@ -205,9 +205,9 @@ static void NetInitialize(void)
|
||||
exit(1);
|
||||
}
|
||||
address.s_addr = gethostaddr();
|
||||
bip_set_addr(&address);
|
||||
bip_set_addr(address.s_addr);
|
||||
/* local broadcast address */
|
||||
bip_set_ipv4_broadcast_s_addr(INADDR_BROADCAST);
|
||||
bip_set_broadcast_addr(INADDR_BROADCAST);
|
||||
/* configure standard BACnet/IP port */
|
||||
bip_set_port(0xBAC0);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
#ifndef NET_H
|
||||
#define NET_H
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define STRICT
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
#define close closesocket
|
||||
|
||||
Reference in New Issue
Block a user