Make it possible to select multiple datalinks (#717)

* datalink/dlenv: Rename addr -> addr6 when ipv6

If we are building this file with BACDL_BIP6 and BACDL_BIP enabled we
get two definitions for addr. For this reason rename other addr6 so
there will be no conflict.

* config: Reorder MAX_APDU selection so biggest is first

When multiple datalinks are selected we should guess biggest MAX_APDU.
To do that we need to order selection based on biggest to lowest. With
this change MAX_APDU should be more correct most of the times and user
does not need to specifie that by hand.

* Make it possible to select multiple datalinks

Before we had option to select all datalinks. Many times you however do
not need all datalinks but just some. Change logic so that it does not
matter if user selects multiple datalinks. Now user just select what
they want and everything should just work.

* dlenv: Move variables start of function

Because we use C89 we need to move variables start of block.

* datalink: Hide strings.h because Windows

Windows does not support strings.h. Hide it from it.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2024-09-04 21:32:31 +03:00
committed by GitHub
parent b7d03fd415
commit 98e8cf2147
8 changed files with 279 additions and 115 deletions
+14 -10
View File
@@ -46,33 +46,37 @@ option(
option(
BACDL_ETHERNET
"compile with ethernet support"
"compile with ethernet datalink support"
OFF)
option(
BACDL_MSTP
"compile with mstp support"
"compile with mstp datalink support"
OFF)
option(
BACDL_ARCNET
"compile with arcnet support"
"compile with arcnet datalink support"
OFF)
option(
BACDL_BIP
"compile with ip support"
"compile with ip datalink support"
ON)
option(
BACDL_BIP6
"compile with ipv6 support"
"compile with ipv6 datalink support"
OFF)
option(
BACDL_NONE
"compile without datalink"
OFF)
if(NOT (BACDL_ETHERNET OR
BACDL_MSTP OR
BACDL_ARCNET OR
BACDL_BIP OR
BACDL_BIP6 OR
BACDL_CUSTOM))
add_definitions(-DBACDL_NONE)
endif()
set(BACNET_PROTOCOL_REVISION 19)
@@ -962,9 +966,9 @@ message(STATUS "BACNET: CMAKE_CXX_COMPILER_VERSION:.....\"${CMAKE_CXX_COMPILER_V
message(STATUS "BACNET: CMAKE_BUILD_TYPE:...............\"${CMAKE_BUILD_TYPE}\"")
message(STATUS "BACNET: CMAKE_INSTALL_PREFIX:...........\"${CMAKE_INSTALL_PREFIX}\"")
message(STATUS "BACNET: BACNET_PROTOCOL_REVISION:.......\"${BACNET_PROTOCOL_REVISION}\"")
message(STATUS "BACNET: Selected datalinks:")
message(STATUS "BACNET: BACDL_BIP6:.....................\"${BACDL_BIP6}\"")
message(STATUS "BACNET: BACDL_BIP:......................\"${BACDL_BIP}\"")
message(STATUS "BACNET: BACDL_ARCNET:...................\"${BACDL_ARCNET}\"")
message(STATUS "BACNET: BACDL_MSTP:.....................\"${BACDL_MSTP}\"")
message(STATUS "BACNET: BACDL_ETHERNET:.................\"${BACDL_ETHERNET}\"")
message(STATUS "BACNET: BACDL_NONE:.....................\"${BACDL_NONE}\"")