1# SPDX-License-Identifier: Apache-2.0 2 3cmake_minimum_required(VERSION 3.20.0) 4find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) 5project(coap_client_test) 6 7set(APP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) 8 9# Add test sources 10target_sources(app PRIVATE ${APP_SRC_DIR}/main.c) 11target_sources(app PRIVATE ${APP_SRC_DIR}/stubs.c) 12target_sources(app PRIVATE ${ZEPHYR_BASE}/subsys/net/lib/coap/coap_client.c) 13target_sources(app PRIVATE ${ZEPHYR_BASE}/subsys/net/lib/coap/coap.c) 14 15# Add includes directories 16target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) 17target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/) 18 19target_compile_definitions(app PRIVATE _POSIX_C_SOURCE=200809L) 20 21add_compile_definitions(CONFIG_ZVFS_POLL_MAX=3) 22add_compile_definitions(CONFIG_COAP_CLIENT=y) 23add_compile_definitions(CONFIG_COAP_CLIENT_BLOCK_SIZE=256) 24add_compile_definitions(CONFIG_COAP_CLIENT_MESSAGE_SIZE=256) 25add_compile_definitions(CONFIG_COAP_CLIENT_MESSAGE_HEADER_SIZE=48) 26add_compile_definitions(CONFIG_COAP_CLIENT_STACK_SIZE=1024) 27add_compile_definitions(CONFIG_COAP_CLIENT_THREAD_PRIORITY=10) 28add_compile_definitions(CONFIG_COAP_LOG_LEVEL=4) 29add_compile_definitions(CONFIG_COAP_INIT_ACK_TIMEOUT_MS=1000) 30add_compile_definitions(CONFIG_COAP_CLIENT_MAX_REQUESTS=2) 31add_compile_definitions(CONFIG_COAP_CLIENT_MAX_INSTANCES=2) 32add_compile_definitions(CONFIG_COAP_MAX_RETRANSMIT=4) 33add_compile_definitions(CONFIG_COAP_BACKOFF_PERCENT=200) 34add_compile_definitions(CONFIG_COAP_LOG_LEVEL=4) 35