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

menu "Application sample"

rsource "src/ui/Kconfig"
rsource "src/modules/Kconfig"
rsource "src/lwm2m/Kconfig"

menu "LwM2M objects"
config APP_PUSH_BUTTON
	bool "Enable button(s)"
	select UI_INPUT
	select LWM2M_IPSO_PUSH_BUTTON
	select LWM2M_APP_PUSH_BUTTON


config APP_ONOFF_SWITCH
	bool "Enable switches"
	depends on BOARD_NRF9160DK_NRF9160_NS
	select UI_INPUT
	select LWM2M_IPSO_ONOFF_SWITCH
	select LWM2M_APP_ONOFF_SWITCH


menuconfig APP_LIGHT_CONTROL
	bool "Enable LED(s)"
	select UI_LED
	select LWM2M_IPSO_LIGHT_CONTROL
	select LWM2M_APP_LIGHT_CONTROL

if APP_LIGHT_CONTROL
	rsource "src/ui/Kconfig.ui_led"
endif # APP_LIGHT_CONTROL


menuconfig APP_BUZZER
	bool "Enable buzzer"
	depends on BOARD_THINGY91_NRF9160_NS
	select UI_BUZZER
	select LWM2M_APP_BUZZER


menuconfig APP_LIGHT_SENSOR
	bool "Enable light sensor"
	select LIGHT_SENSOR
	select LWM2M_IPSO_APP_COLOUR_SENSOR
	select LWM2M_APP_LIGHT_SENSOR

if APP_LIGHT_SENSOR
	rsource "src/sensors/Kconfig.light_sensor"
	rsource "src/ipso/Kconfig.ipso_colour_sensor"
endif # APP_LIGHT_SENSOR


menuconfig APP_ENV_SENSOR
	bool "Enable environment sensors"
	select ENVIRONMENT_SENSOR
	help
	  Enables options for enabling temperature, pressure, humidity and gas resistance sensors.

if APP_ENV_SENSOR
rsource "src/sensors/Kconfig.env_sensor"

config APP_TEMP_SENSOR
	bool "Enable temperature sensor"
	select LWM2M_IPSO_TEMP_SENSOR
	select LWM2M_APP_TEMP_SENSOR

config APP_PRESS_SENSOR
	bool "Enable air pressure sensor"
	select LWM2M_IPSO_PRESSURE_SENSOR
	select LWM2M_APP_PRESS_SENSOR

config APP_HUMID_SENSOR
	bool "Enable humidity sensor"
	select LWM2M_IPSO_HUMIDITY_SENSOR
	select LWM2M_APP_HUMID_SENSOR

config APP_GAS_RES_SENSOR
	bool "Enable gas resistance sensor"
	select LWM2M_IPSO_GENERIC_SENSOR
	select LWM2M_APP_GAS_RES_SENSOR
endif # APP_ENV_SENSOR


menuconfig APP_ACCELEROMETER
	bool "Enable accelerometer"
	select ACCELEROMETER
	select LWM2M_IPSO_ACCELEROMETER
	select LWM2M_APP_ACCELEROMETER

if APP_ACCELEROMETER
	rsource "src/sensors/Kconfig.accelerometer"
endif # APP_ACCELEROMETER

menuconfig APP_GPS
	bool "Enable GPS"
	select GPS
	select LWM2M_LOCATION_OBJ_SUPPORT

if APP_GPS
	rsource "src/sensors/Kconfig.gps"

config APP_GPS_HOLD_TIME
	int "Minimum time [s] between location data notification messages"
	default 60
	help
	  The minimum time in seconds that notifications can be sent to observers of the Location data.
endif # APP_GPS
endmenu # LwM2M objects

config APP_LWM2M_SERVER
	string "LwM2M server name or IP address"
	help
	  Choose the LwM2M server you wish to connect to.

config APP_LWM2M_PSK
	string "LwM2M pre-shared key for communication"
	default "000102030405060708090a0b0c0d0e0f"
	help
	  Pre Shared Key must be identical to the PSK registered with the device on the LwM2M server.
	  Use the hexadecimal representation.

config APP_ENDPOINT_PREFIX
	string "Prefix used in the endpoint name"
	default "urn:imei:"
	help
	  Sets the prefix of the endpoint name used when connecting to the LwM2M server.

config APP_SERVER_TLS_TAG
	int "LwM2M server TLS tag"
	default 35724861

config APP_BOOTSTRAP_TLS_TAG
	int "LwM2M bootstrap server TLS tag"
	default 35724862

menu "Device info"
config APP_MANUFACTURER
	string "Board manufacturer"
	default	"Nordic Semiconductor ASA"

config APP_DEVICE_TYPE
	string "Device type"
	default	"OMA-LWM2M Client"
endmenu

config APP_HOLD_TIME_RSRP
	int "Minimum time [s] between RSRP notification messages"
	default 60
	help
	  The minimum time in seconds that notifications can be sent to observers of the
	  Connectivity Monitoring data.

config APP_MCUBOOT_FLASH_BUF_SZ
	int "Size of buffer used for flash write operations during MCUboot updates"
	depends on DFU_TARGET_MCUBOOT
	default 512
	help
	  Buffer size must be aligned to the minimal flash write block size.

config APP_CUSTOM_VERSION
	string "Application version. Leave empty to use NCS version."

module = APP
module-dep = LOG
module-str = Log level for sample
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
endmenu # Application sample


menu "Zephyr Kernel"
source "Kconfig.zephyr"
endmenu # Zephyr Kernel
