提交 9e4b3681 编写于 作者: D Damien George

stm32: Support optional lwIP mDNS responder.

上级 49388e33
......@@ -39,6 +39,7 @@
#if MICROPY_PY_LWIP
#include "lwip/init.h"
#include "lwip/apps/mdns.h"
#include "drivers/cyw43/cyw43.h"
#endif
......@@ -479,6 +480,9 @@ void stm32_main(uint32_t reset_mode) {
// because the system timeout list (next_timeout) is only ever reset by BSS clearing.
// So for now we only init the lwIP stack once on power-up.
lwip_init();
#if LWIP_MDNS_RESPONDER
mdns_resp_init();
#endif
systick_enable_dispatch(SYSTICK_DISPATCH_LWIP, mod_network_lwip_poll_wrapper);
#endif
......
......@@ -44,6 +44,7 @@
#include "lwip/timeouts.h"
#include "lwip/dns.h"
#include "lwip/dhcp.h"
#include "lwip/apps/mdns.h"
#include "extmod/network_cyw43.h"
#include "drivers/cyw43/cyw43.h"
......@@ -188,6 +189,10 @@ mp_obj_t mod_network_nic_ifconfig(struct netif *netif, size_t n_args, const mp_o
mp_hal_delay_ms(100);
}
#if LWIP_MDNS_RESPONDER
mdns_resp_netif_settings_changed(netif);
#endif
return mp_const_none;
} else {
// Release and stop any existing DHCP
......@@ -202,6 +207,9 @@ mp_obj_t mod_network_nic_ifconfig(struct netif *netif, size_t n_args, const mp_o
ip_addr_t dns;
netutils_parse_ipv4_addr(items[3], (uint8_t*)&dns, NETUTILS_BIG);
dns_setserver(0, &dns);
#if LWIP_MDNS_RESPONDER
mdns_resp_netif_settings_changed(netif);
#endif
return mp_const_none;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册