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

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_RESET_ON_FATAL_ERROR=n

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=32768
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_HW_STACK_PROTECTION=y

# Logging
CONFIG_LOG=y
CONFIG_LOG_IMMEDIATE=y

# DK - Used for buttons and LEDs in UI module.
CONFIG_DK_LIBRARY_INVERT_LEDS=n

# nRF modem library
CONFIG_NRF_MODEM_LIB=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

# LTE link control
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
#CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y
## Power saving timers.
CONFIG_LTE_PSM_REQ_RPTAU="01000011"
CONFIG_LTE_PSM_REQ_RAT="00000000"

# AWS IoT
## Mandatory application specific configurations for AWS_IOT.
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
CONFIG_AWS_IOT_CLIENT_ID_APP=y
CONFIG_AWS_FOTA=y

## AWS IoT options that must be configured.
CONFIG_AWS_IOT_SEC_TAG=42
CONFIG_AWS_IOT_BROKER_HOST_NAME="a1oa7n0nch4ttv-ats.iot.us-west-2.amazonaws.com"

# MQTT
# Keepalive should be set to the maximum specified MQTT keepalive timeout of the
#        selected cloud library.
#        1200 seconds for AWS IoT.
CONFIG_MQTT_KEEPALIVE=1200

# Settings - Used to store real-time device configuration to flash.
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# FOTA - Needed by AWS IoT.
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128

# Flash - Used in FOTA and Settings.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=y

# AGPS
# To use AGPS, a source of assistance data must be selected. By default, SUPL
# is selected. However, due to licensing, the SUPL library must be manually
# downloaded and configured according to the instructions found in the SUPL
# client library documentation in NCS.
CONFIG_AGPS_SRC_SUPL=y
CONFIG_AGPS=y
CONFIG_SUPL_CLIENT_LIB=y

# Event Manager
CONFIG_EVENT_MANAGER=y
CONFIG_LINKER_ORPHAN_SECTION_PLACE=y
CONFIG_DESKTOP_EVENT_MANAGER_LOG_EVENT_TYPE=n

# cJSON - Used in AWS FOTA and cloud data traffic encoding.
CONFIG_CJSON_LIB=y
CONFIG_THREAD_NAME=y 