CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y

#enable BT
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y

#disable BT connection reattempt
CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n

# Disable lwip ipv6 autoconfig
CONFIG_LWIP_IPV6_AUTOCONFIG=n

# Use a custom partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0xC000

# disable softap by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n

CONFIG_ENABLE_WIFI_AP=n

# Enable HKDF in mbedtls
CONFIG_MBEDTLS_HKDF_C=y

# This example only use 2 dynamic endpoints
CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT=2

# NIMBLE
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y

# Enable OpenThread
CONFIG_OPENTHREAD_ENABLED=y
CONFIG_OPENTHREAD_SRP_CLIENT=y
CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n
CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y
CONFIG_OPENTHREAD_CLI=n

# LwIP config for OpenThread
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_LWIP_MULTICAST_PING=y

# MDNS platform
CONFIG_USE_MINIMAL_MDNS=n

# Enable OTA Requestor
CONFIG_ENABLE_OTA_REQUESTOR=y

# Disable STA
CONFIG_ENABLE_WIFI_STATION=n

# BLE Sleep
CONFIG_BT_LE_SLEEP_ENABLE=y
CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y

# Disable external 32K crystal
CONFIG_RTC_CLK_SRC_EXT_CRYS=n

# Enable power management
CONFIG_PM_ENABLE=y
CONFIG_PM_DFS_INIT_AUTO=y
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y

# FreeRTOS config for light sleep
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y

# Enable IEEE 802.15.4 sleep
CONFIG_IEEE802154_SLEEP_ENABLE=y

# FreeRTOS config for light sleep
CONFIG_LWIP_ND6=n
CONFIG_LWIP_IPV4=n
CONFIG_DISABLE_IPV4=y

# mbedTLS
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y

# Use OpenThread MTD
CONFIG_OPENTHREAD_MTD=y

# ICD configurations
CONFIG_ENABLE_ICD_SERVER=y
CONFIG_ICD_FAST_POLL_INTERVAL_MS=500
CONFIG_ICD_IDLE_MODE_INTERVAL_SEC=60
CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS=1000
CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS=1000

# Enable power save for the button
CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE=y
