#
# Copyright (c) 2020 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# nRF board library
CONFIG_DK_LIBRARY=y

# Enable OpenThread CoAP support API
CONFIG_OPENTHREAD_COAP=y
CONFIG_COAP=y
CONFIG_COAP_UTILS=y

# Network shell
CONFIG_SHELL=y
CONFIG_OPENTHREAD_SHELL=y
CONFIG_SHELL_ARGC_MAX=26
CONFIG_SHELL_CMD_BUFF_SIZE=416

# Increase Settings storage size
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000

# Network sockets
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y
CONFIG_NET_SOCKETS_POLL_MAX=4

# Same network Master Key for client and server
# CONFIG_OPENTHREAD_NETWORKKEY="00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff"

# L2 OpenThread enabling
CONFIG_NET_L2_OPENTHREAD=y

# Generic networking options
CONFIG_NETWORKING=y

CONFIG_MBEDTLS_SHA1_C=n
CONFIG_FPU=y

# Configure sample logging setting
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_COAP_SERVER_LOG_LEVEL_DBG=y
CONFIG_OT_COAP_UTILS_LOG_LEVEL_DBG=y
CONFIG_DEBUG_OPTIMIZATIONS=y

# Enable asserts
CONFIG_ASSERT=y
CONFIG_ASSERT_NO_COND_INFO=y

# Enable hardware and task watchdog
CONFIG_WATCHDOG=y
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WDT_DISABLE_AT_BOOT=y
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_HW_FALLBACK=y
CONFIG_TASK_WDT_MIN_TIMEOUT=5000

# Newlib C library and thread awareness support
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048
CONFIG_DEBUG_THREAD_INFO=y

# Openthread
CONFIG_OPENTHREAD_CHANNEL_MANAGER=y
CONFIG_OPENTHREAD_DEBUG=y
CONFIG_OPENTHREAD_LOG_LEVEL_DEBG=n

# SPI support
CONFIG_SPI=y
CONFIG_SPI_SLAVE=y
CONFIG_SPI_COMPLETION_TIMEOUT_TOLERANCE=200
CONFIG_SPI_ASYNC=y

# System workqueue stack size
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Openthread commissioner
CONFIG_OPENTHREAD_COMMISSIONER=y
