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 19add_compile_definitions(CONFIG_NET_SOCKETS_POLL_MAX=3) 20add_compile_definitions(CONFIG_COAP_CLIENT=y) 21add_compile_definitions(CONFIG_COAP_CLIENT_BLOCK_SIZE=256) 22add_compile_definitions(CONFIG_COAP_CLIENT_MESSAGE_SIZE=256) 23add_compile_definitions(CONFIG_COAP_CLIENT_MESSAGE_HEADER_SIZE=48) 24add_compile_definitions(CONFIG_COAP_CLIENT_STACK_SIZE=1024) 25add_compile_definitions(CONFIG_COAP_CLIENT_THREAD_PRIORITY=10) 26add_compile_definitions(CONFIG_COAP_LOG_LEVEL=4) 27add_compile_definitions(CONFIG_COAP_INIT_ACK_TIMEOUT_MS=2000) 28add_compile_definitions(CONFIG_COAP_CLIENT_MAX_REQUESTS=2) 29add_compile_definitions(CONFIG_COAP_CLIENT_MAX_INSTANCES=2) 30