Skip to content

Commit

Permalink
Merge branch 'master' into update-ti-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Aug 23, 2022
2 parents fc0d4f3 + cfdb308 commit 019930c
Show file tree
Hide file tree
Showing 61 changed files with 503 additions and 156 deletions.
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
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
2 changes: 1 addition & 1 deletion examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,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
1 change: 1 addition & 0 deletions examples/common/pigweed/protos/device_service.options
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ chip.rpc.PairingInfo.qr_code max_size:256
chip.rpc.PairingInfo.qr_code_url max_size:256
chip.rpc.SpakeInfo.verifier max_size:97 // kSpake2p_VerifierSerialized_Length
chip.rpc.SpakeInfo.salt max_size:32 // kSpake2p_Max_PBKDF_Salt_Length
chip.rpc.MetadataForProvider.tlv max_size:512 // length defined in chip spec 11.20.6.7
5 changes: 5 additions & 0 deletions examples/common/pigweed/protos/device_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ message PairingState {
bool pairing_enabled = 1;
}

message MetadataForProvider {
bytes tlv = 1;
}

service Device {
rpc FactoryReset(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc Reboot(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc TriggerOta(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc SetOtaMetadataForProvider(MetadataForProvider) returns (pw.protobuf.Empty){}
rpc GetDeviceInfo(pw.protobuf.Empty) returns (DeviceInfo){}
rpc GetDeviceState(pw.protobuf.Empty) returns (DeviceState){}
rpc SetPairingState(PairingState) returns (pw.protobuf.Empty){}
Expand Down
33 changes: 30 additions & 3 deletions examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>

virtual pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
#if CONFIG_CHIP_OTA_REQUESTOR
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
chip::DeviceLayer::PlatformMgr().ScheduleWork(
[](intptr_t) {
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
Expand All @@ -238,10 +238,33 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
},
reinterpret_cast<intptr_t>(nullptr));
return pw::OkStatus();
#else
#else // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
ChipLogError(AppServer, "Trigger OTA requested, but OTA requestor not compiled in.");
return pw::Status::Unimplemented();
#endif
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
}

virtual pw::Status SetOtaMetadataForProvider(const chip_rpc_MetadataForProvider & request, pw_protobuf_Empty & response)
{
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
if (requestor == nullptr)
{
ChipLogError(SoftwareUpdate, "Can't get the CASESessionManager");
return pw::Status::Unavailable();
}
else if (sizeof(metadataForProviderBuffer) < request.tlv.size)
{
return pw::Status::ResourceExhausted();
}
memcpy(metadataForProviderBuffer, request.tlv.bytes, request.tlv.size);
DeviceLayer::StackLock lock;
requestor->SetMetadataForProvider(chip::ByteSpan(metadataForProviderBuffer, request.tlv.size));
return pw::OkStatus();
#else // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
ChipLogError(AppServer, "OTA set metadata for provider requested, but OTA requestor not compiled in.");
return pw::Status::Unimplemented();
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
}

virtual pw::Status SetPairingState(const chip_rpc_PairingState & request, pw_protobuf_Empty & response)
Expand Down Expand Up @@ -415,6 +438,10 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
}

private:
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
static constexpr size_t kMaxMetadataForProviderLength = 512; // length defined in chip spec 11.20.6.7
uint8_t metadataForProviderBuffer[kMaxMetadataForProviderLength];
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Internal::CommissionableDataProviderRpcWrapper mCommissionableDataProvider;
};

Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,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
2 changes: 1 addition & 1 deletion examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,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
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
2 changes: 1 addition & 1 deletion examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ efr32_executable("lock_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
14 changes: 0 additions & 14 deletions examples/lock-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ menu "Demo"
bool "Ethernet"
endchoice

config USE_ECHO_CLIENT
bool "Enable the built-in Echo Client"
default "n"
help
This enables a local FreeRTOS Echo Client so that the end-to-end echo server can be
tested easily

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.

config RENDEZVOUS_MODE
int
range 0 8
Expand Down
3 changes: 3 additions & 0 deletions examples/lock-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

#Lock app PID
CONFIG_DEVICE_PRODUCT_ID=0x8006

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/ota-provider-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ CONFIG_USE_TEST_SETUP_DISCRIMINATOR=0xF01

# Enable chip shell
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/ota-requestor-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER=2

# Enable Chip Shell
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
2 changes: 1 addition & 1 deletion examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static_library("shell_common") {
if (chip_enable_openthread &&
(current_os == "freertos" || current_os == "zephyr")) {
public_deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_cli",
"${chip_root}/third_party/openthread:openthread_device",
]
}

Expand Down
14 changes: 0 additions & 14 deletions examples/temperature-measurement-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ menu "Demo"
bool "Ethernet"
endchoice

config USE_ECHO_CLIENT
bool "Enable the built-in Echo Client"
default "n"
help
This enables a local FreeRTOS Echo Client so that the end-to-end echo server can be
tested easily

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.

config RENDEZVOUS_MODE
int
range 0 8
Expand Down
3 changes: 3 additions & 0 deletions examples/temperature-measurement-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
#enable lwIP route hooks
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
2 changes: 1 addition & 1 deletion examples/thermostat/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ efr32_executable("thermostat_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
2 changes: 1 addition & 1 deletion examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ efr32_executable("window_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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN set -x \
&& (apt-get remove -fy python3-yaml && apt-get autoremove || exit 0) \
&& python3 -m pip install -U --no-cache-dir cmake==3.22.5 \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/zephyr/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements-build.txt \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/bootloader/mcuboot/scripts/requirements.txt \
&& : # last line

Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.95 Version bump reason: [TI] Update SysConfig to 1.13.0
0.5.96 Version bump reason: [TI] Update SysConfig to 1.13.0
12 changes: 6 additions & 6 deletions scripts/tools/generate_esp32_chip_factory_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
'encoding': 'string',
'value': None,
},
'unique-id': {
'rd-id-uid': {
'type': 'data',
'encoding': 'hex2bin',
'value': None,
Expand Down Expand Up @@ -260,7 +260,7 @@ def validate_args(args):
check_str_range(args.product_name, 1, 32, 'Product name')
check_str_range(args.hw_ver_str, 1, 64, 'Hardware version string')
check_str_range(args.mfg_date, 8, 16, 'Manufacturing date')
check_str_range(args.unique_id, 32, 32, 'Unique id')
check_str_range(args.rd_id_uid, 32, 32, 'Rotating device Unique id')

logging.info('Discriminator:{} Passcode:{}'.format(args.discriminator, args.passcode))

Expand Down Expand Up @@ -295,8 +295,8 @@ def populate_factory_data(args, spake2p_params):

if args.serial_num is not None:
FACTORY_DATA['serial-num']['value'] = args.serial_num
if args.unique_id is not None:
FACTORY_DATA['unique-id']['value'] = args.unique_id
if args.rd_id_uid is not None:
FACTORY_DATA['rd-id-uid']['value'] = args.rd_id_uid
if args.mfg_date is not None:
FACTORY_DATA['mfg-date']['value'] = args.mfg_date
if args.vendor_id is not None:
Expand Down Expand Up @@ -460,8 +460,8 @@ def any_base_int(s): return int(s, 0)
parser.add_argument('--hw-ver-str', type=str, required=False, help='Hardware version string')
parser.add_argument('--mfg-date', type=str, required=False, help='Manufacturing date in format YYYY-MM-DD')
parser.add_argument('--serial-num', type=str, required=False, help='Serial number')
parser.add_argument('--unique-id', type=str, required=False,
help='128-bit unique identifier, provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"')
parser.add_argument('--rd-id-uid', type=str, required=False,
help='128-bit unique identifier for generating rotating device identifier, provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"')

# These will be used by DeviceInfoProvider
parser.add_argument('--calendar-types', type=str, nargs='+', required=False,
Expand Down
Loading

0 comments on commit 019930c

Please sign in to comment.