1# Copyright (c) 2020 Linumiz
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig HAWKBIT
5	bool "Eclipse hawkBit Firmware Over-the-Air support"
6	depends on SETTINGS
7	depends on FLASH
8	depends on REBOOT
9	depends on NET_TCP
10	depends on NET_SOCKETS
11	depends on IMG_MANAGER
12	depends on NETWORKING
13	depends on HTTP_CLIENT
14	depends on DNS_RESOLVER
15	depends on JSON_LIBRARY
16	depends on BOOTLOADER_MCUBOOT
17	depends on SMF
18	depends on SMF_ANCESTOR_SUPPORT
19	select MPU_ALLOW_FLASH_WRITE
20	select IMG_ENABLE_IMAGE_CHECK
21	select IMG_ERASE_PROGRESSIVELY
22	imply HWINFO if !HAWKBIT_CUSTOM_DEVICE_ID
23	help
24	  hawkBit is a domain independent back-end framework for polling out
25	  software updates to constrained edge devices as well as more powerful
26	  controllers and gateways connected to IP based networking infrastructure.
27
28if HAWKBIT
29config HAWKBIT_POLL_INTERVAL
30	int "Time to poll interval (in minutes)"
31	default 5
32	range 1 43200
33	help
34	  Set the interval that the hawkbit update server will be polled.
35	  This time interval is zero and 43200 minutes(30 days). This will be overridden
36	  by the value configured in the settings of the hawkBit server.
37
38config HAWKBIT_AUTOHANDLER
39	bool "hawkBit autohandler"
40	select EVENTS
41	default y
42	help
43	  Activate autohandler to handle the update process automatically.
44
45config HAWKBIT_SHELL
46	bool "hawkBit shell utilities"
47	depends on SHELL
48	depends on HAWKBIT_AUTOHANDLER
49	help
50	  Activate shell module that provides hawkBit commands.
51
52config HAWKBIT_TENANT
53	string "Tenant name for the hawkbit server"
54	default "default"
55	help
56	  Configure the tenant name for the hawkbit server.
57
58config HAWKBIT_SERVER
59	string "User address for the hawkbit server"
60	help
61	  Configure the hawkbit server address.
62
63config HAWKBIT_PORT
64	int "Port number for the hawkbit server"
65	default 8080
66	help
67	  Configure the hawkbit port number.
68
69config HAWKBIT_SET_SETTINGS_RUNTIME
70	bool "Set hawkbit settings at runtime"
71	help
72	  Enable to set hawkbit settings at runtime.
73
74choice HAWKBIT_DDI_SECURITY
75	prompt "hawkBit DDI API authentication modes"
76	default HAWKBIT_DDI_NO_SECURITY
77
78config HAWKBIT_DDI_NO_SECURITY
79	bool "No authentication security"
80	help
81	  No authentication security for the hawkBit DDI API.
82
83config HAWKBIT_DDI_TARGET_SECURITY
84	bool "Use target security token authentication"
85	help
86	  Use target security token authentication for the hawkBit DDI API.
87
88config HAWKBIT_DDI_GATEWAY_SECURITY
89	bool "Use gateway security token authentication"
90	help
91	  Use gateway security token authentication for the hawkBit DDI API.
92
93endchoice
94
95config HAWKBIT_DDI_SECURITY_TOKEN
96	string "Authentication security token"
97	depends on HAWKBIT_DDI_TARGET_SECURITY || HAWKBIT_DDI_GATEWAY_SECURITY
98	default ""
99	help
100	  Authentication security token for the configured hawkBit DDI
101	  authentication mode.
102
103config HAWKBIT_CUSTOM_ATTRIBUTES
104	bool "Custom device attributes"
105	help
106	  Use custom definition of device attributes.
107
108config HAWKBIT_STATUS_BUFFER_SIZE
109	int "hawkBit status buffer size"
110	default 200
111	help
112	  Set the size of the buffer, which is used to store the
113	  json strings, that are sent to the hawkBit server. It might
114	  be increased if the custom attributes are used extensively.
115
116config HAWKBIT_CUSTOM_DEVICE_ID
117	bool "Custom device id through callback function"
118	help
119	  Be able to customize the device id during runtime to a custom value,
120	  by configuring the callback function. See `hawkbit_set_device_identity_cb`
121
122config HAWKBIT_DEVICE_ID_MAX_LENGTH
123	int "Maximum length of the device id"
124	depends on HAWKBIT_CUSTOM_DEVICE_ID
125	range 1 128
126	default 32
127	help
128	  Maximum length of the device id.
129
130config HAWKBIT_USE_TLS
131	bool "Use TLS for hawkBit server connection"
132	depends on NET_SOCKETS_SOCKOPT_TLS
133	help
134	  Use TLS for hawkBit connection.
135
136if HAWKBIT_USE_TLS
137
138choice HAWKBIT_CERT_TAG
139	prompt "hawkBit certificate tag"
140	default HAWKBIT_USE_STATIC_CERT_TAG
141
142config HAWKBIT_USE_STATIC_CERT_TAG
143	bool "Use static certificate tag"
144	help
145	  Use static certificate tag for TLS connection to the hawkBit server.
146
147config HAWKBIT_USE_DYNAMIC_CERT_TAG
148	bool "Use dynamic certificate tag"
149	depends on HAWKBIT_SET_SETTINGS_RUNTIME
150	help
151	  Use dynamic certificate tag for TLS connection to the hawkBit server.
152
153endchoice
154
155config HAWKBIT_STATIC_CERT_TAG
156	int "Static certificate tag"
157	depends on HAWKBIT_USE_STATIC_CERT_TAG
158	default 1
159	help
160	  Static certificate tag for TLS connection to the hawkBit server.
161
162endif
163
164choice HAWKBIT_REBOOT_MODE
165	prompt "Reboot mode after update"
166	default HAWKBIT_REBOOT_WARM
167
168config HAWKBIT_REBOOT_WARM
169	bool "Warm reboot after update"
170	help
171	  Do a warm reboot after the update.
172
173config HAWKBIT_REBOOT_COLD
174	bool "Cold reboot after update"
175	help
176	  Do a cold reboot after the update.
177
178endchoice
179
180config HEAP_MEM_POOL_ADD_SIZE_HAWKBIT
181	int "Heap memory pool size for hawkBit"
182	default 4096
183	help
184	  Set the size of the heap memory pool for hawkBit.
185
186config HAWKBIT_EVENT_CALLBACKS
187	bool "Set hawkBit event callbacks"
188	help
189	  Be able to set event callbacks for hawkBit.
190
191module = HAWKBIT
192module-str = Log Level for hawkbit
193module-help = Enables logging for hawkBit code.
194source "subsys/logging/Kconfig.template.log_config"
195
196endif
197