mgmt: hawkbit: change Kconfig port to int
Ports set by Kconfig are mostly defined
as a int. This changes it for hawkbit too.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
diff --git a/subsys/mgmt/hawkbit/Kconfig b/subsys/mgmt/hawkbit/Kconfig
index 2546c0d..10b63d0 100644
--- a/subsys/mgmt/hawkbit/Kconfig
+++ b/subsys/mgmt/hawkbit/Kconfig
@@ -45,8 +45,8 @@
Configure the hawkbit server address.
config HAWKBIT_PORT
- string "Port address for the hawkbit server"
- default "8080"
+ int "Port number for the hawkbit server"
+ default 8080
help
Configure the hawkbit port number.
diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c
index 1171f59..d2f42d0 100644
--- a/subsys/mgmt/hawkbit/hawkbit.c
+++ b/subsys/mgmt/hawkbit/hawkbit.c
@@ -241,7 +241,8 @@
}
while (resolve_attempts--) {
- ret = zsock_getaddrinfo(CONFIG_HAWKBIT_SERVER, CONFIG_HAWKBIT_PORT, &hints, &addr);
+ ret = zsock_getaddrinfo(CONFIG_HAWKBIT_SERVER, STRINGIFY(CONFIG_HAWKBIT_PORT),
+ &hints, &addr);
if (ret == 0) {
break;
}
@@ -842,7 +843,7 @@
hb_context.http_req.url = hb_context.url_buffer;
hb_context.http_req.method = method;
hb_context.http_req.host = CONFIG_HAWKBIT_SERVER;
- hb_context.http_req.port = CONFIG_HAWKBIT_PORT;
+ hb_context.http_req.port = STRINGIFY(CONFIG_HAWKBIT_PORT);
hb_context.http_req.protocol = "HTTP/1.1";
hb_context.http_req.response = response_cb;
hb_context.http_req.recv_buf = hb_context.recv_buf_tcp;