menu "CoAP Configuration"
    visible if LWIP_IPV6

    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
            bool "Pre-Shared Keys"

        config COAP_MBEDTLS_PKI
            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.

            Note: The Mbed TLS library logging is controlled by the mbedTLS
            configuration, but logging level mbedTLS must be set for CoAP
            to log it.

    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"
        config COAP_LOG_MBEDTLS
            bool "mbedTLS"
    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
        default 9 if COAP_LOG_MBEDTLS

    config COAP_TCP_SUPPORT
        bool "Enable TCP within CoAP"
        default y
        help
            Enable TCP functionality for CoAP. This is required if TLS sessions
            are to be used.

            If this option is disabled, redundent CoAP TCP code is removed.

    config COAP_CLIENT_SUPPORT
        bool "Enable Client functionality within CoAP"
        default n
        help
            Enable client functionality (ability to make requests and receive
            responses) for CoAP. If the server is going to act as a proxy, then
            this needs to be enabled to support the ongoing session going to
            the next hop.

            If this option is disabled, redundent CoAP client only code is removed.
            If both this option and COAP_SERVER_SUPPORT are disabled, then both
            are automatically enabled for backwards compatability.

    config COAP_SERVER_SUPPORT
        bool "Enable Server functionality within CoAP"
        default n
        help
            Enable server functionality (ability to receive requests and send
            responses) for CoAP.

            If this option is disabled, redundent CoAP server only code is removed.
            If both this option and COAP_CLIENT_SUPPORT are disabled, then both
            are automatically enabled for backwards compatability.

endmenu
