Skip to content

Commit

Permalink
[beken-72xx] Enable mDNS responder, set IGMP flag on netif
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Jun 30, 2022
1 parent 0e0fe33 commit f071f57
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ Wire | ❗ | ❌
Wi-Fi STA/AP/Mixed | ✔️ | ✔️/❌/❌
Wi-Fi Events | ✔️ | ❌
TCP Client (SSL) | ✔️ (✔️) | ✔️ (❗)
TCP Server | ✔️ |
TCP Server | ✔️ | ✔️
IPv6 | ❌ | ❌
HTTP Client (SSL) | ✔️ (✔️) | ❓
HTTP Server | ✔️ |
HTTP Server | ✔️ | ✔️
NVS / Preferences | ❌ | ❌
SPIFFS | ❌ | ❌
BLE | - | ❌
NTP | ❌ | ❌
OTA | ✔️ | ❌
MDNS | ✔️ |
MDNS | ✔️ | ✔️
MQTT | ✅ | ❌
SD | ❌ | ❌

Expand Down
7 changes: 4 additions & 3 deletions arduino/libretuya/libraries/mDNS/LwIPmDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ mDNS::~mDNS() {}
bool mDNS::begin(const char *hostname) {
mdns_resp_init();
struct netif *netif = netif_list;
uint8_t enabled = 0;
while (netif != NULL) {
// TODO: detect mdns_netif_client_id by checking netif_get_client_data()
// and finding the requested hostname in struct mdns_host
if (netif_is_up(netif) && mdns_resp_add_netif(netif, hostname, 255) != ERR_OK) {
return false;
if (netif_is_up(netif) && mdns_resp_add_netif(netif, hostname, 255) == ERR_OK) {
enabled++;
}
netif = netif->next;
}
return true;
return enabled > 0;
}

void mDNS::end() {
Expand Down
4 changes: 4 additions & 0 deletions builder/frameworks/beken-72xx-sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,15 @@
"+<lwip-2.0.2/port/*.c>",
"+<lwip-2.0.2/src/api/*.c>",
"+<lwip-2.0.2/src/apps/ping/*.c>",
"+<lwip-2.0.2/src/apps/mdns/*.c>",
"+<lwip-2.0.2/src/core/*.c>",
"+<lwip-2.0.2/src/core/ipv4/*.c>",
"+<lwip-2.0.2/src/core/ipv6/*.c>",
"+<lwip-2.0.2/src/netif/ethernet.c>",
"+<dhcpd/*.c>",
# use ethernetif.c from AliOS since it enables netif IGMP flag
"-<lwip-2.0.2/port/ethernetif.c>",
"+<$SDK_DIR/beken378/alios/lwip-2.0.2/port/ethernetif.c>",
],
includes=[
"+<lwip-2.0.2/port>",
Expand Down
3 changes: 2 additions & 1 deletion platform/beken-72xx/fixups/inc/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

#include_next "lwipopts.h"

#define LWIP_MDNS_RESPONDER 1
#define LWIP_MDNS_RESPONDER 1
#define LWIP_NUM_NETIF_CLIENT_DATA 1

0 comments on commit f071f57

Please sign in to comment.