Skip to content

Commit 5a7fc63

Browse files
authored
Merge branch 'master' into tc-washerctrl-2-1-python-test
2 parents 0c26a20 + 8a0fc4d commit 5a7fc63

File tree

109 files changed

+11043
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+11043
-1043
lines changed

.github/.wordlist.txt

-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,6 @@ js
757757
json
758758
JTAG
759759
Jupyter
760-
judgement
761760
jupyterlab
762761
KA
763762
kAdminister

.github/PULL_REQUEST_TEMPLATE.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
> !!!!!!!!!! Please delete the instructions below and replace with PR description
1+
> !!!!!!!!!! Please delete the instructions below and replace with PR
2+
> description
23
>
3-
> If you have an issue number, please use a syntax of
4-
> `Fixes #12345` and a brief change description
4+
> If you have an issue number, please use a syntax of `Fixes #12345` and a brief
5+
> change description
56
>
6-
> If you do not have an issue number, please have a good description of
7-
> the problem and the fix. Help the reviewer understand what to expect.
7+
> If you do not have an issue number, please have a good description of the
8+
> problem and the fix. Help the reviewer understand what to expect.
89
>
9-
> Add a `### Testing` section to your PR to describe how testing was done.
10-
> See <https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#pull-requests>
10+
> Complete/append to the `### Testing` section below, to describe how testing
11+
> was done. See
12+
> <https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#pull-requests>
1113
>
1214
> Make sure you delete these instructions (to prove you have read them).
1315
>
1416
> !!!!!!!!!! Instructions end
17+
18+
#### Testing

.github/workflows/cancel_workflows_for_pr.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ jobs:
3535
python-version: '3.12'
3636
- name: Setup pip modules we use
3737
run: |
38-
pip install \
38+
python3 -m venv venv
39+
venv/bin/pip3 install \
3940
click \
4041
coloredlogs \
4142
python-dateutil \
4243
pygithub \
43-
&& echo "DONE installint python prerequisites"
44+
&& echo "DONE installing python prerequisites"
4445
- name: Cancel runs
4546
run: |
46-
scripts/tools/cancel_workflows_for_pr.py \
47+
venv/bin/python3 scripts/tools/cancel_workflows_for_pr.py \
4748
--gh-api-token "${{ secrets.GITHUB_TOKEN }}" \
4849
--require "Restyled" \
4950
--require "Lint Code Base" \

.github/workflows/docbuild.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@ jobs:
2929
- name: Install Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: 3.8
32+
python-version: 3.12
3333
cache-dependency-path: matter/docs/requirements.txt
3434
cache: pip
3535
- name: Install base dependencies
3636
working-directory: matter
3737
run: |
38-
sudo pip3 install -U pip
39-
pip3 install -r docs/requirements.txt
38+
python3 -m venv venv
39+
venv/bin/pip3 install -r docs/requirements.txt
4040
- name: Build documentation
4141
working-directory: matter/docs
4242
run: |
43+
source ../venv/bin/activate
4344
mkdir -p _build/src
4445
make html
4546
touch _build/html/.nojekyll

.github/workflows/examples-bouffalolab.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,26 @@ jobs:
116116
- name: Clean out build output
117117
run: rm -rf ./out
118118

119+
- name: Build example BL702L Contact Sensor
120+
timeout-minutes: 30
121+
run: |
122+
./scripts/run_in_build_env.sh \
123+
"./scripts/build/build_examples.py \
124+
--target bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd \
125+
build \
126+
--copy-artifacts-to out/artifacts \
127+
"
128+
- name: Prepare some bloat report from the previous builds
129+
run: |
130+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
131+
bl702l bl702l+mfd+littlefs contact-sensor-app \
132+
out/artifacts/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
133+
/tmp/bloat_reports/
134+
- name: Clean out build output
135+
run: rm -rf ./out
136+
119137
- name: Uploading Size Reports
120138
uses: ./.github/actions/upload-size-reports
121139
if: ${{ !env.ACT }}
122140
with:
123-
platform-name: BouffaloLab
141+
platform-name: BouffaloLab

