Skip to content

Commit 630fd1d

Browse files
authored
fix compilation errors for lock-app(enable pw rpc) and ipv6only-app with idf v4.3 (#8129)
1 parent 81f0519 commit 630fd1d

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

examples/ipv6only-app/esp32/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ set(EXTRA_COMPONENT_DIRS
2424
)
2525

2626
project(chip-ipv6only-app)
27-
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND)
27+
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND)
2828
idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND)
2929

3030
get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH)
@@ -36,3 +36,8 @@ pw_set_backend(pw_sys_io pw_sys_io.esp32)
3636
add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo)
3737
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
3838
add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io)
39+
40+
get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS)
41+
list(REMOVE_ITEM _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
42+
list(APPEND _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>)
43+
set_target_properties(pw_build.cpp17 PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}")

examples/ipv6only-app/esp32/include/gdm_wifi_service.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class GDMWifiBase final : public generated::GDMWifiBase<GDMWifiBase>
5858
pw::Status GetSsid(ServerContext &, const chip_rpc_Empty & request, chip_rpc_Ssid & response)
5959
{
6060
wifi_config_t config;
61-
PW_TRY(EspToPwStatus(esp_wifi_get_config(ESP_IF_WIFI_STA, &config)));
61+
PW_TRY(EspToPwStatus(esp_wifi_get_config(WIFI_IF_STA, &config)));
6262
size_t size = std::min(sizeof(response.ssid.bytes), sizeof(config.sta.ssid));
6363
memcpy(response.ssid.bytes, config.sta.ssid, sizeof(response.ssid.bytes));
6464
response.ssid.size = size;
@@ -77,7 +77,7 @@ class GDMWifiBase final : public generated::GDMWifiBase<GDMWifiBase>
7777
pw::Status GetMacAddress(ServerContext &, const chip_rpc_Empty & request, chip_rpc_MacAddress & response)
7878
{
7979
uint8_t mac[6];
80-
PW_TRY(EspToPwStatus(esp_wifi_get_mac(ESP_IF_WIFI_STA, mac)));
80+
PW_TRY(EspToPwStatus(esp_wifi_get_mac(WIFI_IF_STA, mac)));
8181
sprintf(response.mac_address, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
8282
return pw::OkStatus();
8383
}

examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pw::Status GDMWifiBase::Connect(ServerContext &, const chip_rpc_ConnectionData &
241241
std::min(sizeof(wifi_config.sta.password), static_cast<size_t>(request.secret.size)));
242242

243243
WifiConnectionEventHandler event_handler(esp_netif_);
244-
PW_TRY(EspToPwStatus(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)));
244+
PW_TRY(EspToPwStatus(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)));
245245
esp_err_t err = esp_wifi_connect();
246246

247247
if (ESP_ERR_WIFI_SSID == err)

examples/lock-app/esp32/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ pw_set_backend(pw_sys_io pw_sys_io.esp32)
4242
add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo)
4343
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
4444
add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io)
45+
46+
get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS)
47+
list(REMOVE_ITEM _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
48+
list(APPEND _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>)
49+
set_target_properties(pw_build.cpp17 PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}")
4550
endif(CONFIG_ENABLE_PW_RPC)

examples/lock-app/esp32/main/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ idf_component_register(INCLUDE_DIRS
7070
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
7171
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
7272
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
73+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server"
7374
PRIV_REQUIRES bt chip QRCode tft spidriver screen-framework)
7475

7576
idf_component_get_property(chip_lib chip COMPONENT_LIB)

examples/lock-app/esp32/main/Kconfig.projbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ menu "Demo"
6464
endmenu
6565

6666
menu "PW RPC Debug channel"
67+
depends on ENABLE_PW_RPC
6768
config EXAMPLE_UART_PORT_NUM
6869
int "UART port number"
6970
range 0 2 if IDF_TARGET_ESP32

0 commit comments

Comments
 (0)