Skip to content

Commit

Permalink
net/coap: Expose configurations to Kconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrolanzieri committed Mar 13, 2020
1 parent 76983f6 commit 02ac496
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sys/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
menu "Networking"

rsource "application_layer/gcoap/Kconfig"
rsource "application_layer/Kconfig"
rsource "gnrc/Kconfig"
rsource "sock/Kconfig"

Expand Down
8 changes: 8 additions & 0 deletions sys/net/application_layer/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
rsource "gcoap/Kconfig"
rsource "Kconfig.coap"
49 changes: 49 additions & 0 deletions sys/net/application_layer/Kconfig.coap
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#

config HAS_PROTOCOL_COAP
bool
#TODO: This should be selected the Kconfig of the modules that provide it, but
# nanocoap does not have Kconfig file yet.
default y if MODULE_NANOCOAP
help
Specifies that CoAP support is present.

menuconfig KCONFIG_COAP
bool "Configure CoAP generic options"
depends on HAS_PROTOCOL_COAP
help
Configure CoAP generic options via Kconfig.

if KCONFIG_COAP

config COAP_ACK_TIMEOUT
int "Timeout in seconds for a response to a confirmable request"
default 2
help
This value is for the response to the initial confirmable message. The
timeout doubles for subsequent retries. To avoid synchronization of
resends across hosts, the actual timeout is chosen randomly between
@ref CONFIG_COAP_ACK_TIMEOUT and
(@ref CONFIG_COAP_ACK_TIMEOUT * @ref CONFIG_COAP_RANDOM_FACTOR_1000 / 1000).

config COAP_RANDOM_FACTOR_1000
int "Timeout random factor (multiplied by 1000)"
default 1500
help
This value is used to calculate the upper bound for the timeout. It
represents the `ACK_RANDOM_FACTOR`
([RFC 7252, section 4.2](https://tools.ietf.org/html/rfc7252#section-4.2))
multiplied by 1000, to avoid floating point arithmetic.

config COAP_MAX_RETRANSMIT
int "Maximum number of retransmissions"
default 4
help
Maximum number of retransmissions for a confirmable request.

endif # KCONFIG_COAP

0 comments on commit 02ac496

Please sign in to comment.