Skip to content

Commit

Permalink
mgmt: hawkbit: samples: use net config settings
Browse files Browse the repository at this point in the history
use net config setting and `CONFIG_NET_CONFIG_NEED_IPV4`
to get dhcpv4  address.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg authored and aescolar committed May 1, 2024
1 parent cbd9b37 commit 5176324
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 73 deletions.
4 changes: 1 addition & 3 deletions samples/subsys/mgmt/hawkbit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ set(KCONFIG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/Kconfig)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hawkbit)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
target_sources_ifdef(CONFIG_NET_DHCPV4 app PRIVATE src/dhcp.c)
target_sources(app PRIVATE src/main.c)

include(${ZEPHYR_BASE}/samples/net/common/common.cmake)

Expand Down
3 changes: 3 additions & 0 deletions samples/subsys/mgmt/hawkbit/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_NEED_IPV4=y

CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=n

Expand Down
54 changes: 0 additions & 54 deletions samples/subsys/mgmt/hawkbit/src/dhcp.c

This file was deleted.

12 changes: 0 additions & 12 deletions samples/subsys/mgmt/hawkbit/src/dhcp.h

This file was deleted.

4 changes: 0 additions & 4 deletions samples/subsys/mgmt/hawkbit/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <zephyr/logging/log.h>
#include <zephyr/data/json.h>

#include "dhcp.h"

#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
#include <zephyr/net/tls_credentials.h>
#include "ca_certificate.h"
Expand Down Expand Up @@ -62,8 +60,6 @@ int main(void)
LOG_INF("hawkBit sample app started");
LOG_INF("Image build time: " __DATE__ " " __TIME__);

app_dhcpv4_startup();

#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
tls_credential_add(CA_CERTIFICATE_TAG, TLS_CREDENTIAL_CA_CERTIFICATE,
ca_certificate, sizeof(ca_certificate));
Expand Down

0 comments on commit 5176324

Please sign in to comment.