#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y

# WPA supplicant
CONFIG_WPA_SUPP=y

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_CLOCK=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_LOG=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y
CONFIG_DNS_RESOLVER=y

CONFIG_NET_STATISTICS=y

CONFIG_NET_PKT_RX_COUNT=8
CONFIG_NET_PKT_TX_COUNT=8
CONFIG_POSIX_MAX_FDS=16
# Below section is the primary contributor to SRAM and is currently
# tuned for performance, but this will be revisited in the future.
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=16
CONFIG_NET_BUF_DATA_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=153600
CONFIG_NET_TC_TX_COUNT=0

CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_CONTEXT_SYNC_RECV=y

CONFIG_INIT_STACKS=y

CONFIG_NET_L2_ETHERNET=y

CONFIG_NET_CONFIG_SETTINGS=y

CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.165.100.150"
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.165.100.1"

CONFIG_NET_SOCKETS_POLL_MAX=4

# Memories
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

# Debugging
CONFIG_STACK_SENTINEL=y
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y

# Kernel options
CONFIG_ENTROPY_GENERATOR=y

# Logging
CONFIG_LOG=y

CONFIG_NET_L2_WIFI_MGMT=y

CONFIG_NET_MGMT_EVENT_STACK_SIZE=2048

CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y

CONFIG_BT_BUF_ACL_RX_SIZE=151
CONFIG_BT_L2CAP_TX_MTU=147
CONFIG_BT_BUF_ACL_TX_SIZE=151

CONFIG_BT_RX_STACK_SIZE=4096
CONFIG_BT_BONDABLE=n
CONFIG_BT_DEVICE_NAME_DYNAMIC=y

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

CONFIG_NVS=y

CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y

CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_BACKEND_SETTINGS=y
CONFIG_WIFI_CREDENTIALS_MAX_ENTRIES=1
CONFIG_NANOPB=y

CONFIG_BT_WIFI_PROV=y
CONFIG_WIFI_PROVISIONING_LOG_LEVEL_INF=y

# Button and LED support
CONFIG_DK_LIBRARY=y
# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_CLEAN_SESSION=y

# Application
CONFIG_MQTT_PUB_TOPIC="devacademy/publish/testtest123"
CONFIG_MQTT_SUB_TOPIC="devacademy/subscribe/testtest123"
#Note If you notice that the test.mosquitto.org is unresponsive,
#there are several other public MQTT brokers that you can use (Ex: broker.hivemq.com at port 1883)
CONFIG_MQTT_BROKER_HOSTNAME="test.mosquitto.org"

CONFIG_MQTT_CLIENT_ID="nRF7002DK_Test_Ali"
CONFIG_MQTT_BROKER_PORT=1883

CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="silver-test"
CONFIG_AWS_IOT_BROKER_HOST_NAME="example.endpoint.com"

# # AWS IoT library
CONFIG_POSIX_API=n
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_TLS_CREDENTIALS=y
CONFIG_AWS_IOT_SEND_TIMEOUT=n


# CONFIG_AWS_IOT_SEC_TAG=201
# CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
# CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
# CONFIG_AWS_IOT_LAST_WILL=y
# CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
# CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y

# # MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
# CONFIG_MQTT_KEEPALIVE=1200
# # AWS FOTA
# CONFIG_AWS_FOTA=y
# CONFIG_FOTA_DOWNLOAD=y
# CONFIG_DFU_TARGET=y

# CJSON
# CONFIG_CJSON_LIB=y
# CONFIG_EXTERNAL_LIBC=y

# # Download client (needed by AWS FOTA)
# CONFIG_DOWNLOAD_CLIENT=y
# CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096