1#
2# Copyright (c) 2024, Jamie McCrae
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7# The Kconfig file is dedicated to the LoRaWAN transport of MCUmgr
8# subsystem and provides Kconfig options to control aspects of
9# the transport.
10#
11# Options defined in this file should be prefixed:
12#  MCUMGR_TRANSPORT_LORAWAN_
13
14menuconfig MCUMGR_TRANSPORT_LORAWAN
15	bool "LoRaWAN MCUmgr SMP transport"
16	depends on LORAWAN
17	help
18	  Enables handling of SMP commands received over LoRaWAN.
19
20if MCUMGR_TRANSPORT_LORAWAN
21
22config MCUMGR_TRANSPORT_LORAWAN_FRAME_PORT
23	int "LoRaWAN SMP frame port"
24	range 1 223
25	default 2
26	help
27	  LoRaWAN download and uplink frame port used for communication. All messages received on
28	  this port will be treated as SMP packets.
29
30config MCUMGR_TRANSPORT_LORAWAN_CONFIRMED_UPLINKS
31	bool "Use confirmed packets for uplinks"
32	default y
33	help
34	  Will use confirmed uplink packets for responses if enabled, otherwise will use
35	  unconfirmed packets.
36
37config MCUMGR_TRANSPORT_LORAWAN_REASSEMBLY
38	bool "Reassemble LoRaWAN SMP messages"
39	select MCUMGR_TRANSPORT_REASSEMBLY
40	default y
41	help
42	  Will reassemble downlink LoRaWAN messages together to allow for messages larger than a
43	  single message to be received, otherwise will support messages up to a single packet in
44	  size.
45
46menuconfig MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA
47	bool "Send empty packet if partial packet received"
48	depends on MCUMGR_TRANSPORT_LORAWAN_REASSEMBLY
49	default y
50	help
51	  Will send an empty packet if a partial (fragmented) message has been received from the
52	  server, this will allow the next packet to be received without waiting for next
53	  transmission window.
54
55	  Note: this requires a dedicated thread in order to prevent blocking the system workqueue.
56
57if MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA
58
59config MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA_STACK_SIZE
60	int "Poll thread stack size"
61	default 1800
62	help
63	  Stack size of the thread that will poll for empty additional packets when a partial
64	  frame is received.
65
66config MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA_THREAD_PRIORITY
67	int "Poll thread priority"
68	default 3
69	help
70	  Priority of the thread for polling for empty additional packets when a partial frame
71	  is received.
72
73config MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA_RETRIES
74	int "Poll thread retries"
75	default 3
76	help
77	  Number of LoRaWAN message send retries if sending fails for the thread for polling for
78	  empty additional packets when a partial frame is received.
79
80endif # MCUMGR_TRANSPORT_LORAWAN_POLL_FOR_DATA
81
82config MCUMGR_TRANSPORT_LORAWAN_FRAGMENTED_UPLINKS
83	bool "Fragment uplink messages"
84	default y
85	help
86	  Will fragment messages into multiple uplink messages if they are too big to fit into a
87	  single uplink message. If disabled then uplinks that are too large will not be sent.
88
89module = MCUMGR_TRANSPORT_LORAWAN
90module-str = LoRaWAN MCUmgr SMP transport
91source "subsys/logging/Kconfig.template.log_config"
92
93endif # MCUMGR_TRANSPORT_LORAWAN
94