Skip to content

Commit

Permalink
Merge branch 'master' into TC-ACE-1.5-issue-242
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-marquez-csa authored Oct 24, 2024
2 parents 97e9f02 + 00890a6 commit 0dfe80c
Show file tree
Hide file tree
Showing 344 changed files with 1,661 additions and 120,653 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cert_test_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
pull_request:
paths:
- "src/app/tests/suites/certification/**"
permissions:
contents: read

jobs:
check-certification-tests:
Expand All @@ -30,6 +32,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run checks
run: |
python3 scripts/tests/matter_yaml_linter.py
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration
url = https://github.com/Infineon/lwip-network-interface-integration.git
platforms = infineon
[submodule "third_party/lwip/repo"]
path = third_party/lwip/repo
url = https://github.com/lwip-tcpip/lwip.git
[submodule "third_party/abseil-cpp/src"]
path = third_party/abseil-cpp/src
url = https://github.com/abseil/abseil-cpp.git
Expand All @@ -340,7 +343,7 @@
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest
platforms = linux,darwin
platforms = linux,android,darwin,tizen
[submodule "third_party/re2/src"]
path = third_party/re2/src
url = https://github.com/google/re2.git
Expand Down
6 changes: 6 additions & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/googletest.gni")
import("//build_overrides/pigweed.gni")

