Skip to content

Commit 1b0cb4b

Browse files
committed
Merge branch 'master' into fix-fabric-bridge-briged-device-basic-info
2 parents 738f8a2 + c53d771 commit 1b0cb4b

File tree

118 files changed

+2791
-2176
lines changed

Some content is hidden

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

118 files changed

+2791
-2176
lines changed

.github/labeler.yml

+9
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ test driver:
119119
- src/test_driver/*
120120
- src/test_driver/**/*
121121

122+
# Cert tests touched: add current milestone delta-tracking label.
123+
# TODO: Change after Aug 15, 2024
124+
matter-1.4-te2-script-change:
125+
- changed-files:
126+
- any-glob-to-any-file:
127+
- src/python_testing/*
128+
- src/python_testing/**/*
129+
- src/app/tests/suites/certification/*
130+
122131
############################################################
123132
# Source Code
124133
############################################################

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ jobs:
549549
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_FAN_3_5.py'
550550
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_2_1.py'
551551
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_3_1.py'
552+
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_3_3.py'
552553
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDManagementCluster.py'
553554
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_2.py'
554555
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_4.py'

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -6273,7 +6273,7 @@ cluster RelativeHumidityMeasurement = 1029 {
62736273

62746274
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
62756275
cluster OccupancySensing = 1030 {
6276-
revision 4;
6276+
revision 5;
62776277

62786278
enum OccupancySensorTypeEnum : enum8 {
62796279
kPIR = 0;

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+3-3
Original file line numberDiff line numberDiff line change
@@ -4710,7 +4710,7 @@ cluster RelativeHumidityMeasurement = 1029 {
47104710

47114711
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
47124712
cluster OccupancySensing = 1030 {
4713-
revision 4;
4713+
revision 5;
47144714

47154715
enum OccupancySensorTypeEnum : enum8 {
47164716
kPIR = 0;
@@ -6904,7 +6904,7 @@ endpoint 1 {
69046904
ram attribute occupancySensorType;
69056905
ram attribute occupancySensorTypeBitmap;
69066906
ram attribute featureMap default = 0;
6907-
ram attribute clusterRevision default = 4;
6907+
ram attribute clusterRevision default = 5;
69086908
}
69096909

69106910
server cluster WakeOnLan {
@@ -7257,7 +7257,7 @@ endpoint 2 {
72577257
ram attribute occupancySensorType;
72587258
ram attribute occupancySensorTypeBitmap;
72597259
ram attribute featureMap default = 0;
7260-
ram attribute clusterRevision default = 4;
7260+
ram attribute clusterRevision default = 5;
72617261
}
72627262
}
72637263
endpoint 65534 {

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -8014,7 +8014,7 @@
80148014
"storageOption": "RAM",
80158015
"singleton": 0,
80168016
"bounded": 0,
8017-
"defaultValue": "4",
8017+
"defaultValue": "5",
80188018
"reportable": 1,
80198019
"minInterval": 0,
80208020
"maxInterval": 65344,
@@ -11936,7 +11936,7 @@
1193611936
"storageOption": "RAM",
1193711937
"singleton": 0,
1193811938
"bounded": 0,
11939-
"defaultValue": "4",
11939+
"defaultValue": "5",
1194011940
"reportable": 1,
1194111941
"minInterval": 0,
1194211942
"maxInterval": 65344,

examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ cluster FixedLabel = 64 {
19051905

19061906
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
19071907
cluster OccupancySensing = 1030 {
1908-
revision 4;
1908+
revision 5;
19091909

19101910
enum OccupancySensorTypeEnum : enum8 {
19111911
kPIR = 0;

examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ cluster FixedLabel = 64 {
18001800

18011801
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
18021802
cluster OccupancySensing = 1030 {
1803-
revision 4;
1803+
revision 5;
18041804

18051805
enum OccupancySensorTypeEnum : enum8 {
18061806
kPIR = 0;

examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ provisional cluster ScenesManagement = 98 {
19561956

19571957
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
19581958
cluster OccupancySensing = 1030 {
1959-
revision 4;
1959+
revision 5;
19601960

19611961
enum OccupancySensorTypeEnum : enum8 {
19621962
kPIR = 0;

examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter

+2-2
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ cluster FixedLabel = 64 {
16031603

16041604
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
16051605
cluster OccupancySensing = 1030 {
1606-
revision 4;
1606+
revision 5;
16071607

16081608
enum OccupancySensorTypeEnum : enum8 {
16091609
kPIR = 0;
@@ -1919,7 +1919,7 @@ endpoint 1 {
19191919
callback attribute acceptedCommandList;
19201920
callback attribute attributeList;
19211921
ram attribute featureMap default = 0;
1922-
ram attribute clusterRevision default = 2;
1922+
ram attribute clusterRevision default = 5;
19231923
}
19241924
}
19251925

examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -2993,7 +2993,7 @@
29932993
"storageOption": "RAM",
29942994
"singleton": 0,
29952995
"bounded": 0,
2996-
"defaultValue": "2",
2996+
"defaultValue": "5",
29972997
"reportable": 1,
29982998
"minInterval": 1,
29992999
"maxInterval": 65534,
@@ -3022,4 +3022,4 @@
30223022
"parentEndpointIdentifier": null
30233023
}
30243024
]
3025-
}
3025+
}

examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ cluster RelativeHumidityMeasurement = 1029 {
21012101

21022102
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
21032103
cluster OccupancySensing = 1030 {
2104-
revision 4;
2104+
revision 5;
21052105

21062106
enum OccupancySensorTypeEnum : enum8 {
21072107
kPIR = 0;

examples/chef/sample_app_util/test_files/sample_zap_file.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -5654,7 +5654,7 @@
56545654
"storageOption": "RAM",
56555655
"singleton": 0,
56565656
"bounded": 0,
5657-
"defaultValue": "4",
5657+
"defaultValue": "5",
56585658
"reportable": 1,
56595659
"minInterval": 0,
56605660
"maxInterval": 65344,
@@ -5683,4 +5683,4 @@
56835683
"parentEndpointIdentifier": null
56845684
}
56855685
]
5686-
}
5686+
}

examples/chip-tool/commands/common/RemoteDataModelLogger.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error)
160160
VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR);
161161

162162
Json::Value value;
163-
chip::app::StatusIB status;
164-
status.InitFromChipError(error);
163+
chip::app::StatusIB status(error);
165164
return LogError(value, status);
166165
}
167166

examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter

+2-2
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ cluster BooleanState = 69 {
19021902

19031903
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
19041904
cluster OccupancySensing = 1030 {
1905-
revision 4;
1905+
revision 5;
19061906

19071907
enum OccupancySensorTypeEnum : enum8 {
19081908
kPIR = 0;
@@ -2356,7 +2356,7 @@ endpoint 1 {
23562356
ram attribute occupancySensorType;
23572357
ram attribute occupancySensorTypeBitmap;
23582358
ram attribute featureMap default = 0;
2359-
ram attribute clusterRevision default = 4;
2359+
ram attribute clusterRevision default = 5;
23602360
}
23612361
}
23622362

examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -4721,7 +4721,7 @@
47214721
"storageOption": "RAM",
47224722
"singleton": 0,
47234723
"bounded": 0,
4724-
"defaultValue": "4",
4724+
"defaultValue": "5",
47254725
"reportable": 1,
47264726
"minInterval": 0,
47274727
"maxInterval": 65344,
@@ -4750,4 +4750,4 @@
47504750
"parentEndpointIdentifier": null
47514751
}
47524752
]
4753-
}
4753+
}

examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error)
160160
VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR);
161161

162162
Json::Value value;
163-
chip::app::StatusIB status;
164-
status.InitFromChipError(error);
163+
chip::app::StatusIB status(error);
165164
return LogError(value, status);
166165
}
167166

examples/lighting-app/lighting-common/lighting-app.matter

+2-2
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ cluster ColorControl = 768 {
26142614

26152615
/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
26162616
cluster OccupancySensing = 1030 {
2617-
revision 4;
2617+
revision 5;
26182618

26192619
enum OccupancySensorTypeEnum : enum8 {
26202620
kPIR = 0;
@@ -3180,7 +3180,7 @@ endpoint 1 {
31803180
ram attribute occupancySensorType;
31813181
ram attribute occupancySensorTypeBitmap;
31823182
ram attribute featureMap default = 0;
3183-
ram attribute clusterRevision default = 4;
3183+
ram attribute clusterRevision default = 5;
31843184
}
31853185
}
31863186

examples/lighting-app/lighting-common/lighting-app.zap

+1-1
Original file line numberDiff line numberDiff line change
@@ -5903,7 +5903,7 @@
59035903
"storageOption": "RAM",
59045904
"singleton": 0,
59055905
"bounded": 0,
5906-
"defaultValue": "4",
5906+
"defaultValue": "5",
59075907
"reportable": 1,
59085908
"minInterval": 0,
59095909
"maxInterval": 65344,

examples/network-manager-app/linux/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ executable("matter-network-manager-app") {
1919
sources = [
2020
"include/CHIPProjectAppConfig.h",
2121
"main.cpp",
22+
"tbrm.cpp",
2223
]
2324

2425
deps = [
+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
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/thread-border-router-management-server/thread-border-router-management-server.h>
19+
#include <app/server/Server.h>
20+
#include <lib/core/CHIPEncoding.h>
21+
#include <lib/support/CodeUtils.h>
22+
#include <lib/support/Span.h>
23+
#include <lib/support/ThreadOperationalDataset.h>
24+
#include <platform/CHIPDeviceLayer.h>
25+
26+
#include <optional>
27+
28+
using namespace chip;
29+
using namespace chip::literals;
30+
using namespace chip::app;
31+
using namespace chip::app::Clusters;
32+
33+
namespace {
34+
class FakeBorderRouterDelegate final : public ThreadBorderRouterManagement::Delegate
35+
{
36+
CHIP_ERROR Init(AttributeChangeCallback * attributeChangeCallback) override
37+
{
38+
mAttributeChangeCallback = attributeChangeCallback;
39+
return CHIP_NO_ERROR;
40+
}
41+
42+
bool GetPanChangeSupported() override { return true; }
43+
44+
void GetBorderRouterName(MutableCharSpan & borderRouterName) override
45+
{
46+
CopyCharSpanToMutableCharSpan("netman-br"_span, borderRouterName);
47+
}
48+
49+
CHIP_ERROR GetBorderAgentId(MutableByteSpan & borderAgentId) override
50+
{
51+
static constexpr uint8_t kBorderAgentId[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
52+
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
53+
VerifyOrReturnError(borderAgentId.size() == 16, CHIP_ERROR_INVALID_ARGUMENT);
54+
return CopySpanToMutableSpan(ByteSpan(kBorderAgentId), borderAgentId);
55+
}
56+
57+
uint16_t GetThreadVersion() override { return /* Thread 1.3.1 */ 5; }
58+
59+
bool GetInterfaceEnabled() override { return !mActiveDataset.IsEmpty(); }
60+
61+
CHIP_ERROR GetDataset(Thread::OperationalDataset & dataset, DatasetType type) override
62+
{
63+
Thread::OperationalDataset * source;
64+
switch (type)
65+
{
66+
case DatasetType::kActive:
67+
source = &mActiveDataset;
68+
break;
69+
case DatasetType::kPending:
70+
source = &mPendingDataset;
71+
break;
72+
default:
73+
return CHIP_ERROR_INVALID_ARGUMENT;
74+
}
75+
VerifyOrReturnError(!source->IsEmpty(), CHIP_ERROR_NOT_FOUND);
76+
return dataset.Init(source->AsByteSpan());
77+
}
78+
79+
void SetActiveDataset(const Thread::OperationalDataset & activeDataset, uint32_t sequenceNum,
80+
ActivateDatasetCallback * callback) override
81+
{
82+
if (mActivateDatasetCallback != nullptr)
83+
{
84+
callback->OnActivateDatasetComplete(sequenceNum, CHIP_ERROR_INCORRECT_STATE);
85+
return;
86+
}
87+
88+
CHIP_ERROR err = mActiveDataset.Init(activeDataset.AsByteSpan());
89+
if (err != CHIP_NO_ERROR)
90+
{
91+
callback->OnActivateDatasetComplete(sequenceNum, err);
92+
return;
93+
}
94+
95+
mActivateDatasetCallback = callback;
96+
mActivateDatasetSequence = sequenceNum;
97+
DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(3000), CompleteDatasetActivation, this);
98+
}
99+
100+
CHIP_ERROR CommitActiveDataset() override { return CHIP_NO_ERROR; }
101+
CHIP_ERROR RevertActiveDataset() override { return CHIP_ERROR_NOT_IMPLEMENTED; }
102+
CHIP_ERROR SetPendingDataset(const Thread::OperationalDataset & pendingDataset) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
103+
104+
private:
105+
static void CompleteDatasetActivation(System::Layer *, void * context)
106+
{
107+
auto * self = static_cast<FakeBorderRouterDelegate *>(context);
108+
auto * callback = self->mActivateDatasetCallback;
109+
auto sequenceNum = self->mActivateDatasetSequence;
110+
self->mActivateDatasetCallback = nullptr;
111+
callback->OnActivateDatasetComplete(sequenceNum, CHIP_NO_ERROR);
112+
}
113+
114+
AttributeChangeCallback * mAttributeChangeCallback;
115+
Thread::OperationalDataset mActiveDataset;
116+
Thread::OperationalDataset mPendingDataset;
117+
118+
ActivateDatasetCallback * mActivateDatasetCallback = nullptr;
119+
uint32_t mActivateDatasetSequence;
120+
};
121+
122+
FakeBorderRouterDelegate gBorderRouterDelegate{};
123+
} // namespace
124+
125+
std::optional<ThreadBorderRouterManagement::ServerInstance> gThreadBorderRouterManagementServer;
126+
void emberAfThreadBorderRouterManagementClusterInitCallback(EndpointId endpoint)
127+
{
128+
VerifyOrDie(!gThreadBorderRouterManagementServer);
129+
gThreadBorderRouterManagementServer.emplace(endpoint, &gBorderRouterDelegate, Server::GetInstance().GetFailSafeContext())
130+
.Init();
131+
}

0 commit comments

Comments
 (0)