Skip to content

Commit d58f545

Browse files
Merge branch 'release_2.5-1.4' into bugfix/soc_ncp_deepsleep_issue
2 parents ffc1d46 + 3b164b3 commit d58f545

File tree

50 files changed

+1524
-195
lines changed

Some content is hidden

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

50 files changed

+1524
-195
lines changed

examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <platform/PlatformManager.h>
2827

2928
#include <air-quality-sensor-manager.h>

examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2727
#include <app/clusters/switch-server/switch-server.h>
2828
#include <app/server/Server.h>
29-
#include <app/util/att-storage.h>
3029
#include <app/util/attribute-storage.h>
3130
#include <platform/PlatformManager.h>
3231

examples/all-clusters-app/linux/main-common.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include <app/clusters/time-synchronization-server/time-synchronization-server.h>
5454
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h>
5555
#include <app/server/Server.h>
56-
#include <app/util/att-storage.h>
5756
#include <app/util/attribute-storage.h>
5857
#include <lib/support/CHIPMem.h>
5958
#include <platform/DeviceInstanceInfoProvider.h>

examples/all-clusters-minimal-app/linux/main-common.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app/CommandHandler.h>
2222
#include <app/clusters/identify-server/identify-server.h>
2323
#include <app/server/Server.h>
24-
#include <app/util/att-storage.h>
2524
#include <lib/support/CHIPMem.h>
2625
#include <new>
2726
#include <platform/PlatformManager.h>

examples/bridge-app/esp32/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ defined:
5454
definition.
5555

5656
- All attributes defined with these macros will be configured as
57-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
58-
rely on the application to maintain storage for the attribute. Consequently,
59-
reads or writes to these attributes must be handled within the application
60-
by the `emberAfExternalAttributeWriteCallback` and
57+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
58+
will rely on the application to maintain storage for the attribute.
59+
Consequently, reads or writes to these attributes must be handled within the
60+
application by the `emberAfExternalAttributeWriteCallback` and
6161
`emberAfExternalAttributeReadCallback` functions. See the bridge
6262
application's `main.cpp` for an example of this implementation.
6363

examples/bridge-app/linux/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ defined:
4545
definition.
4646

4747
- All attributes defined with these macros will be configured as
48-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
49-
rely on the application to maintain storage for the attribute. Consequently,
50-
reads or writes to these attributes must be handled within the application
51-
by the `emberAfExternalAttributeWriteCallback` and
48+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
49+
will rely on the application to maintain storage for the attribute.
50+
Consequently, reads or writes to these attributes must be handled within the
51+
application by the `emberAfExternalAttributeWriteCallback` and
5252
`emberAfExternalAttributeReadCallback` functions. See the bridge
5353
application's `main.cpp` for an example of this implementation.
5454

examples/bridge-app/telink/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ defined:
5656
definition.
5757

5858
- All attributes defined with these macros will be configured as
59-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
60-
rely on the application to maintain storage for the attribute. Consequently,
61-
reads or writes to these attributes must be handled within the application
62-
by the `emberAfExternalAttributeWriteCallback` and
59+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
60+
will rely on the application to maintain storage for the attribute.
61+
Consequently, reads or writes to these attributes must be handled within the
62+
application by the `emberAfExternalAttributeWriteCallback` and
6363
`emberAfExternalAttributeReadCallback` functions. See the bridge
6464
application's `main.cpp` for an example of this implementation.
6565

examples/chef/common/clusters/switch/SwitchEventHandler.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#ifdef MATTER_DM_PLUGIN_SWITCH_SERVER
2121
#include <app/clusters/switch-server/switch-server.h>
2222
#include <app/server/Server.h>
23-
#include <app/util/att-storage.h>
2423
#include <platform/PlatformManager.h>
2524

2625
#include "SwitchEventHandler.h"

