static void setup_dhcpv4(struct net_if *iface) { NET_INFO("Running dhcpv4 client..."); net_mgmt_init_event_callback(&mgmt_cb, ipv4_addr_add_handler, NET_EVENT_IPV4_ADDR_ADD); net_mgmt_add_event_callback(&mgmt_cb); net_dhcpv4_start(iface); }
static inline void init_app(void) { struct net_if *iface; NET_INFO("Run dhcpv4 client"); iface = net_if_get_default(); net_dhcpv4_start(iface); k_sem_init(&quit_lock, 0, UINT_MAX); net_mgmt_init_event_callback(&mgmt_cb, handler, NET_EVENT_IPV4_ADDR_ADD); net_mgmt_add_event_callback(&mgmt_cb); }