menu "Controller"

config CONTROLLER_REMOTE_VALVE_DELAY
	int "The amount of time between remote valve operations"
	default 14400000
	help
	  The amount of time in ms to wait after the remote valve
	  has changed until it can be operated again

config CONTROLLER_TIMESYNC_ENABLED
	bool "Use time sync"
	default n
	help
	  Use timesync functionality

config CONTROLLER_SLICES
	int "Number of slices containing Rx/Tx"
	default 6
	help
	  The number of slices or sub loops containing Tx/Rx periods

config CONTROLLER_TRACEIVER_NO_COMM_CYCLES
	int "Number of cycles which can go without communication"
	default 4320
	help
	  The number of cycles which the controller and transceiver
	  can go without communication before the controller needs to
	  indicate that there is no communication

config CONTROLLER_RX_TIME
	int "Period to spend receiving"
	default 19000
	help
	  The period to spend in receive mode

config CONTROLLER_TX_TIME
	int "Period to spend transmitting"
	default 1000
	help
	  The period to spend in transmit mode

config CONTROLLER_RX_COUNT
	int "Number of receives allowed in major loop"
	default 6
	range 0 CONTROLLER_SLICES
	help
	  The number of time periods allowed for receiving

config CONTROLLER_TX_COUNT
	int "Number of transmits allowed in major loop"
	default 2
	range 0 CONTROLLER_SLICES
	help
		The number of time periods allowed for transmitting

config CONTROLLER_TX_SPACE
	bool "Space transmits"
	default y
	help
	  Space out transmits over major loop instead of having them all at the first part

config CONTROLLER_RX_SPACE
	bool "Space receives"
	default y
	help
	  Space out receive over major loop instead of having them all at the first part

endmenu

menu "Transceiver"
config TRANSCEIVER_HEARTBEAT_COUNT
	int "Number of transceiver heartbeats"
	default 3
	help
	  Number of heartbeats sent from the transceiver at a time

config TRANSCEIVER_RX_SLOT
	int "RX slot to use"
	default 3
	help
	  The Receive slot to use on the transceiver when sending / receiving

config TRANSCEIVER_INTERVAL
	int "Transceiver interval"
	default 20000
	help
	  The length of the transceivers interval in milliseconds

config TRANSCEIVER_RADIO_POWER
	int "Power output of radio in dB"
	default 22
	help
	  The power output of the radio in dB used for transmit and receive

config TRANSCEIVER_SLEEP
	int "Transceiver sleep"
	default 720
	help
	  The number of intervals to sleep before waking up for a heartbeat

endmenu

menu "FOTA"

config FOTA_FILENAME_MAX
	int "Max filename length"
	default 128
	help
	  The maximum filename length for a firmware image

config FOTA_DOWNLOAD_HOST
	string "The location to download the firmware"
	default "h2of.io"
	help
	  The location to download the firmware images from for
	  firmware updates

config FOTA_USE_HTTPS
	bool "Use HTTPS for download"
	default y
	help
	   Use HTTPS for firmware downloads


rsource "lib/download_client/Kconfig"
rsource "lib/fota_download/Kconfig"

module = FOTA
module-dep = LOG
module-str = Log level for FOTA module
module-help = Sets log level for FOTA Module.
source "subsys/net/Kconfig.template.log_config.net"

endmenu

menu "Zone Controller"

config ZONE_CONTROLLER_ALERT_CATASTROPHIC_DELAY
	int "Catastrophic alerts delay"
	default 14400000
	help
	  Zone controller delay between sending catastrophic alerts

config ZONE_CONTROLLER_FAULT_DELAY
	int "Delay after a fault before we can return to normal"
	default 3600000
	help
	  The delay after a fault occurs which we have to stay
	  in a faulted state before returning to normal mode

config ZONE_CONTROLLER_LEARN_CYCLES
	int "Zone controller learn cycles"
	default 2
	help
	  The number of learn cycles

config ZONE_CONTROLLER_IGNORE_VALUES
	int "Zone controller ignore values"
	default 2
	help
	  The number of values to ignore before recording

config ZONE_CONTROLLER_OVERFLOW_LIMIT
	int "Zone controller overflow limit"
	default 3
	help
	  The number of overflow values before sending an alert

config ZONE_CONTROLLER_UNDERFLOW_LIMIT
	int "Zone controller underflow limit"
	default 3
	help
	  The number of underflow values before sending an alert

config ZONE_CONTROLLER_MAX_MARGIN
	int "Maximum flow which indicates overflow"
	default 20
	help
	  The maximum flow which counts as overflow

config ZONE_CONTROLLER_MIN_MARGIN
	int "Minimum flow which indicates underflow"
	default 20
	help
	  The minimum flow which counts as underflow


config ZONE_CONTROLLER_DETECT_STACK_SIZE
	int "Zone controller detect thread state size"
	default 2048
	help
	  Zone controller detect thread state size

config ZONE_CONTROLLER_DETECT_CHANNELS
	int "Number of detect channels"
	default 32
	help
	  Zone controller detect channels