.github/workflows/pr-validation.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,25 @@ jobs:
88
check_testing_header:
99
runs-on: ubuntu-latest
1010
steps:
11-
1211
- name: Check for `### Testing` section in PR
1312
id: check-testing
1413
continue-on-error: true
1514
run: |
16-
python -c 'import sys; pr_summary = """${{ github.event.pull_request.body }}"""; sys.exit(0 if "### Testing" in pr_summary else 1)'
15+
cat >/tmp/pr-summary.txt << "EndMarkerForPrSummary"
16+
${{ github.event.pull_request.body }}
17+
EndMarkerForPrSummary
18+
19+
python -c 'import sys; pr_summary = open("/tmp/pr-summary.txt", "rt").read(); sys.exit(0 if "### Testing" in pr_summary else 1)'
1720
1821
- name: Check for PR starting instructions
1922
id: check-instructions
2023
continue-on-error: true
2124
run: |
22-
python -c 'import sys; pr_summary = """${{ github.event.pull_request.body }}"""; sys.exit(1 if "Make sure you delete these instructions" in pr_summary else 0)'
25+
cat >/tmp/pr-summary.txt << "EndMarkerForPrSummary"
26+
${{ github.event.pull_request.body }}
27+
EndMarkerForPrSummary
28+
29+
python -c 'import sys; pr_summary = open("/tmp/pr-summary.txt", "rt").read(); sys.exit(1 if "Make sure you delete these instructions" in pr_summary else 0)'
2330
2431
# NOTE: comments disabled for now as separate permissions are required
2532
# failing CI step may be sufficient to start (although it contains less information about why it failed)

.github/workflows/protocol_compatibility.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
- name: Setup python
3131
uses: actions/setup-python@v5
3232
with:
33-
python-version: 3.11
33+
python-version: 3.12
3434
- name: Install dependencies
3535
run: |
36-
python -m pip install --upgrade pip
37-
pip install click coloredlogs lark
36+
python3 -m venv venv
37+
venv/bin/pip3 install click coloredlogs lark
3838
- name: Create old/new copies
3939
run: |
4040
mkdir -p out
@@ -45,5 +45,4 @@ jobs:
4545
patch -p1 <out/patch.diff
4646
- name: Check backwards compatibility
4747
run: |
48-
scripts/backwards_compatibility_checker.py out/old_version.matter out/new_version.matter
49-
48+
venv/bin/python3 scripts/backwards_compatibility_checker.py out/old_version.matter out/new_version.matter

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ to open the pull request for details or open additional issue in GitHub)
198198
Ensure that there is sufficient detail in issue summaries to make the content of
199199
the PR clear:
200200

201-
- a `TLDR` of the change content. This is a judgement call on details,
201+
- a `TLDR` of the change content. This is a judgment call on details,
202202
generally you should include a what was changed and why. The change is
203203
trivial/short, this can be very short (i.e. "fixed typos" is perfectly
204204
acceptable, however if changing 100-1000s of line, the areas of changes
205205
should be explained)
206206
- If a crash/error is fixed, explain the root cause and if the fix is not
207-
obvious (again, judgement call), explain why the given approach was taken.
207+
obvious (again, judgment call), explain why the given approach was taken.
208208
- Help the reviewer out with any notable information (specific platform
209209
issues, extra thoughts or requests for feedback or gotchas on tricky code,
210210
followup work or PR dependencies)
@@ -230,7 +230,7 @@ out of convenience.
230230
updated to cover functionality" or "existing tests already cover this" (make
231231
sure they do. Integration tests often only cover happy paths).
232232

233-
Add any notes on not covered things. It is a judgement call on how much can
233+
Add any notes on not covered things. It is a judgment call on how much can
234234
be covered as 100% sounds great however not always possible.
235235

