Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP: Enable Wi-Fi and Ethernet coexisting and add platform mdns for Ethernet #32428

Merged
merged 9 commits into from
Mar 28, 2024
Prev Previous commit
Restyled by clang-format
restyled-commits authored and wqx6 committed Mar 28, 2024
commit 8c34244a6751157c573602c5f519a88ace9617e5
12 changes: 7 additions & 5 deletions src/platform/ESP32/ESP32DnssdImpl.cpp
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ CHIP_ERROR EspDnssdRemoveServices()
return CHIP_NO_ERROR;
}

static Inet::InterfaceId GetServiceInterfaceId(esp_netif_t *esp_netif)
static Inet::InterfaceId GetServiceInterfaceId(esp_netif_t * esp_netif)
{
if (!esp_netif)
{
@@ -347,8 +347,9 @@ static CHIP_ERROR OnBrowseDone(BrowseContext * ctx)
ctx->mService[servicesIndex].mTextEntrySize = currentResult->txt_count;
ctx->mService[servicesIndex].mSubTypes = NULL;
ctx->mService[servicesIndex].mSubTypeSize = 0;
ctx->mService[servicesIndex].mInterface = ctx->mInterfaceId != chip::Inet::InterfaceId::Null() ?
ctx->mInterfaceId : GetServiceInterfaceId(currentResult->esp_netif);
ctx->mService[servicesIndex].mInterface = ctx->mInterfaceId != chip::Inet::InterfaceId::Null()
? ctx->mInterfaceId
: GetServiceInterfaceId(currentResult->esp_netif);
if (currentResult->addr)
{
Inet::IPAddress IPAddr;
@@ -425,8 +426,9 @@ static CHIP_ERROR ParseSrvResult(ResolveContext * ctx)
ctx->mService->mPort = ctx->mSrvQueryResult->port;
ctx->mService->mSubTypes = nullptr;
ctx->mService->mSubTypeSize = 0;
ctx->mService->mInterface = ctx->mInterfaceId != chip::Inet::InterfaceId::Null() ?
ctx->mInterfaceId : GetServiceInterfaceId(ctx->mSrvQueryResult->esp_netif);
ctx->mService->mInterface = ctx->mInterfaceId != chip::Inet::InterfaceId::Null()
? ctx->mInterfaceId
: GetServiceInterfaceId(ctx->mSrvQueryResult->esp_netif);
return CHIP_NO_ERROR;
}
else