config ZONE_CONTROLLER_ACTIVATE_CHANNELS
	int "Number of activation channels"
	default 32
	help
	  Zone controller activate channels

config ZONE_CONTROLLER_DETECT_INTERVAL
	int "Number of milliseconds between detection polls"
	default 250
	help
	  The number of milliseconds between polls to the
	  zone controller detect circuit

config ZONE_CONTROLLER_OVERFLOW_FAULT
	int "Number of zones which can overflow before a fault occurs"
	default 2
	help
	  The number of zones which can overflow before the system has a
	  fault and enters fault mode
config PISO_CLK_PIN
	int "Parallel in serial out clock pin"
	default 4
	help
	  Parallel in serial out clock pin

config PISO_CLK_INH_PIN
	int "Parallel in serial out clock Inhibit pin"
	default 3
	help
	  Parallel in serial out clock Inhibit pin

config PISO_LOAD_SHIFT_PIN
	int "Parallel in serial out load_bar/shift pin"
	default 5
	help
	  Parallel in serial out load_bar/shift pin

config PISO_OUT_PIN
	int "Parallel in serial out output pin"
	default 0
	help
	  Parallel in serial out output pin

config PISO_OE_PIN
	int "Parallel in serial out output enable pin"
	default 7
	help
	  Parallel in serial out output enable pin
config PISO_CLR_PIN
	int "Parallel in serial out clear pin"
	default 8
	help
	  Parallel in serial out clear pin

config SIPO_SER_PIN
	int "Serial in parallel out serial input pin"
	default 6
	help
	  Serial in parallel out serial input pin

config SIPO_STO_CLK_PIN
	int "Serial In parallel out latch pin"
	default 2
	help
	  Serial In parallel out latch pin

config SIPO_SRCLK_PIN
	int "Serial in parallel out shift register clock pin"
	default 1
	help
	  Serial in parallel out shift register clock pin

module = ZONE_CONTROLLER
module-dep = LOG
module-str = Log level for Zone controller module
module-help = Sets log level for Zone controller Module.
source "subsys/net/Kconfig.template.log_config.net"

endmenu

menu "Repository"
config REPOSITORY_STACK_SIZE
	int "Repository in stack size"
	default 5196
	help
	  The size of the repository thread stack

config REPOSITORY_HOSTNAME
	string "Repository hostname"
	default "h2of.io"
	help
	   The target hostname of the repository
	   
config REPOSITORY_SSL_PORT
	int "Secure Repository port"
	default 443
	help
	  The repository HTTPS port to use

config REPOSITORY_PORT
	int "Repository port"
	default 80
	help
	  The repository HTTP port to use

config REPOSITORY_PATH_LENGTH
	int "Length of the built path for repository"
	default 128
	help
	  The length of the paths for sending and
	  receiving to and from the repository

config REPOSITORY_MESSAGE_COUNT
	int "Number of messsages that can be queued"
	default 16
	help
	   The number of messages for both incoming and
	   outgoing message queues

config REPOSITORY_BUFFER_SIZE
	int "Number of bytes for receive buffer"
	default 4096
	help
	  The size of the buffer to send / receive messages

config REPOSITORY_RESPONSE_TIME
	int "The number of ms to wait before doing something"
	default 1000
	help
	   The amount of time to wait between sending or receiving messages

config REPOSITORY_MESSAGE_WAIT_TIME
	int "The amount of time to wait for a message"
	default 50
	help
	  The amount of time to wait for a message from the queue before assuming there is none

config REPOSITORY_SEND_WAIT_TIME
	int "The amount of time to wait on sending a HTTP message"
	default 5000
	help
	  The amount of time in ms to wait for an outgoing HTTP request

config REPOSITORY_INITIAL_COMMAND_REQUEST_INTERVAL
	int "The initial delay before requesting a command"
	default 5000
	help
	  The initial delay before requesting a command in ms

config REPOSITORY_MAX_COMMAND_REQUEST_INTERVAL
	int "The maximum delay before requesting a command"
	default 240000
	help
	   The maximum delay before requesting a command in ms, this is only used when using LTE

module = REPOSITORY
module-dep = LOG
module-str = Log level for Repository module
module-help = Sets log level for Repository Module.
source "subsys/net/Kconfig.template.log_config.net"

endmenu

menu "Ethernet"

config ETH_DNS_TIMEOUT
	int "Time in ms to allow waiting for DNS"
	default 5000
	help
	  The maximum allowable time in ms to wait for DNS over Ethernet

module = ETH
module-dep = LOG
module-str = Log level for Eth module
module-help = Sets log level for Eth Module.
source "subsys/net/Kconfig.template.log_config.net"
endmenu

menu "Radio"
config RADIO_POWER_PIN
	int "Pin to use to turn the radio on and off"
	default 9
	help
	  The pin used to flip the switch for controlling
	  power to the radio

config RADIO_ERROR_LIMIT
	int "Number of errors that can occur before reset"
	default 5
	help
	  The number of errors which can occur before we consider
	  the radio to be in an errored state and reset it.



orsource "lib/lora_e5/Kconfig"
endmenu

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

