Fixed BACnet/SC secure connect VMAC, UUID, and initialization sequence (#1142)
* Refactored the BACnet/SC datalink initialization order by moving certificate file checks and hub connection registration to occur after datalink initialization * Replaced stdlib rand() with platform-specific cryptographically secure random functions (RtlGenRandom for Windows, getrandom for Linux, arc4random_buf for BSD) to generate UUID and VMAC addresses, preventing duplicates that broke connections * Enabled conditional debug output in BACnet/SC components when BUILD=debug is specified
This commit is contained in:
+12
-2
@@ -43,8 +43,7 @@ ifeq (${BACDL},bip6)
|
||||
BACDL_DEFINE=-DBACDL_BIP6=1
|
||||
endif
|
||||
ifeq (${BACDL},bsc)
|
||||
BACDL_DEFINE=-DBACDL_BSC=1
|
||||
BACNET_DEFINE=-DBACFILE=1
|
||||
BACDL_DEFINE=-DBACDL_BSC=1 -DBACFILE=1
|
||||
endif
|
||||
ifeq (${BACDL},zigbee)
|
||||
BACDL_DEFINE=-DBACDL_ZIGBEE=1
|
||||
@@ -206,6 +205,17 @@ DEBUGGING = -g -DDEBUG_ENABLED=1
|
||||
ifeq (${BACDL},bip)
|
||||
BACNET_DEFINES += -DBIP_DEBUG
|
||||
endif
|
||||
ifeq (${BACDL},bsc)
|
||||
CFLAGS += -DDEBUG_BSC_DATALINK=1
|
||||
CFLAGS += -DDEBUG_BSC_EVENT=0
|
||||
CFLAGS += -DDEBUG_BSC_HUB_CONNECTOR=0
|
||||
CFLAGS += -DDEBUG_BSC_HUB_FUNCTION=0
|
||||
CFLAGS += -DDEBUG_BSC_NODE_SWITCH=0
|
||||
CFLAGS += -DDEBUG_BSC_NODE=0
|
||||
CFLAGS += -DDEBUG_BSC_SOCKET=0
|
||||
CFLAGS += -DDEBUG_WEBSOCKET_CLIENT=0
|
||||
CFLAGS += -DDEBUG_WEBSOCKET_SERVER=0
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (${LEGACY},true)
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
|
||||
Test BACnet/SC using the following steps:
|
||||
|
||||
* Build apps for bsc datalink:
|
||||
* Build all the apps and the hub for the BACnet/SC datalink:
|
||||
|
||||
make bsc
|
||||
make clean bsc sc-hub
|
||||
|
||||
* Run hub app:
|
||||
* Run the BACnet/SC hub application:
|
||||
|
||||
cd bin
|
||||
./bsc-server.sh
|
||||
./bacschub 1 Hubster
|
||||
|
||||
* Run server app:
|
||||
* Run BACnet/SC server application:
|
||||
|
||||
cd bin
|
||||
./bsc-client.sh
|
||||
./bacserv 123 Francine
|
||||
|
||||
* Run any client:
|
||||
* Run any BACnet/SC client:
|
||||
|
||||
cd bin
|
||||
./bsc-client.sh
|
||||
|
||||
Reference in New Issue
Block a user