examples/chef/common/clusters/switch/SwitchManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app-common/zap-generated/attributes/Accessors.h>
2222
#include <app/clusters/switch-server/switch-server.h>
2323
#include <app/server/Server.h>
24-
#include <app/util/att-storage.h>
2524
#include <app/util/attribute-storage.h>
2625
#include <platform/PlatformManager.h>
2726

examples/chef/esp32/main/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <app-common/zap-generated/callback.h>
4242
#include <app-common/zap-generated/cluster-objects.h>
4343
#include <app/server/Dnssd.h>
44-
#include <app/util/att-storage.h>
4544
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4645

4746
#include "Display.h"

examples/fabric-bridge-app/linux/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ defined:
5151
definition.
5252

5353
- All attributes defined with these macros will be configured as
54-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
55-
rely on the application to maintain storage for the attribute. Consequently,
56-
reads or writes to these attributes must be handled within the application
57-
by the `emberAfExternalAttributeWriteCallback` and
54+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
55+
will rely on the application to maintain storage for the attribute.
56+
Consequently, reads or writes to these attributes must be handled within the
57+
application by the `emberAfExternalAttributeWriteCallback` and
5858
`emberAfExternalAttributeReadCallback` functions. See the bridge
5959
application's `main.cpp` for an example of this implementation.
6060

examples/fabric-sync/README.md

