Skip to content

Commit

Permalink
Merge branch 'master' into add_five_HIEST_PRI_ALARM
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzijian1994 authored Jul 26, 2023
2 parents e5d05c3 + 67324e6 commit 9e05030
Show file tree
Hide file tree
Showing 44 changed files with 133 additions and 125 deletions.
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
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
3 changes: 1 addition & 2 deletions examples/all-clusters-minimal-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,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/bridge-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(EXTRA_COMPONENT_DIRS

# TODO: add CHIPProjectAppConfig.h to esp32
project(chip-bridge-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
3 changes: 1 addition & 2 deletions examples/chef/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,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: 0 additions & 2 deletions examples/chef/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"

# Light app on EFR enables tracing server
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
3 changes: 0 additions & 3 deletions examples/chip-tool/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"

matter_log_json_payload_hex = true
matter_log_json_payload_decode_full = true
5 changes: 1 addition & 4 deletions examples/common/tracing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/lib/lib.gni")

declare_args() {
# TODO: cpp_standard check is not ideal, it should be >= 17,
# however for now this is what we use in compilations
matter_commandline_enable_perfetto_tracing =
current_os == "linux" && cpp_standard == "gnu++17"
matter_commandline_enable_perfetto_tracing = current_os == "linux"
}

config("default_config") {
Expand Down
3 changes: 1 addition & 2 deletions examples/light-switch-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,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: 0 additions & 2 deletions examples/light-switch-app/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
3 changes: 1 addition & 2 deletions examples/lighting-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,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: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl602/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import("${chip_root}/examples/platform/bouffalolab/bl602/args.gni")

chip_enable_pw_rpc = true

cpp_standard = "gnu++17"

# pigweed updated to a1bd248 makes compile conversion errors;
# it seems riscv gcc (version > 10) can fixes this issue.
# let's disable strict warnings for RPC enabled for now.
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl702/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import("${chip_root}/examples/platform/bouffalolab/bl702/args.gni")

chip_enable_pw_rpc = true

cpp_standard = "gnu++17"

# pigweed updated to a1bd248 makes compile conversion errors;
# it seems riscv gcc (version > 10) can fixes this issue.
# let's disable strict warnings for RPC enabled for now.
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl702l/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ import("${chip_root}/examples/platform/bouffalolab/bl702l/args.gni")

chip_enable_pw_rpc = true
chip_build_pw_trace_lib = false

cpp_standard = "gnu++17"
#pw_trace_BACKEND = "$dir_pw_trace_tokenized"
2 changes: 0 additions & 2 deletions examples/lighting-app/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/lighting-app/qpg/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/lighting-app/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ app_data_model = "${chip_root}/examples/lighting-app/lighting-common"
chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"

# Light app on EFR enables tracing server
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
2 changes: 0 additions & 2 deletions examples/lock-app/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/lock-app/qpg/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ import("${chip_root}/examples/platform/qpg/args.gni")
qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true

cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/lock-app/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ chip_enable_pw_rpc = true
chip_enable_openthread = true
chip_openthread_ftd = true

cpp_standard = "gnu++17"

# To fit in flash
chip_detail_logging = false
show_qr_code = false
2 changes: 1 addition & 1 deletion examples/ota-provider-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-ota-provider-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
3 changes: 1 addition & 2 deletions examples/ota-requestor-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,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: 0 additions & 2 deletions examples/ota-requestor-app/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 1 addition & 1 deletion examples/persistent-storage/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-persistent-storage)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
2 changes: 0 additions & 2 deletions examples/pump-app/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ chip_enable_pw_rpc = true
chip_enable_openthread = true
chip_build_pw_trace_lib = true

cpp_standard = "gnu++17"

# Light app on EFR enables tracing server
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
2 changes: 1 addition & 1 deletion examples/shell/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-shell)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)

# For the C3, project_include.cmake sets -Wno-format, but does not clear various
Expand Down
2 changes: 0 additions & 2 deletions examples/smoke-co-alarm-app/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ app_data_model =
"${chip_root}/examples/smoke-co-alarm-app/smoke-co-alarm-common"
chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/thermostat/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
2 changes: 1 addition & 1 deletion integrations/cloudbuild/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ steps:
./scripts/build/build_examples.py --enable-flashbundle --target
esp32-devkitc-light-rpc --target
esp32-m5stack-all-clusters-ipv6only --target
esp32-m5stack-all-clusters-rpc --target
esp32-m5stack-all-clusters-rpc-ipv6only --target
esp32-m5stack-light --target
esp32-m5stack-light-ipv6only --target
esp32-m5stack-ota-requestor build --create-archives
Expand Down
11 changes: 7 additions & 4 deletions scripts/tests/yaml/chiptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@


@click.pass_context
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]):
kwargs = {'test_name': test_name, 'pics': pics, 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory}
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]):
kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics,
'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory}

index = 0
while len(commands) - index > 1:
Expand Down Expand Up @@ -83,6 +84,8 @@ def chiptool_runner_options(f):
help='Name of a websocket server to run at launch.')(f)
f = click.option('--server_arguments', type=str, default='interactive server',
help='Optional arguments to pass to the websocket server at launch.')(f)
f = click.option('--show_adapter_logs', type=bool, default=False, show_default=True,
help='Show additional logs provided by the adapter.')(f)
f = click.option('--trace_file', type=click.Path(), default=None,
help='Optional file path to save the tracing output to.')(f)
f = click.option('--trace_decode', type=bool, default=True,
Expand Down Expand Up @@ -126,14 +129,14 @@ def maybe_update_stop_on_error(ctx):
@click.argument('commands', nargs=-1)
@chiptool_runner_options
@click.pass_context
def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str):
def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str):
success = False

server_arguments = maybe_update_server_arguments(ctx)
maybe_update_stop_on_error(ctx)

if len(commands) > 1 and commands[0] == 'tests':
success = send_yaml_command(commands[1], server_path, server_arguments, pics,
success = send_yaml_command(commands[1], server_path, server_arguments, show_adapter_logs, pics,
additional_pseudo_clusters_directory, commands[2:])
else:
if server_path is None and server_name:
Expand Down
Loading

0 comments on commit 9e05030

Please sign in to comment.