236236
- Manual testing
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include <app/clusters/software-diagnostics-server/SoftwareDiagnosticsTestEventTriggerHandler.h>
19+
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
20+
#include <platform/CHIPDeviceLayer.h>
21+
#include <platform/DiagnosticDataProvider.h>
22+
23+
using namespace chip;
24+
using namespace chip::app;
25+
using namespace chip::DeviceLayer;
26+
27+
namespace {
28+
29+
void SetTestEventTrigger_SoftwareFaultOccurred()
30+
{
31+
Clusters::SoftwareDiagnostics::Events::SoftwareFault::Type softwareFault;
32+
char threadName[kMaxThreadNameLength + 1];
33+
34+
softwareFault.id = static_cast<uint64_t>(getpid());
35+
Platform::CopyString(threadName, std::to_string(softwareFault.id).c_str());
36+
37+
softwareFault.name.SetValue(CharSpan::fromCharString(threadName));
38+
39+
std::time_t result = std::time(nullptr);
40+
// Using size of 50 as it is double the expected 25 characters "Www Mmm dd hh:mm:ss yyyy\n".
41+
char timeChar[50];
42+
if (std::strftime(timeChar, sizeof(timeChar), "%c", std::localtime(&result)))
43+
{
44+
softwareFault.faultRecording.SetValue(ByteSpan(Uint8::from_const_char(timeChar), strlen(timeChar)));
45+
}
46+
47+
Clusters::SoftwareDiagnosticsServer::Instance().OnSoftwareFaultDetect(softwareFault);
48+
}
49+
50+
} // namespace
51+
52+
bool HandleSoftwareDiagnosticsTestEventTrigger(uint64_t eventTrigger)
53+
{
54+
SoftwareDiagnosticsTrigger trigger = static_cast<SoftwareDiagnosticsTrigger>(eventTrigger);
55+
56+
switch (trigger)
57+
{
58+
case SoftwareDiagnosticsTrigger::kSoftwareFault:
59+
ChipLogProgress(Support, "[Software-Diagnostics-Test-Event] => Software Fault occurred");
60+
SetTestEventTrigger_SoftwareFaultOccurred();
61+
break;
62+
default:
63+
64+
return false;
65+
}
66+
67+
return true;
68+
}

examples/all-clusters-app/esp32/main/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ extern "C" void app_main()
210210
{
211211
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %" CHIP_ERROR_FORMAT, error.Format());
212212
}
213-
ESPOpenThreadInit();
214213

215214
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
215+
216+
ESPOpenThreadInit();
216217
}
217218

218219
bool lowPowerClusterSleep()

examples/all-clusters-app/linux/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ source_set("chip-all-clusters-common") {
5656
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp",
5757
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp",
5858
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
59+
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/software-diagnostics-stub.cpp",
5960
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
6061
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
6162
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp",

examples/all-clusters-app/linux/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ matter_log_json_payload_hex = true
3030
chip_enable_smoke_co_trigger = true
3131
chip_enable_boolean_state_configuration_trigger = true
3232
chip_enable_water_heater_management_trigger = true
33+
chip_enable_software_diagnostics_trigger = true

examples/all-clusters-minimal-app/esp32/main/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ extern "C" void app_main()
186186
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %" CHIP_ERROR_FORMAT, error.Format());
187187
}
188188

189-
ESPOpenThreadInit();
190189
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
190+
191+
ESPOpenThreadInit();
191192
}
192193

193194
bool lowPowerClusterSleep()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2020 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
17+
# The location of the build configuration file.
18+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
19+
20+
# CHIP uses angle bracket includes.
21+
check_system_includes = true
22+
23+
default_args = {
24+
target_cpu = "riscv"
25+
target_os = "freertos"
26+
27+
import("//args.gni")
28+
}

0 commit comments

Comments
 (0)