+185
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Matter Linux Fabric Sync Example
2+
3+
An example application to implement the Fabric Synchronization feature and
4+
demonstrates the end-to-end Fabric Synchronization feature using dynamic
5+
endpoints.
6+
7+
Fabric Synchronization feature will facilitate the commissioning of end devices
8+
from one fabric to another without requiring user intervention for every end
9+
device. It defines mechanisms that can be used by multiple
10+
ecosystems/controllers to communicate with one another to simplify the
11+
experience for users.
12+
13+
This doc is tested on **Ubuntu 22.04 LTS (aarch64)**
14+
15+
<hr>
16+
17+
- [Matter Linux Fabric Sync Example](#matter-linux-fabric-sync-example)
18+
- [Theory of Operation](#theory-of-operation)
19+
- [Building](#building)
20+
- [Running the Complete Example on Ubuntu](#running-the-complete-example-on-ubuntu)
21+
22+
<hr>
23+
24+
## Theory of Operation
25+
26+
### Dynamic Endpoints
27+
28+
The Fabric-Sync Example makes use of Dynamic Endpoints. Current SDK support is
29+
limited for dynamic endpoints, since endpoints are typically defined (along with
30+
the clusters and attributes they contain) in a .zap file which then generates
31+
code and static structures to define the endpoints.
32+
33+
To support endpoints that are not statically defined, the ZCL attribute storage
34+
mechanisms will hold additional endpoint information for `NUM_DYNAMIC_ENDPOINTS`
35+
additional endpoints. These additional endpoint structures must be defined by
36+
the application and can change at runtime.
37+
38+
To facilitate the creation of these endpoint structures, several macros are
39+
defined:
40+
41+
`DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(attrListName)`
42+
`DECLARE_DYNAMIC_ATTRIBUTE(attId, attType, attSizeBytes, attrMask)`
43+
`DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(clusterRevision)`
44+
45+
- These three macros are used to declare a list of attributes for use within a
46+
cluster. The declaration must begin with the
47+
`DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN` macro which will define the name of
48+
the allocated attribute structure. Each attribute is then added by the
49+
`DECLARE_DYNAMIC_ATTRIBUTE` macro. Finally,
50+
`DECLARE_DYNAMIC_ATTRIBUTE_LIST_END` macro should be used to close the
51+
definition.
52+
53+
- All attributes defined with these macros will be configured as
54+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
55+
will rely on the application to maintain storage for the attribute.
56+
Consequently, reads or writes to these attributes must be handled within the
57+
application by the `emberAfExternalAttributeWriteCallback` and
58+
`emberAfExternalAttributeReadCallback` functions. See the bridge
59+
application's `main.cpp` for an example of this implementation.
60+
61+
`DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(clusterListName)`
62+
`DECLARE_DYNAMIC_CLUSTER(clusterId, clusterAttrs, role, incomingCommands, outgoingCommands)`
63+
`DECLARE_DYNAMIC_CLUSTER_LIST_END`
64+
65+
- These three macros are used to declare a list of clusters for use within a
66+
endpoint. The declaration must begin with the
67+
`DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN` macro which will define the name of the
68+
allocated cluster structure. Each cluster is then added by the
69+
`DECLARE_DYNAMIC_CLUSTER` macro referencing attribute list previously
70+
defined by the `DECLARE_DYNAMIC_ATTRIBUTE...` macros and the lists of
71+
incoming/outgoing commands terminated by kInvalidCommandId (or nullptr if
72+
there aren't any commands in the list). Finally,
73+
`DECLARE_DYNAMIC_CLUSTER_LIST_END` macro should be used to close the
74+
definition.
75+
76+
`DECLARE_DYNAMIC_ENDPOINT(endpointName, clusterList)`
77+
78+
- This macro is used to declare an endpoint and its associated cluster list,
79+
which must be previously defined by the `DECLARE_DYNAMIC_CLUSTER...` macros.
80+
81+
## Building
82+
83+
- For Linux host example:
84+
85+
```sh
86+
source scripts/activate.sh
87+
./scripts/build/build_examples.py --target linux-x64-fabric-sync-no-ble build
88+
```
89+
90+
- For Raspberry Pi 4 example:
91+
92+
Pull Docker Images
93+
94+
```sh
95+
docker pull ghcr.io/project-chip/chip-build-crosscompile:112
96+
```
97+
98+
Run docker
99+
100+
```sh
101+
docker run -it -v ~/connectedhomeip:/var/connectedhomeip ghcr.io/project-chip/chip-build-crosscompile:112 /bin/bash
102+
```
103+
104+
Build
105+
106+
```sh
107+
cd /var/connectedhomeip
108+
109+
git config --global --add safe.directory /var/connectedhomeip
110+
111+
./scripts/run_in_build_env.sh \
112+
"./scripts/build/build_examples.py \
113+
--target linux-arm64-fabric-sync-no-ble-clang \
114+
build"
115+
```
116+
117+
Transfer the fabric-bridge-app binary to a Raspberry Pi
118+
119+
```sh
120+
scp ./fabric-sync ubuntu@xxx.xxx.xxx.xxx:/home/ubuntu
121+
```
122+
123+
## Running the Complete Example on Ubuntu
124+
125+
- Building
126+
127+
Follow [Building](#building) section of this document.
128+
129+
- Run Linux Fabric Sync Example App on two Linux machine E1 and E2
130+
131+
```sh
132+
sudo rm -rf /tmp/chip_*
133+
cd ~/connectedhomeip/
134+
out/debug/fabric-sync
135+
```
136+
137+
- Initiate the FS Setup Process from E1 to E2
138+
139+
```sh
140+
> app add-bridge 1 20202021 192.168.86.246 5540
141+
Done
142+
> New device with Node ID: 0000000000000001 has been successfully added.
143+
A new device has been added on Endpoint: 2.
144+
```
145+
146+
- Verify Reverse Commissioning of the Fabric-Bridge from E1 on E2
147+
148+
```sh
149+
> New device with Node ID: 0000000000000002 has been successfully added.
150+
```
151+
152+
- Pair Light Example to E2
153+
154+
Since Fabric-Bridge also functions as a Matter server, running it alongside
155+
the Light Example app on the same machine would cause conflicts. Therefore,
156+
you need to run the Matter Light Example app on a separate physical machine
157+
from the one hosting Fabric-Sync.
158+
159+
```sh
160+
> app add-device 3 <setup-pin-code> <device-remote-ip> <device-remote-port>
161+
```
162+
163+
After the device is successfully added, you will observe the following
164+
message on E2 with the newly assigned Node ID:
165+
166+
```sh
167+
> New device with Node ID: 0x3 has been successfully added.
168+
```
169+
170+
Additionally, you should also get notified when a new device is added to E2
171+
from the E1:
172+
173+
```sh
174+
> A new device is added on Endpoint 3.
175+
```
176+
177+
- Synchronize Light Example to E1
178+
179+
After the Light Example is successfully paired in E2, we can start to
180+
synchronize the light device to E1 using the new assigned dynamic endpointid
181+
on Ecosystem 2.
182+
183+
```sh
184+
> app sync-device <endpointid>
185+
```

examples/lighting-app-data-mode-no-unique-id/linux/LightingAppCommandDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <app/util/attribute-storage.h>
2827
#include <platform/PlatformManager.h>
2928

examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "LightingManager.h"
2121
#include <app-common/zap-generated/attributes/Accessors.h>
22-
#include <app/util/att-storage.h>
2322
#include <stdio.h>
2423

2524
using namespace chip;

examples/lighting-app/linux/LightingAppCommandDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <app/util/attribute-storage.h>
2827
#include <platform/PlatformManager.h>
2928

examples/platform/silabs/Rpc.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "pigweed/RpcService.h"
2222
#include "pw_sys_io_efr32/init.h"
2323
#include <cmsis_os2.h>
24+
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
2425
#include <sl_cmsis_os2_common.h>
2526

2627
#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
@@ -73,6 +74,8 @@ size_t pw_trace_GetTraceTimeTicksPerSecond()
7374

7475
#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE
7576

77+
using namespace chip::DeviceLayer::Silabs;
78+
7679
namespace chip {
7780
namespace rpc {
7881

@@ -117,7 +120,7 @@ class Efr32Device final : public Device
117120
osTimer_t mRebootTimerBuffer;
118121
osTimerAttr_t mRebootTimerAttr = { .name = "Reboot", .cb_mem = &mRebootTimerBuffer, .cb_size = osTimerCbSize };
119122

120-
static void RebootHandler(void * timerCbArg) { NVIC_SystemReset(); }
123+
static void RebootHandler(void * timerCbArg) { GetPlatform().SoftwareReset(); }
121124
};
122125
#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
123126

@@ -225,6 +228,5 @@ void Init()
225228
// Start App task.
226229
sRpcTaskHandle = osThreadNew(RunRpcService, nullptr, &kRpcTaskAttr);
227230
}
228-
229231
} // namespace rpc
230232
} // namespace chip

src/app/AttributePathExpandIterator-Ember.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app/ConcreteAttributePath.h>
2323
#include <app/EventManagement.h>
2424
#include <app/GlobalAttributes.h>
25-
#include <app/util/att-storage.h>
2625
#include <app/util/endpoint-config-api.h>
2726
#include <lib/core/CHIPCore.h>
2827
#include <lib/core/TLVDebug.h>
@@ -98,7 +97,7 @@ void AttributePathExpandIteratorEmber::PrepareClusterIndexRange(const AttributeP
9897
}
9998
else
10099
{
101-
mClusterIndex = emberAfClusterIndex(aEndpointId, aAttributePath.mClusterId, CLUSTER_MASK_SERVER);
100+
mClusterIndex = emberAfClusterIndex(aEndpointId, aAttributePath.mClusterId, MATTER_CLUSTER_FLAG_SERVER);
102101
// If the given cluster id does not exist on the given endpoint, it will return uint8(0xFF), then endClusterIndex
103102
// will be 0, means we should iterate a null cluster set (skip it).
104103
mEndClusterIndex = static_cast<uint8_t>(mClusterIndex + 1);

src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app/CommandHandler.h>
2323
#include <app/MessageDef/StatusIB.h>
2424
#include <app/server/Server.h>
25-
#include <app/util/att-storage.h>
2625
#include <app/util/attribute-storage.h>
2726
#include <credentials/GroupDataProvider.h>
2827
#include <lib/support/CodeUtils.h>

0 commit comments

Comments
 (0)