Skip to content

Commit

Permalink
ESP32: Add multiple interface for ESP32-C6 on all-clusters-app
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed May 18, 2023
1 parent 5f1a60b commit 7c2e317
Show file tree
Hide file tree
Showing 19 changed files with 906 additions and 620 deletions.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ static void InitServer(intptr_t context)
{
Esp32AppServer::Init(&sCallbacks); // Init ZCL Data Model and CHIP App Server AND Initialize device attestation config

#if !(CHIP_DEVICE_CONFIG_ENABLE_WIFI && CHIP_DEVICE_CONFIG_ENABLE_THREAD)
// We only have network commissioning on endpoint 0.
emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false);
#endif

CHIP_ERROR err = GetAppTask().LockInit();
if (err != CHIP_NO_ERROR)
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/partitions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
nvs, data, nvs, , 0x6000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
ota_0, app, ota_0, , 1700K,
ota_1, app, ota_1, , 1700K,
ota_0, app, ota_0, , 1900K,
ota_1, app, ota_1, , 1900K,
ot_storage, data, 0x3a, , 0x2000,
7 changes: 6 additions & 1 deletion examples/platform/esp32/common/Esp32AppServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ static constexpr char TAG[] = "ESP32Appserver";

namespace {
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
constexpr chip::EndpointId kNetworkCommissioningEndpointWiFi = 0xFFFE;
#else
constexpr chip::EndpointId kNetworkCommissioningEndpointWiFi = 0;
#endif
app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointWiFi, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
#elif CHIP_DEVICE_CONFIG_ENABLE_ETHERNET
static app::Clusters::NetworkCommissioning::Instance
sEthernetNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPEthernetDriver::GetInstance()));
Expand Down
15 changes: 12 additions & 3 deletions src/platform/ESP32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,18 @@ static_library("ESP32") {
]
if (chip_mdns == "platform") {
sources += [
"DnssdImpl.cpp",
"DnssdImpl.h",
"WiFiDnssdImpl.cpp",
"WiFiDnssdImpl.h",
]
}
}

if (chip_mdns == "platform") {
sources += [ "DnssdImpl.cpp" ]
}

if (chip_enable_openthread) {
sources += [
"../OpenThread/DnssdImpl.cpp",
"../OpenThread/GenericNetworkCommissioningThreadDriver.cpp",
"../OpenThread/GenericNetworkCommissioningThreadDriver.h",
"../OpenThread/OpenThreadUtils.cpp",
Expand All @@ -143,6 +146,12 @@ static_library("ESP32") {
"ThreadStackManagerImpl.cpp",
"ThreadStackManagerImpl.h",
]
if (chip_mdns == "platform") {
sources += [
"../OpenThread/OpenThreadDnssdImpl.cpp",
"../OpenThread/OpenThreadDnssdImpl.h",
]
}
configs -= [ "${chip_root}/build/config/compiler:warnings_default" ]
}

Expand Down
Loading

0 comments on commit 7c2e317

Please sign in to comment.