Skip to content

Commit

Permalink
all-clusters-app/esp32 remove custom mdns logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kklem0 committed Jun 19, 2021
1 parent 9de71c1 commit 5087690
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
#include <app/Command.h>
#include <app/common/gen/attribute-id.h>
#include <app/common/gen/cluster-id.h>
#include <app/server/Mdns.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/mdns/Advertiser.h>
#include <support/CodeUtils.h>

static const char * TAG = "app-devicecallbacks";
Expand All @@ -60,17 +58,6 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
case DeviceEventType::kSessionEstablished:
OnSessionEstablished(event);
break;
case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
(event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
{
// MDNS server restart on any ip assignment: if link local ipv6 is configured, that
// will not trigger a 'internet connectivity change' as there is no internet
// connectivity. MDNS still wants to refresh its listening interfaces to include the
// newly selected address.
chip::app::Mdns::StartServer();
}
break;
}

ESP_LOGI(TAG, "Current free heap: %zu\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
Expand Down Expand Up @@ -110,7 +97,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
{
ESP_LOGI(TAG, "Server ready at: %s:%d", event->InternetConnectivityChange.address, CHIP_PORT);
wifiLED.Set(true);
chip::app::Mdns::StartServer();
}
else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost)
{
Expand All @@ -120,7 +106,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)
{
ESP_LOGI(TAG, "IPv6 Server ready...");
chip::app::Mdns::StartServer();
}
else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost)
{
Expand Down

0 comments on commit 5087690

Please sign in to comment.