示例#1
0
文件: telnet.c 项目: rsalveti/zephyr
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);
}
示例#2
0
文件: main.c 项目: sunkaizhu/zephyr
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);
}