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

menu "MQTT simple sample"
	config MQTT_PUB_TOPIC
		string "MQTT publish topic"
		default "my/publish/topic"
	
	config MQTT_SUB_TOPIC
		string "MQTT subscribe topic"
		default "my/subscribe/topic"
	
	config MQTT_CLIENT_ID
		string "MQTT Client ID"
		help
		  Use a custom Client ID string. If not set, the client ID will be
		  generated based on IMEI number (for nRF9160 based targets) or
		  randomly (for other platforms).
		default ""
	
	config MQTT_BROKER_HOSTNAME
		string "MQTT broker hostname"
		default "mqtt.eclipseprojects.io"
	
	config MQTT_BROKER_PORT
		int "MQTT broker port"
		default 1883
	
	config MQTT_MESSAGE_BUFFER_SIZE
		int "MQTT message buffer size"
		default 128
	
	config MQTT_PAYLOAD_BUFFER_SIZE
		int "MQTT payload buffer size"
		default 128
	
	config BUTTON_EVENT_PUBLISH_MSG
		string "The message to publish on a button event"
		default "Hello from nRF91 MQTT Simple Sample"
	
	config BUTTON_EVENT_BTN_NUM
		int "The button number"
		default 1
	
	config MQTT_RECONNECT_DELAY_S
		int "Seconds to delay before attempting to reconnect to the broker"
		default 60
	
	config LTE_CONNECT_RETRY_DELAY_S
		int "Seconds to delay before attempting to retry LTE connection"
		default 120
	
	config MQTT_TLS_SEC_TAG
		int "TLS credentials security tag"
		default 24
	
	config MQTT_TLS_SESSION_CACHING
		bool "Enable TLS session caching"
	
	config MQTT_TLS_PEER_VERIFY
		int "Set peer verification level"
		default 2
		help
			Set to 0 for VERIFY_NONE, 1 for VERIFY_OPTIONAL, and 2 for
			VERIFY_REQUIRED.
	
	endmenu
	
	module = MQTT_SIMPLE
	module-str = MQTT Simple
	source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
	
	menu "GNSS sample"
	
		choice
			default GNSS_SAMPLE_MODE_CONTINUOUS
			prompt "Select GNSS operation mode"
		
		config GNSS_SAMPLE_MODE_CONTINUOUS
			bool "Continuous tracking"
		
		config GNSS_SAMPLE_MODE_PERIODIC
			bool "Periodic fixes"
		
		config GNSS_SAMPLE_MODE_TTFF_TEST
			bool "Time-to-first-fix (TTFF) test mode"
			select GNSS_SAMPLE_NMEA_ONLY
		
		endchoice
		
		if GNSS_SAMPLE_MODE_PERIODIC
		
		config GNSS_SAMPLE_PERIODIC_INTERVAL
			int "Fix interval for periodic fixes"
			range 10 65535
			default 120
			help
			  Fix interval (in seconds) for periodic fixes.
		
		config GNSS_SAMPLE_PERIODIC_TIMEOUT
			int "Fix timeout for periodic fixes"
			range 0 65535
			default 120
			help
			  Fix timeout (in seconds) for periodic fixes.
			  If set to zero, GNSS is allowed to run indefinitely until a valid PVT estimate is produced.
		
		endif # GNSS_SAMPLE_MODE_PERIODIC
		
		if GNSS_SAMPLE_MODE_TTFF_TEST
		
		config GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START
			bool "Delete GNSS data before each start (cold start)"
			help
			  When enabled, deletes all stored data from GNSS to force a cold start every time GNSS is started.
		
		config GNSS_SAMPLE_MODE_TTFF_TEST_INTERVAL
			int "Time to wait between TTFF tests in seconds"
			range 1 604800
			default 120
		
		endif # GNSS_SAMPLE_MODE_TTFF_TEST
		
		config GNSS_SAMPLE_NMEA_ONLY
			bool "Output only NMEA strings"
			help
			  Outputs only NMEA strings from the GNSS.
		
		endmenu
		
		choice
			default GNSS_SAMPLE_ASSISTANCE_NONE
			prompt "Select whether GNSS assistance is used or not"
		
		config GNSS_SAMPLE_ASSISTANCE_NONE
			bool "Assistance not used"
		
		config GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD
			bool "Use nRF Cloud A-GPS or P-GPS"
			select NRF_CLOUD_REST
			imply NRF_CLOUD_AGPS
			select MODEM_JWT
			select MODEM_INFO
			select DATE_TIME
		
		config GNSS_SAMPLE_ASSISTANCE_SUPL
			bool "Use SUPL A-GPS"
			select SUPL_CLIENT_LIB
		
		config GNSS_SAMPLE_ASSISTANCE_MINIMAL
			bool "Use factory almanac, LTE network time and MCC based location"
			select GNSS_SAMPLE_LTE_ON_DEMAND
			select SETTINGS
			select FCB
			select FLASH
			select FLASH_MAP
		
		endchoice
		
		if !GNSS_SAMPLE_ASSISTANCE_NONE
		
		config GNSS_SAMPLE_LTE_ON_DEMAND
			bool "LTE is activated only when needed to fetch A-GPS data"
			depends on !NRF_CLOUD_PGPS
			help
			  Activates LTE only when it is needed to fetch A-GPS data. This is not supported when
			  P-GPS is enabled.
		
		endif # !GNSS_SAMPLE_ASSISTANCE_NONE
		
		if GNSS_SAMPLE_ASSISTANCE_SUPL
		
		config GNSS_SAMPLE_SUPL_HOSTNAME
			string "SUPL server hostname"
			help
			  SUPL server hostname.
		
		config GNSS_SAMPLE_SUPL_PORT
			int "SUPL server port number"
			range 0 65535
			default 7276
			help
			  SUPL server port number.
		
		endif # GNSS_SAMPLE_ASSISTANCE_SUPL
		
		if GNSS_SAMPLE_MODE_CONTINUOUS
		
		choice
			default GNSS_SAMPLE_POWER_SAVING_DISABLED
			prompt "Select GNSS power saving mode (duty-cycling)"
		
		config GNSS_SAMPLE_POWER_SAVING_DISABLED
			bool "No power saving"
		
		config GNSS_SAMPLE_POWER_SAVING_MODERATE
			bool "Power saving without significant performance degradation"
		
		config GNSS_SAMPLE_POWER_SAVING_HIGH
			bool "Power saving with acceptable performance degradation"
		
		endchoice
		
		endif # GNSS_SAMPLE_MODE_CONTINUOUS
		
		config GNSS_SAMPLE_REFERENCE_LATITUDE
			string "Reference position latitude in decimal degrees"
			help
			  When set, the sample calculates the distance from the reference position for each fix.
			  Given in decimal degrees (DD), for example "61.500000".
		
		config GNSS_SAMPLE_REFERENCE_LONGITUDE
			string "Reference position longitude in decimal degrees"
			help
			  When set, the sample calculates the distance from the reference position for each fix.
			  Given in decimal degrees (DD), for example "23.800000".
		
		config GNSS_SAMPLE_LOW_ACCURACY
			bool "Allow low accuracy fixes"
			help
			  Allows fixes with lower accuracy.
		
		if GNSS_SAMPLE_ASSISTANCE_MINIMAL && GNSS_SAMPLE_LOW_ACCURACY
		
		config GNSS_SAMPLE_ASSISTANCE_REFERENCE_ALT
			int "Reference altitude for 3-sat first fix in meters"
			range -32767 32767
			default -32767
			help
			  Reference altitude for 3-sat first fix in meters above the reference ellipsoid surface.
			  The default value -32767 implies that reference altitude is not injected.
		
		endif # GNSS_SAMPLE_ASSISTANCE_MINIMAL && GNSS_SAMPLE_LOW_ACCURACY
	menu "Zephyr Kernel"
	source "Kconfig.zephyr"
	endmenu
	
	module = GNSS_SAMPLE
	module-str = GNSS sample
	source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"