Changed some demo main files to main.c and made them use datalink generic API calls.
This commit is contained in:
@@ -20,7 +20,7 @@ CFLAGS = -Wall -g $(INCLUDES) $(DEFINES)
|
||||
|
||||
TARGET = bacarf
|
||||
|
||||
SRCS = readfile.c \
|
||||
SRCS = main.c \
|
||||
$(BACNET_PORT)/bip-init.c \
|
||||
$(BACNET_ROOT)/bip.c \
|
||||
$(BACNET_HANDLER)/txbuf.c \
|
||||
|
||||
@@ -230,11 +230,21 @@ int main(int argc, char *argv[])
|
||||
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
|
||||
address_init();
|
||||
Init_Service_Handlers();
|
||||
/* configure standard BACnet/IP port */
|
||||
bip_set_interface("eth0"); /* for linux */
|
||||
bip_set_port(0xBAC0);
|
||||
#ifdef BACDL_ETHERNET
|
||||
/* init the physical layer */
|
||||
if (!ethernet_init("eth0"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef BACDL_BIP
|
||||
bip_set_interface("eth0");
|
||||
if (!bip_init())
|
||||
return 1;
|
||||
printf("bip: using port %hu\r\n", bip_get_port());
|
||||
#endif
|
||||
#ifdef BACDL_ARCNET
|
||||
if (!arcnet_init("arc0"))
|
||||
return 1;
|
||||
#endif
|
||||
/* configure the timeout values */
|
||||
last_seconds = time(NULL);
|
||||
timeout_seconds = (Device_APDU_Timeout() / 1000) *
|
||||
@@ -248,7 +258,7 @@ int main(int argc, char *argv[])
|
||||
current_seconds = time(NULL);
|
||||
|
||||
/* returns 0 bytes on timeout */
|
||||
pdu_len = bip_receive(&src, &Rx_Buf[0], MAX_MPDU, timeout);
|
||||
pdu_len = datalink_receive(&src, &Rx_Buf[0], MAX_MPDU, timeout);
|
||||
|
||||
/* process */
|
||||
if (pdu_len) {
|
||||
@@ -17,7 +17,7 @@ PRODUCT_EXE = $(PRODUCT).exe
|
||||
# Choose the Data Link Layer to Enable
|
||||
DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1
|
||||
|
||||
SRCS = readfile.c \
|
||||
SRCS = main.c \
|
||||
..\..\ports\win32\bip-init.c \
|
||||
..\..\bip.c \
|
||||
..\..\demo\handler\txbuf.c \
|
||||
|
||||
@@ -20,7 +20,7 @@ CFLAGS = -Wall -g $(INCLUDES) $(DEFINES)
|
||||
|
||||
TARGET = bacserv
|
||||
|
||||
SRCS = server.c \
|
||||
SRCS = main.c \
|
||||
$(BACNET_PORT)/bip-init.c \
|
||||
$(BACNET_PORT)/ethernet.c \
|
||||
$(BACNET_PORT)/arcnet.c \
|
||||
|
||||
@@ -19,7 +19,7 @@ PRODUCT_EXE = $(PRODUCT).exe
|
||||
# datalink layer that Win32 supports
|
||||
DEFINES = -DBACDL_BIP=1;USE_INADDR=1;PRINT_ENABLED=1;BIG_ENDIAN=0
|
||||
|
||||
SRCS = server.c \
|
||||
SRCS = main.c \
|
||||
..\..\ports\win32\bip-init.c \
|
||||
..\..\bip.c \
|
||||
..\..\demo\handler\txbuf.c \
|
||||
|
||||
Reference in New Issue
Block a user