Skip to content

Commit

Permalink
Merge branch 'tinydtls-defaults' into stdio-coap
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Feb 28, 2023
2 parents 76a0e8c + 8e3a266 commit 4fa0928
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/tinydtls/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,22 @@ HANDSHAKE_MAX := $(or $(CONFIG_DTLS_HANDSHAKE_MAX),$(patsubst -DCONFIG_DTLS_HAND
ifneq (,$(HANDSHAKE_MAX))
CFLAGS += -DDTLS_HANDSHAKE_MAX=$(HANDSHAKE_MAX)
endif

ifneq (,$(filter gcoap,$(USEMODULE)))
# Configuring the buffer large enough that a full Gcoap packet can be
# encrypted or decrypted.

# This is the default in gcoap.h, which we don't have access to, so it is copied over.
CONFIG_GCOAP_PDU_BUF_SIZE := $(or $(CONFIG_GCOAP_PDU_BUF_SIZE),128)

# If there were another way to set up DTLS_MAX_BUF, we'd need to set the
# maximum of these here.
#
# 29 bytes are the overhead measured with Wireshark on packets exchanged in
# default configuration; adding some to be safe against variable size fields.
CFLAGS += "-DDTLS_MAX_BUF=($(CONFIG_GCOAP_PDU_BUF_SIZE) + 36)"
endif

# TinyDTLS emits several messages during connection establishment at the info
# level; this is way more verbose than common in RIOT.
CFLAGS += -DLOG_LEVEL=LOG_WARNING

0 comments on commit 4fa0928

Please sign in to comment.