# The location of the build configuration file.
Expand All @@ -33,6 +34,11 @@ default_args = {
# GN target to use for the default Python build venv.
pw_build_PYTHON_BUILD_VENV = "//:matter_build_venv"

# Use the GoogleTest backend for unit tests running on host.
pw_unit_test_BACKEND = "$dir_pw_unit_test:googletest"
pw_unit_test_MAIN = "$dir_pigweed/third_party/googletest:gmock_main"
dir_pw_third_party_googletest = "$dir_googletest"

# Required for pw_unit_test
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
pw_assert_BACKEND = "$dir_pw_assert_log"
Expand Down
3 changes: 2 additions & 1 deletion build/toolchain/pw_fuzzer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/googletest.gni")
import("//build_overrides/pigweed.gni")

import("$dir_pigweed/targets/host/target_toolchains.gni")
Expand Down Expand Up @@ -61,7 +62,7 @@ gcc_toolchain("chip_pw_fuzztest") {

dir_pw_third_party_abseil_cpp = "//third_party/abseil-cpp/src"
dir_pw_third_party_fuzztest = "//third_party/fuzztest"
dir_pw_third_party_googletest = "//third_party/googletest"
dir_pw_third_party_googletest = "$dir_googletest"

# TODO: Seems that re2 support within FuzzTest was deprecated, keeping it defined is triggering warning
# Remove if re2 is indeed not needed
Expand Down
18 changes: 18 additions & 0 deletions build_overrides/googletest.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 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.

declare_args() {
# Location of the GoogleTest repository.
dir_googletest = "//third_party/googletest"
}
6 changes: 3 additions & 3 deletions config/ios/args.gni → config/darwin/args.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2024 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.
Expand All @@ -14,9 +14,9 @@

import("//build_overrides/chip.gni")

chip_system_config_clock = "gettimeofday"
chip_device_platform = "darwin"

chip_project_config_include_dirs = [ "${chip_root}/config/ios" ]
chip_project_config_include = ""
chip_system_project_config_include = ""

pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ]
2 changes: 1 addition & 1 deletion config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- if: "target != esp32h2"

espressif/esp_secure_cert_mgr:
version: "^2.3.0"
version: "^2.5.0"
rules:
- if: "idf_version >=4.3"

Expand Down
52 changes: 0 additions & 52 deletions config/ios/CHIPProjectConfig.h

This file was deleted.

26 changes: 0 additions & 26 deletions config/ios/SystemProjectConfig.h

This file was deleted.

18 changes: 18 additions & 0 deletions examples/build_overrides/googletest.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 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.

declare_args() {
# Location of the GoogleTest repository.
dir_googletest = "//third_party/connectedhomeip/third_party/googletest"
}
13 changes: 1 addition & 12 deletions examples/darwin-framework-tool/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,4 @@

import("//build_overrides/chip.gni")

import("${chip_root}/config/standalone/args.gni")

chip_crypto = "boringssl"

chip_device_project_config_include =
"${chip_root}/examples/darwin-framework-tool/include/CHIPProjectAppConfig.h"
chip_project_config_include =
"${chip_root}/examples/darwin-framework-tool/include/CHIPProjectAppConfig.h"

chip_project_config_include_dirs =
[ "${chip_root}/examples/darwin-framework-tool/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
import("${chip_root}/config/darwin/args.gni")
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,8 @@ class ClusterCommand : public ModelCommand {

CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override
{
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;

mData = static_cast<uint8_t *>(chip::Platform::MemoryCalloc(sizeof(uint8_t), mDataMaxLen));
VerifyOrReturnError(mData != nullptr, CHIP_ERROR_NO_MEMORY);

writer.Init(mData, mDataMaxLen);

ReturnErrorOnFailure(mPayload.Encode(writer, chip::TLV::AnonymousTag()));
reader.Init(mData, writer.GetLengthWritten());
ReturnErrorOnFailure(reader.Next());

id commandFields = NSObjectFromCHIPTLV(&reader);
if (commandFields == nil) {
return CHIP_ERROR_INTERNAL;
}
id commandFields;
ReturnErrorOnFailure(GetCommandFields(&commandFields));
return ClusterCommand::SendCommand(device, endpointId, mClusterId, mCommandId, commandFields);
}

Expand Down Expand Up @@ -136,6 +122,35 @@ class ClusterCommand : public ModelCommand {
NSError * _Nullable mError = nil;

private:
CHIP_ERROR GetCommandFields(id _Nonnull * _Nonnull outCommandFields)
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;

mData = static_cast<uint8_t *>(chip::Platform::MemoryCalloc(sizeof(uint8_t), mDataMaxLen));
VerifyOrExit(mData != nullptr, err = CHIP_ERROR_NO_MEMORY);

writer.Init(mData, mDataMaxLen);

err = mPayload.Encode(writer, chip::TLV::AnonymousTag());
SuccessOrExit(err);

reader.Init(mData, writer.GetLengthWritten());
err = reader.Next();
SuccessOrExit(err);

*outCommandFields = NSObjectFromCHIPTLV(&reader);
VerifyOrDo(nil != *outCommandFields, err = CHIP_ERROR_INTERNAL);

exit:
if (nullptr != mData) {
chip::Platform::MemoryFree(mData);
mData = nullptr;
}
return err;
}

chip::ClusterId mClusterId;
chip::CommandId mCommandId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,8 @@ class WriteAttribute : public ModelCommand {

CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override
{
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;

mData = static_cast<uint8_t *>(chip::Platform::MemoryCalloc(sizeof(uint8_t), mDataMaxLen));
VerifyOrReturnError(mData != nullptr, CHIP_ERROR_NO_MEMORY);

writer.Init(mData, mDataMaxLen);

ReturnErrorOnFailure(mAttributeValue.Encode(writer, chip::TLV::AnonymousTag()));
reader.Init(mData, writer.GetLengthWritten());
ReturnErrorOnFailure(reader.Next());

id value = NSObjectFromCHIPTLV(&reader);
if (value == nil) {
return CHIP_ERROR_INTERNAL;
}

id value;
ReturnErrorOnFailure(GetValue(&value));
return WriteAttribute::SendCommand(device, endpointId, mClusterId, mAttributeId, value);
}

Expand Down Expand Up @@ -122,6 +107,35 @@ class WriteAttribute : public ModelCommand {
chip::Optional<uint32_t> mDataVersion;

private:
CHIP_ERROR GetValue(id _Nonnull * _Nonnull outValue)
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;

mData = static_cast<uint8_t *>(chip::Platform::MemoryCalloc(sizeof(uint8_t), mDataMaxLen));
VerifyOrExit(mData != nullptr, err = CHIP_ERROR_NO_MEMORY);

writer.Init(mData, mDataMaxLen);

err = mAttributeValue.Encode(writer, chip::TLV::AnonymousTag());
SuccessOrExit(err);

reader.Init(mData, writer.GetLengthWritten());
err = reader.Next();
SuccessOrExit(err);

*outValue = NSObjectFromCHIPTLV(&reader);
VerifyOrDo(nil != *outValue, err = CHIP_ERROR_INTERNAL);

exit:
if (nullptr != mData) {
chip::Platform::MemoryFree(mData);
mData = nullptr;
}
return err;
}

chip::ClusterId mClusterId;
chip::AttributeId mAttributeId;
CHIP_ERROR mError = CHIP_NO_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0
#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0
#define OPENTHREAD_CONFIG_TCP_ENABLE 0
#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0

#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 0
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 0
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static const sl_wifi_device_configuration_t config = {
.boot_option = LOAD_NWP_FW,
.mac_address = NULL,
.band = SL_SI91X_WIFI_BAND_2_4GHZ,
.region_code = US,
.region_code = REGION_CODE,
.boot_config = { .oper_mode = SL_SI91X_CLIENT_MODE,
.coex_mode = SL_SI91X_WLAN_BLE_MODE,
.feature_bit_map =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@
"$(CHIP_ROOT)/src/include",
"$(CHIP_ROOT)/src/lib",
"$(CHIP_ROOT)/src/app",
"$(CHIP_ROOT)/config/ios",
"$(CHIP_ROOT)/src/app/util",
"$(CHIP_ROOT)/third_party/nlassert/repo/include",
"$(CHIP_ROOT)/third_party/nlio/repo/include",
Expand Down Expand Up @@ -759,7 +758,6 @@
"$(CHIP_ROOT)/src/include",
"$(CHIP_ROOT)/src/lib",
"$(CHIP_ROOT)/src/app",
"$(CHIP_ROOT)/config/ios",
"$(CHIP_ROOT)/src/app/util",
"$(CHIP_ROOT)/third_party/nlassert/repo/include",
"$(CHIP_ROOT)/third_party/nlio/repo/include",
Expand Down
Loading

0 comments on commit 0dfe80c

Please sign in to comment.