fix(config): enhance Zephyr configuration for libcoap

This commit is contained in:
Florek, Bartlomiej authored and Jon Shallow committed 2026-03-03 10:35:36 +00:00
1 parent e24ce7a6b3
commit a4d7c29313
3 files changed
+53 -5

No files matched your search

+3
View File
@@ -24,7 +24,10 @@
extern "C" {
#endif
#ifndef COAP_DEFAULT_SESSION_TIMEOUT
#define COAP_DEFAULT_SESSION_TIMEOUT 300
#endif /* !COAP_DEFAULT_SESSION_TIMEOUT */
#define COAP_PARTIAL_SESSION_TIMEOUT_TICKS (30 * COAP_TICKS_PER_SECOND)
#define COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS 100
+11 -2
View File
@@ -171,8 +171,17 @@ if(CONFIG_LIBCOAP)
endif()
add_subdirectory(.. build)
target_compile_definitions(coap-3 PUBLIC WITH_ZEPHYR)
target_compile_definitions(coap-3 PUBLIC COAP_MEMORY_TYPE_TRACK=1)
target_compile_definitions(coap-3
PUBLIC
WITH_ZEPHYR
COAP_MEMORY_TYPE_TRACK=1
$<$<BOOL:${CONFIG_LIBCOAP_OBS_MAX_NON}>:COAP_OBS_MAX_NON=${CONFIG_LIBCOAP_OBS_MAX_NON}>
$<$<BOOL:${CONFIG_LIBCOAP_DEFAULT_MAX_PDU_RX_SIZE}>:COAP_DEFAULT_MAX_PDU_RX_SIZE=${CONFIG_LIBCOAP_DEFAULT_MAX_PDU_RX_SIZE}>
$<$<BOOL:${CONFIG_LIBCOAP_RXBUFFER_SIZE}>:COAP_RXBUFFER_SIZE=${CONFIG_LIBCOAP_RXBUFFER_SIZE}>
$<$<BOOL:${CONFIG_LIBCOAP_DEFAULT_MTU}>:COAP_DEFAULT_MTU=${CONFIG_LIBCOAP_DEFAULT_MTU}>
$<$<BOOL:${CONFIG_LIBCOAP_DEFAULT_SESSION_TIMEOUT}>:COAP_DEFAULT_SESSION_TIMEOUT=${CONFIG_LIBCOAP_DEFAULT_SESSION_TIMEOUT}>
)
target_link_libraries(coap-3 PUBLIC zephyr_interface)
set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS coap-3)
+39 -3
View File
@@ -83,7 +83,7 @@ config LIBCOAP_ASYNC_SUPPORT
help
Enable async separate responses functionality for CoAP.
If this option is disabled, redundent CoAP async separate responses code is removed.
If this option is disabled, redundant CoAP async separate responses code is removed.
config LIBCOAP_THREAD_SAFE_SUPPORT
bool "Enable thread safe support within CoAP"
@@ -121,7 +121,7 @@ config LIBCOAP_CLIENT_SUPPORT
If this option is disabled, redundant CoAP client only code is
removed.
If both this option and LIBCOAP_SERVER_SUPPORT are disabled, then
both are automatically enabled for backwards compatability.
both are automatically enabled for backwards compatibility.
config LIBCOAP_SERVER_SUPPORT
bool "Enable Server functionality within CoAP"
@@ -133,7 +133,7 @@ config LIBCOAP_SERVER_SUPPORT
If this option is disabled, redundant CoAP server only code is
removed.
If both this option and LIBCOAP_CLIENT_SUPPORT are disabled, then
both are automatically enabled for backwards compatability.
both are automatically enabled for backwards compatibility.
config LIBCOAP_DEBUGGING
bool "Enable CoAP debugging"
@@ -186,6 +186,42 @@ config LIBCOAP_LOG_DEFAULT_LEVEL
default 7 if LIBCOAP_LOG_DEBUG
default 8 if LIBCOAP_LOG_OSCORE
config LIBCOAP_DEFAULT_MAX_PDU_RX_SIZE
int "Default max PDU RX size in bytes"
default 1152
help
Maximum size of incoming CoAP PDU. RFC7252 4.6 suggests 1152.
Increase for larger block-wise transfers (e.g. 1024-4096).
config LIBCOAP_RXBUFFER_SIZE
int "Receive buffer size in bytes"
default 1472
help
Size of the socket receive buffer for incoming CoAP/UDP packets.
Should be at least as large as the largest expected PDU (e.g. 1472
for typical Ethernet MTU minus headers).
config LIBCOAP_DEFAULT_MTU
int "Default MTU in bytes"
default 1152
help
Default path/session MTU used for CoAP (RFC7252 4.6 suggests 1152).
Used for session MTU and PDU sizing; increase for larger block-wise
transfers.
config LIBCOAP_OBS_MAX_NON
int "Observe: max NON notifications before CON"
default 5
range 1 255
help
Number of NON notifications before sending a CON (RFC7641 4.5).
config LIBCOAP_DEFAULT_SESSION_TIMEOUT
int "Default session timeout"
default 300
help
This setting refers to the COAP_DEFAULT_SESSION_TIMEOUT, which defines server session's timeout.
if MBEDTLS
config MBEDTLS_CIPHER_CCM_ENABLED