Skip to content

Commit

Permalink
Merge branch 'master' into support_android_multiple_fabricid
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo authored Aug 23, 2022
2 parents 7284c79 + fa24ab6 commit 344d16a
Show file tree
Hide file tree
Showing 107 changed files with 790 additions and 402 deletions.
12 changes: 9 additions & 3 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ endif()

include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQURIE_COMPONENTS freertos lwip bt mdns mbedtls fatfs app_update console openthread)
set(CHIP_REQURIE_COMPONENTS freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash)

if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQURIE_COMPONENTS mdns)
endif()

if (NOT CMAKE_BUILD_EARLY_EXPANSION)
if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE)
Expand Down Expand Up @@ -270,7 +274,9 @@ if(CONFIG_BT_ENABLED)
idf_component_get_property(bt_lib bt COMPONENT_LIB)
idf_component_get_property(bt_dir bt COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/libcontroller_5p0_seq.a)
if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2)
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a)
endif()
else()
idf_component_get_property(bt_lib bt COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}> -lbtdm_app)
Expand All @@ -287,7 +293,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
list(APPEND chip_libraries $<TARGET_FILE:${openthread_lib}>)
endif()

if(NOT CONFIG_USE_MINIMAL_MDNS)
if(NOT CONFIG_USE_MINIMAL_MDNS AND NOT CONFIG_IDF_TARGET_ESP32H2)
idf_component_get_property(mdns_lib mdns COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
endif()
Expand Down
1 change: 1 addition & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ menu "CHIP Device Layer"
menu "WiFi AP Options"

config ENABLE_WIFI_AP
depends on ESP_WIFI_SOFTAP_SUPPORT
bool "Enable CHIP WIFI AP"
default y
help
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/esp32/setup_idf_chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ step.
$ ./install.sh
```
- For ESP32H2, please checkout commit id
[10f3aba770](https://github.com/espressif/esp-idf/tree/10f3aba770),
- For ESP32H2, please checkout tag
[v5.0-beta1](https://github.com/espressif/esp-idf/tree/v5.0-beta1),
currently only lighting-app is supported on H2
```
$ cd esp-idf
$ git checkout 10f3aba770
$ git checkout v5.0-beta1
$ git submodule update --init
$ ./install.sh
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ server cluster ColorControl = 768 {
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

Expand Down
9 changes: 2 additions & 7 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,19 @@ menu "Demo"

config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice

config ECHO_HOST_IP
string "IPV4 address"
default "127.0.0.1"
depends on USE_ECHO_CLIENT
help
The IPV4 Address of the ECHO Server.

# NOTE: This config is not displayed as a input in the Kconfig menu, as its value is
# entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE
# define that is produced is needed to configure the TFT library correctly.
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,19 @@ menu "Demo"

config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice

config ECHO_HOST_IP
string "IPV4 address"
default "127.0.0.1"
depends on USE_ECHO_CLIENT
help
The IPV4 Address of the ECHO Server.

# NOTE: This config is not displayed as a input in the Kconfig menu, as its value is
# entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE
# define that is produced is needed to configure the TFT library correctly.
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-minimal-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/bridge-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ server cluster ColorControl = 768 {
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute attrib_id attributeList[] = 65531;
Expand Down
7 changes: 4 additions & 3 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ chip_data_model("chef-common") {
is_server = true
}

# ThunderBoards (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") {
# ThunderBoards and Explorer Kit (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" ||
efr32_board == "BRD2703A") {
show_qr_code = false
disable_lcd = true
}
Expand Down Expand Up @@ -207,7 +208,7 @@ efr32_executable("chef_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
9 changes: 2 additions & 7 deletions examples/chef/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,19 @@ menu "Demo"
bool "Bypass"
config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice

config ECHO_HOST_IP
string "IPV4 address"
default "127.0.0.1"
depends on USE_ECHO_CLIENT
help
The IPV4 Address of the ECHO Server.

# NOTE: This config is not displayed as a input in the Kconfig menu, as its value is
# entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE
# define that is produced is needed to configure the TFT library correctly.
Expand Down
3 changes: 3 additions & 0 deletions examples/chef/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ CONFIG_STACK_CHECK=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
7 changes: 4 additions & 3 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ if (chip_enable_wifi) {
assert(use_rs911x || use_wf200)
}

# ThunderBoards (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") {
# ThunderBoards and Explorer Kit (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" ||
efr32_board == "BRD2703A") {
show_qr_code = false
disable_lcd = true
}
Expand Down Expand Up @@ -200,7 +201,7 @@ efr32_executable("light_switch_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
5 changes: 4 additions & 1 deletion examples/light-switch-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

#enable debug shell
CONFIG_ENABLE_CHIP_SHELL=y
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ client cluster ColorControl = 768 {
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
readonly attribute int16u clusterRevision = 65533;

request struct MoveToHueRequest {
Expand Down
7 changes: 4 additions & 3 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ if (chip_enable_wifi) {
assert(use_rs911x || use_wf200)
}

# ThunderBoards (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") {
# ThunderBoards and Explorer Kit (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" ||
efr32_board == "BRD2703A") {
show_qr_code = false
disable_lcd = true
}
Expand Down Expand Up @@ -205,7 +206,7 @@ efr32_executable("lighting_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
18 changes: 18 additions & 0 deletions examples/lighting-app/esp32/main/Button.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "Button.h"
#include "esp_attr.h"

#define GPIO_INPUT_IO_0 9
#define GPIO_INPUT_PIN_SEL (1ULL << GPIO_INPUT_IO_0)
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
PRIV_REQUIRES chip QRCode bt led_strip app_update openthread)
PRIV_REQUIRES chip QRCode bt led_strip app_update openthread driver nvs_flash)

set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
Expand Down
18 changes: 16 additions & 2 deletions examples/lighting-app/esp32/main/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "LEDWidget.h"
#include "ColorFormat.h"
#include "led_strip.h"

static const char * TAG = "LEDWidget";

Expand All @@ -26,14 +27,23 @@ void LEDWidget::Init(void)
mBrightness = UINT8_MAX;

#if CONFIG_LED_TYPE_RMT
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
led_strip_config_t strip_config = {
.strip_gpio_num = CONFIG_LED_GPIO,
.max_leds = 1,
};

led_strip_new_rmt_device(&strip_config, &mStrip);
#else
rmt_config_t config = RMT_DEFAULT_CONFIG_TX((gpio_num_t) CONFIG_LED_GPIO, (rmt_channel_t) CONFIG_LED_RMT_CHANNEL);
led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t) config.channel);

config.clk_div = 2;
rmt_config(&config);
rmt_driver_install(config.channel, 0, 0);

mStrip = led_strip_new_rmt_ws2812(&strip_config);
mStrip = led_strip_new_rmt_ws2812(&strip_config);
#endif
mHue = 0;
mSaturation = 0;
#else
Expand Down Expand Up @@ -121,9 +131,13 @@ void LEDWidget::DoSet(void)
{
HsvColor_t hsv = { mHue, mSaturation, brightness };
RgbColor_t rgb = HsvToRgb(hsv);

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
led_strip_set_pixel(mStrip, 0, rgb.r, rgb.g, rgb.b);
led_strip_refresh(mStrip);
#else
mStrip->set_pixel(mStrip, 0, rgb.r, rgb.g, rgb.b);
mStrip->refresh(mStrip, 100);
#endif
}
#else
ESP_LOGI(TAG, "DoSet to GPIO number %d", mGPIONum);
Expand Down
4 changes: 4 additions & 0 deletions examples/lighting-app/esp32/main/include/LEDWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class LEDWidget
#if CONFIG_LED_TYPE_RMT
uint8_t mHue;
uint8_t mSaturation;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
led_strip_handle_t mStrip;
#else
led_strip_t * mStrip;
#endif
#else
gpio_num_t mGPIONum;
#endif
Expand Down
3 changes: 3 additions & 0 deletions examples/lighting-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Loading

0 comments on commit 344d16a

Please sign in to comment.