Merged revision(s) 3044 from branches/releases/bacnet-stack-0-8-0:
Added BACnet/IPv6 datalink layer and example BACnet/IPv4 to BACnet/IPv6 router. BVLC6 layer is working on Linux port without BBMD features yet. Win32 is implemented, untested. Tested during BACnet North American Plugfest 2016. ........
This commit is contained in:
@@ -47,7 +47,7 @@ DEBUGGING =
|
||||
OPTIMIZATION = -Os
|
||||
ifeq (${BUILD},debug)
|
||||
OPTIMIZATION = -O0
|
||||
DEBUGGING = -g
|
||||
DEBUGGING = -g -DDEBUG_ENABLED=1
|
||||
endif
|
||||
# put all the flags together
|
||||
CFLAGS := -Wall $(DEBUGGING) $(OPTIMIZATION) $(INCLUDES) $(DEFINES)
|
||||
@@ -109,3 +109,7 @@ error:
|
||||
|
||||
router:
|
||||
$(MAKE) -s -b -C router
|
||||
|
||||
router-ipv6:
|
||||
$(MAKE) -b -C router-ipv6
|
||||
|
||||
|
||||
@@ -226,6 +226,10 @@ void dlenv_maintenance_timer(
|
||||
* - BACNET_MAX_MASTER
|
||||
* - BACNET_MSTP_BAUD
|
||||
* - BACNET_MSTP_MAC
|
||||
* - BACDL_BIP6: (BACnet/IPv6)
|
||||
* - BACNET_BIP6_PORT - UDP/IP port number (0..65534) used for BACnet/IPv6
|
||||
* communications. Default is 47808 (0xBAC0).
|
||||
* - BACNET_BIP6_BROADCAST - FF05::BAC0 or FF02::BAC0 or ...
|
||||
*/
|
||||
void dlenv_init(
|
||||
void)
|
||||
@@ -240,6 +244,27 @@ void dlenv_init(
|
||||
datalink_set(NULL);
|
||||
}
|
||||
#endif
|
||||
#if defined(BACDL_BIP6)
|
||||
BACNET_IP6_ADDRESS addr;
|
||||
pEnv = getenv("BACNET_BIP6_BROADCAST");
|
||||
if (pEnv) {
|
||||
bvlc6_address_set(&addr,
|
||||
(uint16_t) strtol(pEnv, NULL, 0), 0, 0, 0, 0, 0, 0,
|
||||
BIP6_MULTICAST_GROUP_ID);
|
||||
bip6_set_broadcast_addr(&addr);
|
||||
} else {
|
||||
bvlc6_address_set(&addr,
|
||||
BIP6_MULTICAST_SITE_LOCAL, 0, 0, 0, 0, 0, 0,
|
||||
BIP6_MULTICAST_GROUP_ID);
|
||||
bip6_set_broadcast_addr(&addr);
|
||||
}
|
||||
pEnv = getenv("BACNET_BIP6_PORT");
|
||||
if (pEnv) {
|
||||
bip6_set_port((uint16_t) strtol(pEnv, NULL, 0));
|
||||
} else {
|
||||
bip6_set_port(0xBAC0);
|
||||
}
|
||||
#endif
|
||||
#if defined(BACDL_BIP)
|
||||
#if defined(BIP_DEBUG)
|
||||
BIP_Debug = true;
|
||||
@@ -295,6 +320,7 @@ void dlenv_init(
|
||||
if (pEnv) {
|
||||
apdu_retries_set((uint8_t) strtol(pEnv, NULL, 0));
|
||||
}
|
||||
/* === Initialize the Datalink Here === */
|
||||
if (!datalink_init(getenv("BACNET_IFACE"))) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
#Makefile to build BACnet Application for the GCC port
|
||||
|
||||
# tools - only if you need them.
|
||||
# Most platforms have this already defined
|
||||
# CC = gcc
|
||||
|
||||
# Executable file name
|
||||
TARGET = bacroute
|
||||
|
||||
TARGET_BIN = ${TARGET}$(TARGET_EXT)
|
||||
|
||||
CFLAGS += -DPRINT_ENABLED=1
|
||||
|
||||
BACNET_SOURCE_DIR = ../../src
|
||||
BACNET_HANDLER_DIR = ../handler
|
||||
BACNET_OBJECT_DIR = ../object
|
||||
|
||||
SRC = main.c \
|
||||
$(BACNET_OBJECT_DIR)/device-client.c
|
||||
|
||||
PORT_BIP6_SRC = \
|
||||
$(BACNET_PORT_DIR)/bip6.c \
|
||||
$(BACNET_SOURCE_DIR)/bvlc6.c \
|
||||
$(BACNET_HANDLER_DIR)/h_bbmd6.c \
|
||||
$(BACNET_SOURCE_DIR)/vmac.c
|
||||
|
||||
SRCS = ${SRC} ${PORT_BIP6_SRC}
|
||||
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
|
||||
all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN}
|
||||
|
||||
${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET}
|
||||
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
|
||||
size $@
|
||||
cp $@ ../../bin
|
||||
|
||||
lib: ${BACNET_LIB_TARGET}
|
||||
|
||||
${BACNET_LIB_TARGET}:
|
||||
( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) )
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $*.c -o $@
|
||||
|
||||
depend:
|
||||
rm -f .depend
|
||||
${CC} -MM ${CFLAGS} *.c >> .depend
|
||||
|
||||
clean:
|
||||
rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map
|
||||
|
||||
include: .depend
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
BACnet Simple Router Demo
|
||||
=========================
|
||||
|
||||
The Simple Router demo connects one BACnet/IP and one BACnet/IPv6 network.
|
||||
It also includes a BBMD so that Foreign Device Registration can be used
|
||||
to tunnel local command line demos to BACnet/IP and BACnet IPv6 networks.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
It uses environment variables to configure
|
||||
the BACnet/IP port and BACnet/IPv6 address on Linux:
|
||||
|
||||
export BACNET_IFACE=eth0
|
||||
export BACNET_BIP6_IFACE=eth0
|
||||
|
||||
Also uses these configurations, but defaults to these values if not set:
|
||||
export BACNET_IP_PORT=47808
|
||||
export BACNET_BIP6_PORT=47808
|
||||
export BACNET_BIP6_BROADCAST=FF05
|
||||
export BACNET_IP_NET=1
|
||||
export BACNET_IP6_NET=2
|
||||
Reference in New Issue
Block a user