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

if BT_MESH

menu "Bluetooth Mesh"

if BT_MESH_SETTINGS_WORKQ

config BT_MESH_SETTINGS_WORKQ_STACK_SIZE
	default 1400

endif

if BT_MESH_ADV_EXT

# Set the optimal advertiser configuration to improve performance of the Relay, GATT and Friend
# features.
#
# <num of adv sets> = 1 (local msgs) + 2 (relay msgs) + 1 (GATT advs) + 1 (Friend msgs)
config BT_EXT_ADV_MAX_ADV_SET
	default 5

config BT_MESH_RELAY_ADV_SETS
	depends on BT_MESH_RELAY
	default 2

config BT_MESH_ADV_EXT_GATT_SEPARATE
	depends on BT_MESH_GATT_SERVER
	default y

config BT_MESH_ADV_EXT_FRIEND_SEPARATE
	depends on BT_MESH_FRIEND
	default y

if BT_MESH_RELAY

config BT_MESH_RELAY_RETRANSMIT_COUNT
	default 0

config BT_MESH_RELAY_BUF_COUNT
	default 10

endif # BT_MESH_RELAY

endif

config BT_MESH_NLC_PERF_CONF
	bool "Enable NLC performance configurations"
	select BT_MESH_COMP_PAGE_2
	select BT_MESH_COMP_PAGE_1
	help
	  Enables performance configurations required for NLC profiles.
	  When implementing the NLC Basic Lightness Controller profile
	  individually or in conjunction with other NLC profiles, also
	  enable CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL.

choice BT_MESH_NLC_PERF_OPTIONS
	prompt "NLC configuration options"
	depends on BT_MESH_NLC_PERF_CONF

config BT_MESH_NLC_PERF_DEFAULT
	bool "Default"
	help
	  Enables performance configurations required for the NLC Basic Scene Selector,
	  Dimming Control, Energy Monitor, Occupancy Sensor and Ambient Light Sensor profiles.
	  When implementing the NLC Basic Lightness Controller profile individually or in
	  conjunction with other NLC profiles, use CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL instead.

config BT_MESH_NLC_PERF_LIGHTNESS_CTRL
	bool "Enable strict performance configurations required for the Basic Lightness Controller"
	help
	  Enables required performance configurations for the
	  NLC Basic Lightness Controller. The NLC Basic Lightness Controller
	  share most performance configurations with the common NLC profiles
	  (CONFIG_BT_MESH_NLC_PERF_DEFAULT) but with more strict requirements for a
	  subset of the configurations.

endchoice

config BT_MESH_CRPL
	default 32 if BT_MESH_NLC_PERF_DEFAULT
	default 255 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
	range 32 65535 if BT_MESH_NLC_PERF_DEFAULT
	range 255 65535 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL

config BT_MESH_MODEL_GROUP_COUNT
	default 32 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
	range 32 4096 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL

if BT_MESH_NLC_PERF_CONF

config BT_MESH_MSG_CACHE_SIZE
	default 64
	range 64 65535

config BT_MESH_APP_KEY_COUNT
	default 3
	range 3 4096

config BT_MESH_SUBNET_COUNT
	default 2
	range 2 4096

config BT_MESH_PROXY_FILTER_SIZE
	default 8
	range 8 32767

endif

config BT_MESH_USES_TFM_PSA
	bool
	select PSA_WANT_GENERATE_RANDOM
	select PSA_WANT_ALG_CCM
	select PSA_WANT_ALG_ECB_NO_PADDING
	select PSA_WANT_ALG_CMAC
	select PSA_WANT_ALG_HMAC
	select PSA_WANT_ALG_ECDH
	select PSA_WANT_ECC_SECP_R1_256
	select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
	select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
	select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT

choice TFM_PROFILE_TYPE
	depends on BT_MESH_USES_TFM_PSA
	default TFM_PROFILE_TYPE_NOT_SET
endchoice

config BT_MESH_DFU_METADATA_ON_BUILD
	bool "Generate DFU metadata on build"
	default y if BT_MESH_DFU_SRV
	depends on SIGN_IMAGES
	help
	  Generate a JSON file containing all DFU related metadata upon
	  application build. The JSON will be added to dfu application zip
	  file stored in the project binary folder of your project, along
	  with the application update image.

rsource "Kconfig.models"
rsource "Kconfig.dk_prov"
rsource "shell/Kconfig"
rsource "Kconfig.rpl"

endmenu

endif # BT_MESH
