1# CoAP implementation for Zephyr
2
3# Copyright (c) 2017 Intel Corporation
4# SPDX-License-Identifier: Apache-2.0
5
6config COAP
7	bool "CoAP Support"
8	help
9	  This option enables the CoAP implementation.
10
11
12if COAP
13
14# This setting is only used by unit test. Do not enable it in applications
15config COAP_TEST_API_ENABLE
16	bool "Test API for CoAP unit tests"
17	help
18	  Do not enable this for normal use.
19
20config COAP_WELL_KNOWN_BLOCK_WISE
21	bool "CoAP ./well-known/core services block wise support"
22	help
23	  This option enables the block wise support of CoAP response
24	  to ./well-known/core request. Without this option all resource's
25	  information will be sent in a single IP packet (can be multiple
26	  fragments depends on MTU size). This will be useful in mesh kind
27	  of networks.
28
29config COAP_WELL_KNOWN_BLOCK_WISE_SIZE
30	int "CoAP ./well-known/core services block wise support"
31	default 32
32	depends on COAP_WELL_KNOWN_BLOCK_WISE
33	help
34	  Maximum size of CoAP block. Valid values are 16, 32, 64, 128,
35	  256, 512 and 1024.
36
37config COAP_EXTENDED_OPTIONS_LEN
38	bool "Support for CoAP extended options"
39	help
40	  This option enables the parsing of extended CoAP options length.
41	  CoAP extended options length can be 2 byte value, which
42	  requires more memory. User can save memory by disabling this.
43	  That means only length of maximum 12 bytes are supported by default.
44	  Enable this if length field going to bigger that 12.
45
46config COAP_EXTENDED_OPTIONS_LEN_VALUE
47	int "CoAP extended options length value"
48	default 13
49	depends on COAP_EXTENDED_OPTIONS_LEN
50	help
51	  This option specifies the maximum value of length field when
52	  COAP_EXTENDED_OPTIONS_LEN is enabled. Define the value according to
53	  user requirement.
54
55config COAP_INIT_ACK_TIMEOUT_MS
56	int "base length of the random generated initial ACK timeout in ms"
57	default 2000
58	range 1000 100000
59	help
60	  This value is used as a base value to retry pending CoAP packets.
61
62config COAP_RANDOMIZE_ACK_TIMEOUT
63	bool "Randomize initial ACK timeout, as specified in RFC 7252"
64	default y
65	help
66	  If enabled, the initial ACK timeout will be randomized, as specified
67	  in RFC 7252, i.e. will be a random number between ACK_TIMEOUT and
68	  ACK_TIMEOUT * ACK_RANDOM_FACTOR (where ACK_TIMEOUT is specified by
69	  COAP_INIT_ACK_TIMEOUT_MS option). Otherwise, the initial ACK timeout
70	  will be fixed to the value of COAP_INIT_ACK_TIMEOUT_MS option.
71
72config COAP_ACK_RANDOM_PERCENT
73	int "Random factor for ACK timeout described as percentage"
74	default 150
75	depends on COAP_RANDOMIZE_ACK_TIMEOUT
76	help
77	  Factor described as percentage to extend CoAP ACK timeout. A value
78	  of 150 means a factor of 1.50.
79
80config COAP_MAX_RETRANSMIT
81	int "Max retransmission of a CoAP packet"
82	default 4
83	range 1 10
84
85config COAP_URI_WILDCARD
86	bool "Wildcards in CoAP resource path"
87	default y
88	help
89	  This option enables MQTT-style wildcards in path. Disable it if
90	  resource path may contain plus or hash symbol.
91
92config COAP_KEEP_USER_DATA
93	bool "Keeping user data in the CoAP packet"
94	help
95	  This option enables keeping application-specific user data
96
97config COAP_CLIENT
98	bool "CoAP client support [EXPERIMENTAL]"
99	select EXPERIMENTAL
100	help
101	  This option enables the API for CoAP-client for sending CoAP requests
102
103if COAP_CLIENT
104
105config COAP_CLIENT_THREAD_PRIORITY
106	int "Coap client thread priority"
107	default NUM_PREEMPT_PRIORITIES
108	help
109	  Priority of receive thread of the CoAP client.
110
111config COAP_CLIENT_BLOCK_SIZE
112	int "LWM2M CoAP block-wise transfer size"
113	default 256
114	range 64 1024
115	help
116	  CoAP block size used by CoAP client when performing block-wise
117	  transfers. Possible values: 64, 128, 256, 512 and 1024.
118
119config COAP_CLIENT_MESSAGE_SIZE
120	int "Message payload size"
121	default COAP_CLIENT_BLOCK_SIZE
122	help
123	  CoAP client message payload size. Can't be smaller than COAP_CLIENT_BLOCK_SIZE.
124
125config COAP_CLIENT_MESSAGE_HEADER_SIZE
126	int "Room for CoAP header data"
127	default 48
128	range 24 128
129	help
130	  Extra room allocated to handle CoAP header data
131
132config COAP_CLIENT_STACK_SIZE
133	int "Stack size of the CoAP client thread"
134	default 1024
135
136endif # COAP_CLIENT
137
138module = COAP
139module-dep = NET_LOG
140module-str = Log level for CoAP
141module-help = Enables CoAP debug messages.
142source "subsys/net/Kconfig.template.log_config.net"
143
144endif # COAP
145