# Copyright (c) 2026 iscatek
# SPDX-License-Identifier: Apache-2.0

menu "MBDK2 demo settings"

config MBDK2_DEMO_SERVER_ADDR
	string "UDP server IP address"
	default "192.0.2.1"
	help
	  IPv4 address the readings are sent to. The default is a
	  documentation address (TEST-NET-1) and must be changed to a real
	  server before uploads will go anywhere.

config MBDK2_DEMO_SERVER_PORT
	int "UDP server port number"
	default 2469
	help
	  UDP port the readings are sent to.

config MBDK2_DEMO_TEMP_POLL_INTERVAL_SECONDS
	int "Temperature read interval in seconds"
	default 10
	help
	  How often the TMP1075 is sampled. Each sample is timestamped and
	  stored in the external flash queue.

config MBDK2_DEMO_UPLOAD_INTERVAL_MINUTES
	int "Periodic UDP upload interval in minutes"
	default 1
	help
	  How often queued readings are uploaded. Pressing the user button
	  triggers an immediate upload as well.

config MBDK2_DEMO_MAX_PENDING_READINGS
	int "Flash-backed queue slots for readings awaiting upload"
	default 64
	help
	  Number of reading slots reserved in flash for the upload queue.
	  Once full, the oldest unsent reading is overwritten to make room
	  for the newest. Changing this value changes the on-flash layout;
	  the firmware detects that on boot and restarts with an empty
	  queue (previously stored readings are discarded).

config MBDK2_DEMO_MAX_READINGS_PER_UPLOAD
	int "Maximum readings sent per upload cycle"
	default 64
	range 1 MBDK2_DEMO_MAX_PENDING_READINGS
	help
	  Caps how many queued readings one upload cycle will send. The
	  cycle splits them across as many MTU-sized UDP datagrams as
	  needed. Readings beyond this cap stay queued for the next cycle.

choice MBDK2_DEMO_UPLOAD_FORMAT
	prompt "Upload payload format"
	default MBDK2_DEMO_UPLOAD_FORMAT_JSON

config MBDK2_DEMO_UPLOAD_FORMAT_JSON
	bool "JSON array"
	help
	  Each datagram is a JSON array of readings, each formatted as
	  {"temp_c":<decimal>,"ts_s":<unix seconds>}.

config MBDK2_DEMO_UPLOAD_FORMAT_BINARY
	bool "Packed binary records"
	help
	  Each datagram is a sequence of fixed 8-byte little-endian
	  records: int32_t timestamp_s (Unix seconds, UTC) followed by
	  int32_t temp_millideg (temperature in thousandths of a degree
	  C), back to back with no framing.

endchoice

endmenu

module = MBDK2_DEMO
module-str = MBDK2 demo
source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config"

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