Skip to content

Commit

Permalink
Merge branch 'master' into disable_event_list_in_yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jul 27, 2023
2 parents c7f7522 + 0a7cc29 commit 4c5e96c
Show file tree
Hide file tree
Showing 142 changed files with 4,601 additions and 613 deletions.
10 changes: 7 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ app:
- src/app/*
- src/app/**/*

icd:
- src/app/icd/*
- src/app/icd/**/*

transport:
- src/transport/*
- src/transport/**/*
Expand Down Expand Up @@ -185,9 +189,9 @@ darwin:
- examples/darwin-framework-tool/*
- examples/darwin-framework-tool/**/*

efr32:
- src/platform/efr32/*
- src/platform/efr32/**/*
silabs:
- src/platform/silabs/*
- src/platform/silabs/**/*

esp32:
- src/platform/ESP32/*
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false"
scripts/run_in_build_env.sh "ninja -C ./out/gcc_release"
BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh
- name: Clean output
run: rm -rf ./out
- name: Run Tests with sanitizers
env:
LSAN_OPTIONS: detect_leaks=1
Expand Down
16 changes: 8 additions & 8 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.gcc.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -17,7 +17,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.clang.json",
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -29,7 +29,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.mbedtls.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -39,7 +39,7 @@
{
"name": "Android x64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_x64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang",
Expand All @@ -51,7 +51,7 @@
{
"name": "Android arm64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-arm64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_arm64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang",
Expand All @@ -63,7 +63,7 @@
{
"name": "EFR32 examples debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.efr32.json",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
Expand All @@ -75,7 +75,7 @@
{
"name": "nRF Connect examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
"browse": {
Expand All @@ -86,7 +86,7 @@
{
"name": "Tizen examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/tizen-sdk/tools/arm-linux-gnueabi-gcc-9.2/bin/arm-linux-gnueabi-gcc",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.tizen_arm.json",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
],
"clang-format.fallbackStyle": "WebKit",
"files.trimFinalNewlines": true,
"C_Cpp.default.cppStandard": "gnu++14",
"C_Cpp.default.cppStandard": "gnu++17",
"C_Cpp.default.cStandard": "gnu11",
"cmake.configureOnOpen": false,
"search.followSymlinks": false,
Expand Down
7 changes: 1 addition & 6 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ declare_args() {
c_standard = "gnu11"

# C++ standard level (value for -std flag).
if (current_os == "linux" || current_os == "mac" || current_os == "ios" ||
current_os == "android") {
cpp_standard = "gnu++17"
} else {
cpp_standard = "gnu++14"
}
cpp_standard = "gnu++17"

# enable libfuzzer
is_libfuzzer = false
Expand Down
1 change: 0 additions & 1 deletion config/ameba/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ]
cpp_standard = "c++17"
4 changes: 1 addition & 3 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ matter_get_compiler_flags_from_targets("${CONFIG_CHIP_EXTERNAL_TARGETS}")
matter_add_flags(-D__LINUX_ERRNO_EXTENSIONS__=1)
matter_add_flags(-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>)

if (CONFIG_CHIP_PW_RPC)
matter_add_gnu_cpp_standard("17")
endif()
matter_add_gnu_cpp_standard("17")

if (CONFIG_MBED_BSD_SOCKET_TRACE)
matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1)
Expand Down
30 changes: 30 additions & 0 deletions config/telink/app/bootloader.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2023 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.
#

# Enable this option in case if restoring the slot0 partition is expected from slot1
# partition in case if slot0 is not bootable or damaged
CONFIG_BOOT_BOOTSTRAP=n

# Enable this option in case if SWAP_MOVE logic need to be used
CONFIG_BOOT_SWAP_USING_MOVE=y

# Enable this option in case if SWAP_MOVE using scratch logic need to be used
# Enabling this option expecting the availability of scratch partition in DTS
CONFIG_BOOT_SWAP_USING_SCRATCH=n

# Enable this option in case if the whole slot0 image need to be validated
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y
2 changes: 1 addition & 1 deletion config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

CONFIG_CHIP=y
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Logging (set CONFIG_SERIAL to 'y' to enable logging and 'n' to disable logging)
CONFIG_SERIAL=y
Expand Down
8 changes: 7 additions & 1 deletion config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,17 @@ else()
unset(GLOBAL_DTC_OVERLAY_FILE)
endif()

if(EXISTS "${CHIP_ROOT}/config/telink/app/bootloader.conf")
set(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE "${CHIP_ROOT}/config/telink/app/bootloader.conf")
else()
unset(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE)
endif()

if (CONFIG_CHIP_OTA_IMAGE_BUILD)
add_custom_target(build_mcuboot ALL
COMMAND
west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr
-- -DCONFIG_BOOT_SWAP_USING_MOVE=y -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE}
-- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE}
)

add_custom_target(merge_mcuboot ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,9 @@ class HepaFilterMonitoringInstance : public chip::app::Clusters::ResourceMonitor
aResetConditionCommandSupported){};
};

class StaticReplacementProductListManager : public chip::app::Clusters::ResourceMonitoring::ReplacementProductListManager
class ImmutableReplacementProductListManager : public chip::app::Clusters::ResourceMonitoring::ReplacementProductListManager
{
public:
uint8_t Size() override { return mReplacementProductListSize; };

CHIP_ERROR Next(chip::app::Clusters::ResourceMonitoring::Attributes::ReplacementProductStruct::Type & item) override;

~StaticReplacementProductListManager() {}
StaticReplacementProductListManager(
chip::app::Clusters::ResourceMonitoring::Attributes::ReplacementProductStruct::Type * aReplacementProductsList,
uint8_t aReplacementProductListSize)
{
mReplacementProductsList = aReplacementProductsList;
mReplacementProductListSize = aReplacementProductListSize;
}

private:
chip::app::Clusters::ResourceMonitoring::Attributes::ReplacementProductStruct::Type * mReplacementProductsList;
uint8_t mReplacementProductListSize;
CHIP_ERROR
Next(chip::app::Clusters::ResourceMonitoring::ReplacementProductStruct & item) override;
};
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ void DishwasherMode::Shutdown()
}
if (gDishwasherModeDelegate != nullptr)
{
gDishwasherModeDelegate->~DishwasherModeDelegate();
delete gDishwasherModeDelegate;
gDishwasherModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void LaundryWasherMode::Shutdown()
}
if (gLaundryWasherModeDelegate != nullptr)
{
gLaundryWasherModeDelegate->~LaundryWasherModeDelegate();
delete gLaundryWasherModeDelegate;
gLaundryWasherModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,7 @@ constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast<uint32_t>(Featu

static HepaFilterMonitoringInstance * gHepaFilterInstance = nullptr;
static ActivatedCarbonFilterMonitoringInstance * gActivatedCarbonFilterInstance = nullptr;

static ResourceMonitoring::Attributes::ReplacementProductStruct::Type sReplacementProductsList[] = {
{ .productIdentifierType = ProductIdentifierTypeEnum::kUpc,
.productIdentifierValue = CharSpan::fromCharString("111112222233") },
{ .productIdentifierType = ProductIdentifierTypeEnum::kGtin8, .productIdentifierValue = CharSpan::fromCharString("gtin8xxx") },
{ .productIdentifierType = ProductIdentifierTypeEnum::kEan,
.productIdentifierValue = CharSpan::fromCharString("4444455555666") },
{ .productIdentifierType = ProductIdentifierTypeEnum::kGtin14,
.productIdentifierValue = CharSpan::fromCharString("gtin14xxxxxxxx") },
{ .productIdentifierType = ProductIdentifierTypeEnum::kOem,
.productIdentifierValue = CharSpan::fromCharString("oem20xxxxxxxxxxxxxxx") },
};
StaticReplacementProductListManager sReplacementProductListManager(&sReplacementProductsList[0],
ArraySize(sReplacementProductsList));
static ImmutableReplacementProductListManager sReplacementProductListManager;

//-- Activated Carbon Filter Monitoring Instance methods
CHIP_ERROR ActivatedCarbonFilterMonitoringInstance::AppInit()
Expand Down Expand Up @@ -106,14 +93,40 @@ void emberAfHepaFilterMonitoringClusterInitCallback(chip::EndpointId endpoint)
gHepaFilterInstance->Init();
}

CHIP_ERROR StaticReplacementProductListManager::Next(Attributes::ReplacementProductStruct::Type & item)
CHIP_ERROR ImmutableReplacementProductListManager::Next(ReplacementProductStruct & item)
{
if (mIndex < mReplacementProductListSize)
if (mIndex >= kReplacementProductListMaxSize)
{
item = mReplacementProductsList[mIndex];
mIndex++;
return CHIP_NO_ERROR;
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}

return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
switch (mIndex)
{
case 0: {
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kUpc);
item.SetProductIdentifierValue(CharSpan::fromCharString("111112222233"));
break;
case 1:
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin8);
item.SetProductIdentifierValue(CharSpan::fromCharString("gtin8xxx"));
break;
case 2:
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kEan);
item.SetProductIdentifierValue(CharSpan::fromCharString("4444455555666"));
break;
case 3:
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin14);
item.SetProductIdentifierValue(CharSpan::fromCharString("gtin14xxxxxxxx"));
break;
case 4:
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kOem);
item.SetProductIdentifierValue(CharSpan::fromCharString("oem20xxxxxxxxxxxxxxx"));
break;
default:
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
break;
}
}
mIndex++;
return CHIP_NO_ERROR;
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ void RvcRunMode::Shutdown()
}
if (gRvcRunModeDelegate != nullptr)
{
gRvcRunModeDelegate->~RvcRunModeDelegate();
delete gRvcRunModeDelegate;
gRvcRunModeDelegate = nullptr;
}
}

Expand Down Expand Up @@ -180,7 +181,8 @@ void RvcCleanMode::Shutdown()
}
if (gRvcCleanModeDelegate != nullptr)
{
gRvcCleanModeDelegate->~RvcCleanModeDelegate();
delete gRvcCleanModeDelegate;
gRvcCleanModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void RefrigeratorAndTemperatureControlledCabinetMode::Shutdown()
}
if (gTccModeDelegate != nullptr)
{
gTccModeDelegate->~TccModeDelegate();
delete gTccModeDelegate;
gTccModeDelegate = nullptr;
}
}

Expand Down
3 changes: 1 addition & 2 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class AppCallbacks : public AppDelegate
public:
void OnCommissioningSessionEstablishmentStarted() {}
void OnCommissioningSessionStarted() override { bluetoothLED.Set(true); }
void OnCommissioningSessionStopped(CHIP_ERROR err) override
void OnCommissioningSessionStopped() override
{
bluetoothLED.Set(false);
pairingWindowLED.Set(false);
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
Loading

0 comments on commit 4c5e96c

Please sign in to comment.