mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
coap: kconfig cleanup, have component specific configuration for common options
This commit is contained in:
74
components/coap/Kconfig
Normal file
74
components/coap/Kconfig
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
menu "CoAP Configuration"
|
||||||
|
|
||||||
|
choice COAP_MBEDTLS_ENCRYPTION_MODE
|
||||||
|
prompt "CoAP Encryption method"
|
||||||
|
default COAP_MBEDTLS_PSK
|
||||||
|
help
|
||||||
|
If the CoAP information is to be encrypted, the encryption environment
|
||||||
|
can be set up in one of two ways (default being Pre-Shared key mode)
|
||||||
|
|
||||||
|
- Encrypt using defined Pre-Shared Keys (PSK if uri includes coaps://)
|
||||||
|
- Encrypt using defined Public Key Infrastructure (PKI if uri includes coaps://)
|
||||||
|
|
||||||
|
config COAP_MBEDTLS_PSK
|
||||||
|
select MBEDTLS_SSL_PROTO_DTLS
|
||||||
|
select MBEDTLS_PSK_MODES
|
||||||
|
select MBEDTLS_KEY_EXCHANGE_PSK
|
||||||
|
bool "Pre-Shared Keys"
|
||||||
|
|
||||||
|
config COAP_MBEDTLS_PKI
|
||||||
|
select MBEDTLS_SSL_PROTO_DTLS
|
||||||
|
select MBEDTLS_PSK_MODES
|
||||||
|
select MBEDTLS_KEY_EXCHANGE_PSK
|
||||||
|
bool "PKI Certificates"
|
||||||
|
|
||||||
|
endchoice #COAP_MBEDTLS_ENCRYPTION_MODE
|
||||||
|
|
||||||
|
config COAP_MBEDTLS_DEBUG
|
||||||
|
bool "Enable CoAP debugging"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable CoAP debugging functions at compile time for the example code.
|
||||||
|
|
||||||
|
If this option is enabled, call coap_set_log_level()
|
||||||
|
at runtime in order to enable CoAP debug output via the ESP
|
||||||
|
log mechanism.
|
||||||
|
|
||||||
|
choice COAP_MBEDTLS_DEBUG_LEVEL
|
||||||
|
bool "Set CoAP debugging level"
|
||||||
|
depends on COAP_MBEDTLS_DEBUG
|
||||||
|
default COAP_LOG_WARNING
|
||||||
|
help
|
||||||
|
Set CoAP debugging level
|
||||||
|
|
||||||
|
config COAP_LOG_EMERG
|
||||||
|
bool "Emergency"
|
||||||
|
config COAP_LOG_ALERT
|
||||||
|
bool "Alert"
|
||||||
|
config COAP_LOG_CRIT
|
||||||
|
bool "Critical"
|
||||||
|
config COAP_LOG_ERROR
|
||||||
|
bool "Error"
|
||||||
|
config COAP_LOG_WARNING
|
||||||
|
bool "Warning"
|
||||||
|
config COAP_LOG_NOTICE
|
||||||
|
bool "Notice"
|
||||||
|
config COAP_LOG_INFO
|
||||||
|
bool "Info"
|
||||||
|
config COAP_LOG_DEBUG
|
||||||
|
bool "Debug"
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
config COAP_LOG_DEFAULT_LEVEL
|
||||||
|
int
|
||||||
|
default 0 if !COAP_MBEDTLS_DEBUG
|
||||||
|
default 0 if COAP_LOG_EMERG
|
||||||
|
default 1 if COAP_LOG_ALERT
|
||||||
|
default 2 if COAP_LOG_CRIT
|
||||||
|
default 3 if COAP_LOG_ERROR
|
||||||
|
default 4 if COAP_LOG_WARNING
|
||||||
|
default 5 if COAP_LOG_NOTICE
|
||||||
|
default 6 if COAP_LOG_INFO
|
||||||
|
default 7 if COAP_LOG_DEBUG
|
||||||
|
|
||||||
|
endmenu
|
@@ -1,96 +1,27 @@
|
|||||||
menu "Example CoAP Client Configuration"
|
menu "Example CoAP Client Configuration"
|
||||||
|
|
||||||
config TARGET_DOMAIN_URI
|
config EXAMPLE_TARGET_DOMAIN_URI
|
||||||
string "Target Uri"
|
string "Target Uri"
|
||||||
default "coap://californium.eclipse.org"
|
default "coaps://californium.eclipse.org"
|
||||||
help
|
help
|
||||||
Target uri for the example to use. Use coaps:// prefix for encrypted traffic
|
Target uri for the example to use. Use coaps:// prefix for encrypted traffic
|
||||||
using Pre-Shared Key (PSK) or Public Key Infrastructure (PKI).
|
using Pre-Shared Key (PSK) or Public Key Infrastructure (PKI).
|
||||||
|
|
||||||
choice MBEDTLS_COAP_ENCRYPTION_MODE
|
config EXAMPLE_COAP_PSK_KEY
|
||||||
prompt "CoAP Encryption method"
|
|
||||||
default MBEDTLS_COAP_PKI_NONE
|
|
||||||
help
|
|
||||||
If the CoAP information is to be encrypted, the encryption environment
|
|
||||||
can be set up in one of three ways
|
|
||||||
|
|
||||||
- None defined (will use PKI if coaps:// used)
|
|
||||||
- Encrypt using defined Pre-Shared Keys (PSK)
|
|
||||||
- Encrypt using defined Public Key Infrastructure (PKI)
|
|
||||||
|
|
||||||
config MBEDTLS_COAP_NONE
|
|
||||||
bool "None defined"
|
|
||||||
|
|
||||||
config MBEDTLS_COAP_PSK
|
|
||||||
bool "Pre-Shared Keys"
|
|
||||||
|
|
||||||
config MBEDTLS_COAP_PKI
|
|
||||||
bool "PKI Certificates"
|
|
||||||
|
|
||||||
endchoice #MBEDTLS_COAP_ENCRYPTION_MODE
|
|
||||||
|
|
||||||
config COAP_PSK_KEY
|
|
||||||
string "Preshared Key (PSK) to used in the connection to the CoAP server"
|
string "Preshared Key (PSK) to used in the connection to the CoAP server"
|
||||||
depends on MBEDTLS_COAP_PSK
|
depends on COAP_MBEDTLS_PSK
|
||||||
default "secret-key"
|
default "sesame"
|
||||||
help
|
help
|
||||||
The Preshared Key to use to encrypt the communicatons. The same key must be
|
The Preshared Key to use to encrypt the communicatons. The same key must be
|
||||||
used at both ends of the CoAP connection, and the CoaP client must request
|
used at both ends of the CoAP connection, and the CoaP client must request
|
||||||
an URI prefixed with coaps:// instead of coap:// for DTLS to be used.
|
an URI prefixed with coaps:// instead of coap:// for DTLS to be used.
|
||||||
|
|
||||||
config COAP_PSK_IDENTITY
|
config EXAMPLE_COAP_PSK_IDENTITY
|
||||||
string "PSK Client identity (username)"
|
string "PSK Client identity (username)"
|
||||||
depends on MBEDTLS_COAP_PSK
|
depends on COAP_MBEDTLS_PSK
|
||||||
default "coap-client"
|
default "password"
|
||||||
help
|
help
|
||||||
The identity (or username) to use to identify to the CoAP server which
|
The identity (or username) to use to identify to the CoAP server which
|
||||||
PSK key to use.
|
PSK key to use.
|
||||||
|
|
||||||
config MBEDTLS_COAP_DEBUG
|
|
||||||
bool "Enable CoAP debugging"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Enable CoAP debugging functions at compile time for the example code.
|
|
||||||
|
|
||||||
If this option is enabled, call coap_set_log_level()
|
|
||||||
at runtime in order to enable CoAP debug output via the ESP
|
|
||||||
log mechanism.
|
|
||||||
|
|
||||||
choice MBEDTLS_COAP_DEBUG_LEVEL
|
|
||||||
bool "Set CoAP debugging level"
|
|
||||||
depends on MBEDTLS_COAP_DEBUG
|
|
||||||
default COAP_LOG_WARNING
|
|
||||||
help
|
|
||||||
Set CoAP debugging level
|
|
||||||
|
|
||||||
config COAP_LOG_EMERG
|
|
||||||
bool "Emergency"
|
|
||||||
config COAP_LOG_ALERT
|
|
||||||
bool "Alert"
|
|
||||||
config COAP_LOG_CRIT
|
|
||||||
bool "Critical"
|
|
||||||
config COAP_LOG_ERROR
|
|
||||||
bool "Error"
|
|
||||||
config COAP_LOG_WARNING
|
|
||||||
bool "Warning"
|
|
||||||
config COAP_LOG_NOTICE
|
|
||||||
bool "Notice"
|
|
||||||
config COAP_LOG_INFO
|
|
||||||
bool "Info"
|
|
||||||
config COAP_LOG_DEBUG
|
|
||||||
bool "Debug"
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config COAP_LOG_DEFAULT_LEVEL
|
|
||||||
int
|
|
||||||
default 0 if !MBEDTLS_COAP_DEBUG
|
|
||||||
default 0 if COAP_LOG_EMERG
|
|
||||||
default 1 if COAP_LOG_ALERT
|
|
||||||
default 2 if COAP_LOG_CRIT
|
|
||||||
default 3 if COAP_LOG_ERROR
|
|
||||||
default 4 if COAP_LOG_WARNING
|
|
||||||
default 5 if COAP_LOG_NOTICE
|
|
||||||
default 6 if COAP_LOG_INFO
|
|
||||||
default 7 if COAP_LOG_DEBUG
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -1,74 +1,11 @@
|
|||||||
menu "Example CoAP Server Configuration"
|
menu "Example CoAP Server Configuration"
|
||||||
|
|
||||||
config MBEDTLS_COAP_PSK
|
config EXAMPLE_COAP_PSK_KEY
|
||||||
bool "Pre-Shared Keys (PSK)"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Use Pre-Shared Keys to encrypt the communications between the
|
|
||||||
CoAP Server and CoAP Client. Both ends need the same
|
|
||||||
Pre-Shared Key.
|
|
||||||
|
|
||||||
config COAP_PSK_KEY
|
|
||||||
string "Preshared Key (PSK) to used in the connection from the CoAP client"
|
string "Preshared Key (PSK) to used in the connection from the CoAP client"
|
||||||
depends on MBEDTLS_COAP_PSK
|
depends on COAP_MBEDTLS_PSK
|
||||||
default "secret-key"
|
default "secret-key"
|
||||||
help
|
help
|
||||||
The Preshared Key to use to encrypt the communicatons. The same key must be
|
The Preshared Key to use to encrypt the communicatons. The same key must be
|
||||||
used at both ends of the CoAP connection, and the CoaP client must request
|
used at both ends of the CoAP connection, and the CoaP client must request
|
||||||
an URI prefixed with coaps:// instead of coap:// for DTLS to be used.
|
an URI prefixed with coaps:// instead of coap:// for DTLS to be used.
|
||||||
|
|
||||||
config MBEDTLS_COAP_PKI
|
|
||||||
bool "Public Key Infrastructure (PKI)"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Use PKI Certificates and Private Keys to encrypt the communications
|
|
||||||
between the CoAP Server and CoAP Client.
|
|
||||||
|
|
||||||
config MBEDTLS_COAP_DEBUG
|
|
||||||
bool "Enable CoAP debugging"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Enable CoAP debugging functions at compile time for the example code.
|
|
||||||
|
|
||||||
If this option is enabled, call coap_set_log_level()
|
|
||||||
at runtime in order to enable CoAP debug output via the ESP
|
|
||||||
log mechanism.
|
|
||||||
|
|
||||||
choice MBEDTLS_COAP_DEBUG_LEVEL
|
|
||||||
bool "Set CoAP debugging level"
|
|
||||||
depends on MBEDTLS_COAP_DEBUG
|
|
||||||
default COAP_LOG_WARNING
|
|
||||||
help
|
|
||||||
Set CoAP debugging level
|
|
||||||
|
|
||||||
config COAP_LOG_EMERG
|
|
||||||
bool "Emergency"
|
|
||||||
config COAP_LOG_ALERT
|
|
||||||
bool "Alert"
|
|
||||||
config COAP_LOG_CRIT
|
|
||||||
bool "Critical"
|
|
||||||
config COAP_LOG_ERROR
|
|
||||||
bool "Error"
|
|
||||||
config COAP_LOG_WARNING
|
|
||||||
bool "Warning"
|
|
||||||
config COAP_LOG_NOTICE
|
|
||||||
bool "Notice"
|
|
||||||
config COAP_LOG_INFO
|
|
||||||
bool "Info"
|
|
||||||
config COAP_LOG_DEBUG
|
|
||||||
bool "Debug"
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config COAP_LOG_DEFAULT_LEVEL
|
|
||||||
int
|
|
||||||
default 0 if !MBEDTLS_COAP_DEBUG
|
|
||||||
default 0 if COAP_LOG_EMERG
|
|
||||||
default 1 if COAP_LOG_ALERT
|
|
||||||
default 2 if COAP_LOG_CRIT
|
|
||||||
default 3 if COAP_LOG_ERROR
|
|
||||||
default 4 if COAP_LOG_WARNING
|
|
||||||
default 5 if COAP_LOG_NOTICE
|
|
||||||
default 6 if COAP_LOG_INFO
|
|
||||||
default 7 if COAP_LOG_DEBUG
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
Reference in New Issue
Block a user