4326128e72
* Refactored and secured BACnetActionCommand codec into bacaction.c module for command object and added to bacapp module encode/decode with define for enabling and pseudo application tag for internal use. * Simplified bacapp_data_len() and moved into bacdcode module as bacnet_enclosed_data_len() function. * Secured ReadProperty-REQUEST and -ACK decoding. * Removed deprecated Keylist_Key() functions from usage. * Removed pseudo application datatypes from bacapp_data_decode() which only uses primitive application tag encoded values. * Defined INT_MAX when it is not already defined by compiler or libc. * Deprecated bacapp_decode_application_data_len() and bacapp_decode_context_data_len() as they are no longer used in any code in the library. * Added BACnetScale to bacapp module. Improved complex property value decoding. Refactored bacapp_decode_known_property() function. * Refactored and improved the bacapp_snprintf() function for printing EPICS. * Fixed Lighting Output WriteProperty to handle known property decoding.
59 lines
1.5 KiB
CMake
59 lines
1.5 KiB
CMake
# SPDX-License-Identifier: MIT
|
|
|
|
cmake_minimum_required(VERSION 3.13.1)
|
|
|
|
# Extract module path and names
|
|
string(REGEX REPLACE
|
|
"/zephyr/tests/[a-zA-Z_/-]*$" ""
|
|
BACNET_BASE
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
string(REGEX REPLACE
|
|
"/zephyr/tests/" "/src/"
|
|
BACNET_SRC_PATH
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
string(REGEX REPLACE
|
|
"/zephyr/tests/" "/test/"
|
|
BACNET_TEST_PATH
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
get_filename_component(BACNET_NAME ${BACNET_BASE} NAME)
|
|
|
|
# Update include path for this module
|
|
list(APPEND BACNET_INCLUDE ${BACNET_BASE}/src)
|
|
|
|
if(BOARD STREQUAL unit_testing)
|
|
file(RELATIVE_PATH BACNET_INCLUDE $ENV{ZEPHYR_BASE} ${BACNET_BASE}/src)
|
|
list(APPEND INCLUDE ${BACNET_INCLUDE})
|
|
list(APPEND SOURCES
|
|
${BACNET_SRC_PATH}.c
|
|
${BACNET_TEST_PATH}/src/main.c
|
|
)
|
|
|
|
get_filename_component(BACNET_SRC ${BACNET_SRC_PATH} PATH)
|
|
list(APPEND SOURCES
|
|
${BACNET_SRC}/bacdcode.c
|
|
${BACNET_SRC}/bacstr.c
|
|
${BACNET_SRC}/bacint.c
|
|
${BACNET_SRC}/bacreal.c
|
|
${BACNET_SRC}/datetime.c
|
|
${BACNET_SRC}/timestamp.c
|
|
${BACNET_SRC}/basic/sys/days.c
|
|
)
|
|
|
|
set(CONF_FILE "${CONF_FILE};prj.unit_testing.conf")
|
|
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
project(${BACNET_NAME})
|
|
else()
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
project(${BACNET_NAME})
|
|
|
|
target_include_directories(app PRIVATE ${BACNET_INCLUDE})
|
|
target_sources(app PRIVATE
|
|
${BACNET_TEST_PATH}/src/main.c
|
|
)
|
|
endif()
|
|
|
|
add_compile_definitions(
|
|
CONFIG_ZTEST_NEW_API
|
|
BACNET_STACK_DEPRECATED_DISABLE
|
|
)
|