Skip to content

Commit 3b8999a

Browse files
authored
Merge branch 'master' into UpdateTIApplications_OTA_Documentation
2 parents e927c12 + d033f8b commit 3b8999a

File tree

91 files changed

+2548
-508
lines changed

Some content is hidden

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

91 files changed

+2548
-508
lines changed

docs/guides/esp32/providers.md

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Below are the providers that have been implemented:
1515
- [Device Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32DeviceInfoProvider.h#L31)
1616
This provider provides fixed labels, supported calendar types, and supported
1717
locales from the factory partition.
18-
- [Supported Modes](https://github.com/project-chip/connectedhomeip/blob/master/examples/platform/esp32/mode-support/static-supported-modes-manager.h#L28)
19-
This provider offers the supported modes for the mode-select cluster.
2018

2119
More information can be found in the [factory data guide](factory_data.md).
2220

examples/all-clusters-app/esp32/main/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ set(SRC_DIRS_LIST
3434
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
3535
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
3636
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
37-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/mode-support"
3837
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
3938
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
4039
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
@@ -106,8 +105,6 @@ set(SRC_DIRS_LIST
106105
)
107106

108107

109-
set(EXCLUDE_SRCS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp")
110-
111108
if (CONFIG_ENABLE_PW_RPC)
112109
# Append additional directories for RPC build
113110
set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}"

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

-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <common/Esp32ThreadInit.h>
4242
#include <credentials/DeviceAttestationCredsProvider.h>
4343
#include <credentials/examples/DeviceAttestationCredsExample.h>
44-
#include <examples/platform/esp32/mode-support/static-supported-modes-manager.h>
4544
#include <platform/ESP32/ESP32Utils.h>
4645
#include <static-supported-temperature-levels.h>
4746

@@ -122,13 +121,6 @@ static void InitServer(intptr_t context)
122121
#if CONFIG_DEVICE_TYPE_M5STACK
123122
SetupPretendDevices();
124123
#endif
125-
CHIP_ERROR err =
126-
app::Clusters::ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray(
127-
FIXED_ENDPOINT_COUNT);
128-
if (err != CHIP_NO_ERROR)
129-
{
130-
ESP_LOGE(TAG, "Failed to initialize endpoint array for supported-modes, err:%" CHIP_ERROR_FORMAT, err.Format());
131-
}
132124

133125
app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
134126
}

examples/chef/chef.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def main() -> int:
878878
"""))
879879
if options.do_clean:
880880
shell.run_cmd("rm -rf out")
881-
shell.run_cmd("gn gen out")
881+
shell.run_cmd("gn gen --export-compile-commands out")
882882
shell.run_cmd("ninja -C out")
883883

884884
#

examples/chip-tool/commands/clusters/ClusterCommand.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "DataModelLogger.h"
2222
#include "ModelCommand.h"
2323
#include <app/tests/suites/commands/interaction_model/InteractionModel.h>
24+
#include <lib/core/ClusterEnums.h>
2425

2526
class ClusterCommand : public InteractionModelCommands, public ModelCommand, public chip::app::CommandSender::Callback
2627
{
@@ -70,6 +71,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
7071
ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value));
7172
mScopedNodeId = chip::ScopedNodeId(value.checkInNodeID, device->GetSecureSession().Value()->GetFabricIndex());
7273
mMonitoredSubject = value.monitoredSubject;
74+
mClientType = value.clientType;
7375
memcpy(mICDSymmetricKey, value.key.data(), value.key.size());
7476
return CHIP_NO_ERROR;
7577
}
@@ -148,6 +150,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
148150
clientInfo.peer_node = mScopedNodeId;
149151
clientInfo.monitored_subject = mMonitoredSubject;
150152
clientInfo.start_icd_counter = value.ICDCounter;
153+
clientInfo.client_type = mClientType;
151154

152155
StoreICDEntryWithKey(clientInfo, chip::ByteSpan(mICDSymmetricKey));
153156
}
@@ -258,8 +261,10 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
258261
chip::ClusterId mClusterId;
259262
chip::CommandId mCommandId;
260263
chip::ScopedNodeId mScopedNodeId;
261-
uint64_t mMonitoredSubject = static_cast<uint64_t>(0);
264+
uint64_t mMonitoredSubject = static_cast<uint64_t>(0);
265+
chip::app::Clusters::IcdManagement::ClientTypeEnum mClientType = chip::app::Clusters::IcdManagement::ClientTypeEnum::kPermanent;
262266
uint8_t mICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length];
267+
263268
CHIP_ERROR mError = CHIP_NO_ERROR;
264269
CustomArgument mPayload;
265270
};

examples/chip-tool/commands/icd/ICDCommand.cpp

+13-11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <app/icd/client/DefaultICDClientStorage.h>
2222
#include <crypto/DefaultSessionKeystore.h>
2323
#include <crypto/RawKeySessionKeystore.h>
24+
#include <string>
2425

2526
using namespace ::chip;
2627
using namespace ::chip::app;
@@ -36,31 +37,32 @@ CHIP_ERROR ICDListCommand::RunCommand()
3637
return CHIP_ERROR_NO_MEMORY;
3738
}
3839
app::DefaultICDClientStorage::ICDClientInfoIteratorWrapper clientInfoIteratorWrapper(iter);
39-
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
40-
fprintf(stderr, " | %-75s |\n", "Known ICDs:");
41-
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
42-
fprintf(stderr, " | %20s | %15s | %15s | %16s |\n", "Fabric Index:Node ID", "Start Counter", "Counter Offset",
43-
"MonitoredSubject");
40+
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
41+
fprintf(stderr, " | %-88s |\n", "Known ICDs:");
42+
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
43+
fprintf(stderr, " | %20s | %15s | %15s | %16s | %10s |\n", "Fabric Index:Node ID", "Start Counter", "Counter Offset",
44+
"MonitoredSubject", "ClientType");
4445

4546
while (iter->Next(info))
4647
{
47-
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
48-
fprintf(stderr, " | %3" PRIu32 ":" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " |\n",
48+
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
49+
fprintf(stderr, " | %3" PRIu32 ":" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " | %10u |\n",
4950
static_cast<uint32_t>(info.peer_node.GetFabricIndex()), ChipLogValueX64(info.peer_node.GetNodeId()),
50-
info.start_icd_counter, info.offset, ChipLogValueX64(info.monitored_subject));
51+
info.start_icd_counter, info.offset, ChipLogValueX64(info.monitored_subject),
52+
static_cast<uint8_t>(info.client_type));
5153

5254
static_assert(std::is_same<decltype(CHIPCommand::sSessionKeystore), Crypto::RawKeySessionKeystore>::value,
5355
"The following BytesToHex can copy/encode the key bytes from sharedKey to hexadecimal format, which only "
5456
"works for RawKeySessionKeystore");
5557
Encoding::BytesToHex(info.aes_key_handle.As<Crypto::Symmetric128BitsKeyByteArray>(), Crypto::kAES_CCM128_Key_Length,
5658
icdAesKeyHex, sizeof(icdAesKeyHex), chip::Encoding::HexFlags::kNullTerminate);
57-
fprintf(stderr, " | aes key: %60s |\n", icdAesKeyHex);
59+
fprintf(stderr, " | aes key: %60s |\n", icdAesKeyHex);
5860
Encoding::BytesToHex(info.hmac_key_handle.As<Crypto::Symmetric128BitsKeyByteArray>(), Crypto::kHMAC_CCM128_Key_Length,
5961
icdHmacKeyHex, sizeof(icdHmacKeyHex), chip::Encoding::HexFlags::kNullTerminate);
60-
fprintf(stderr, " | hmac key: %60s |\n", icdHmacKeyHex);
62+
fprintf(stderr, " | hmac key: %60s |\n", icdHmacKeyHex);
6163
}
6264

63-
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
65+
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
6466
SetCommandExitStatus(CHIP_NO_ERROR);
6567
return CHIP_NO_ERROR;
6668
}

examples/chip-tool/commands/pairing/PairingCommand.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
157157
{
158158
mICDMonitoredSubject.SetValue(mICDCheckInNodeId.Value());
159159
}
160+
if (!mICDClientType.HasValue())
161+
{
162+
mICDClientType.SetValue(app::Clusters::IcdManagement::ClientTypeEnum::kPermanent);
163+
}
160164
// These Optionals must have values now.
161165
// The commissioner will verify these values.
162166
params.SetICDSymmetricKey(mICDSymmetricKey.Value());
@@ -166,6 +170,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
166170
}
167171
params.SetICDCheckInNodeId(mICDCheckInNodeId.Value());
168172
params.SetICDMonitoredSubject(mICDMonitoredSubject.Value());
173+
params.SetICDClientType(mICDClientType.Value());
169174
}
170175

171176
return params;
@@ -459,7 +464,7 @@ void PairingCommand::OnICDRegistrationComplete(ScopedNodeId nodeId, uint32_t icd
459464
sizeof(icdSymmetricKeyHex), chip::Encoding::HexFlags::kNullTerminate);
460465

461466
app::ICDClientInfo clientInfo;
462-
clientInfo.peer_node = nodeId;
467+
clientInfo.peer_node = chip::ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
463468
clientInfo.monitored_subject = mICDMonitoredSubject.Value();
464469
clientInfo.start_icd_counter = icdCounter;
465470

examples/chip-tool/commands/pairing/PairingCommand.h

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class PairingCommand : public CHIPCommand,
7474
"The check-in node id for the ICD, default: node id of the commissioner.");
7575
AddArgument("icd-monitored-subject", 0, UINT64_MAX, &mICDMonitoredSubject,
7676
"The monitored subject of the ICD, default: The node id used for icd-check-in-nodeid.");
77+
AddArgument("icd-client-type", 0, 1, &mICDClientType,
78+
"The ClientType of the client registering, default: Permanent client - 0");
7779
AddArgument("icd-symmetric-key", &mICDSymmetricKey, "The 16 bytes ICD symmetric key, default: randomly generated.");
7880
AddArgument("icd-stay-active-duration", 0, UINT32_MAX, &mICDStayActiveDurationMsec,
7981
"If set, a LIT ICD that is commissioned will be requested to stay active for this many milliseconds");
@@ -245,6 +247,7 @@ class PairingCommand : public CHIPCommand,
245247
chip::Optional<NodeId> mICDCheckInNodeId;
246248
chip::Optional<chip::ByteSpan> mICDSymmetricKey;
247249
chip::Optional<uint64_t> mICDMonitoredSubject;
250+
chip::Optional<chip::app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
248251
chip::Optional<uint32_t> mICDStayActiveDurationMsec;
249252
chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type> mTimeZoneList;
250253
TypedComplexArgument<chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type>>

examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter

+7
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,11 @@ cluster BooleanState = 69 {
13151315
cluster IcdManagement = 70 {
13161316
revision 2;
13171317

1318+
enum ClientTypeEnum : enum8 {
1319+
kPermanent = 0;
1320+
kEphemeral = 1;
1321+
}
1322+
13181323
enum OperatingModeEnum : enum8 {
13191324
kSIT = 0;
13201325
kLIT = 1;
@@ -1349,6 +1354,7 @@ cluster IcdManagement = 70 {
13491354
fabric_scoped struct MonitoringRegistrationStruct {
13501355
fabric_sensitive node_id checkInNodeID = 1;
13511356
fabric_sensitive int64u monitoredSubject = 2;
1357+
fabric_sensitive ClientTypeEnum clientType = 4;
13521358
fabric_idx fabricIndex = 254;
13531359
}
13541360

@@ -1373,6 +1379,7 @@ cluster IcdManagement = 70 {
13731379
int64u monitoredSubject = 1;
13741380
octet_string<16> key = 2;
13751381
optional octet_string<16> verificationKey = 3;
1382+
ClientTypeEnum clientType = 4;
13761383
}
13771384

13781385
response struct RegisterClientResponse = 1 {

examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter

+7
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,11 @@ cluster BooleanState = 69 {
13151315
cluster IcdManagement = 70 {
13161316
revision 2;
13171317

1318+
enum ClientTypeEnum : enum8 {
1319+
kPermanent = 0;
1320+
kEphemeral = 1;
1321+
}
1322+
13181323
enum OperatingModeEnum : enum8 {
13191324
kSIT = 0;
13201325
kLIT = 1;
@@ -1349,6 +1354,7 @@ cluster IcdManagement = 70 {
13491354
fabric_scoped struct MonitoringRegistrationStruct {
13501355
fabric_sensitive node_id checkInNodeID = 1;
13511356
fabric_sensitive int64u monitoredSubject = 2;
1357+
fabric_sensitive ClientTypeEnum clientType = 4;
13521358
fabric_idx fabricIndex = 254;
13531359
}
13541360

@@ -1373,6 +1379,7 @@ cluster IcdManagement = 70 {
13731379
int64u monitoredSubject = 1;
13741380
octet_string<16> key = 2;
13751381
optional octet_string<16> verificationKey = 3;
1382+
ClientTypeEnum clientType = 4;
13761383
}
13771384

13781385
response struct RegisterClientResponse = 1 {

examples/fabric-admin/commands/pairing/PairingCommand.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
157157
{
158158
mICDMonitoredSubject.SetValue(mICDCheckInNodeId.Value());
159159
}
160+
if (!mICDClientType.HasValue())
161+
{
162+
mICDClientType.SetValue(app::Clusters::IcdManagement::ClientTypeEnum::kPermanent);
163+
}
160164
// These Optionals must have values now.
161165
// The commissioner will verify these values.
162166
params.SetICDSymmetricKey(mICDSymmetricKey.Value());
@@ -166,6 +170,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
166170
}
167171
params.SetICDCheckInNodeId(mICDCheckInNodeId.Value());
168172
params.SetICDMonitoredSubject(mICDMonitoredSubject.Value());
173+
params.SetICDClientType(mICDClientType.Value());
169174
}
170175

171176
return params;
@@ -459,7 +464,7 @@ void PairingCommand::OnICDRegistrationComplete(ScopedNodeId nodeId, uint32_t icd
459464
sizeof(icdSymmetricKeyHex), chip::Encoding::HexFlags::kNullTerminate);
460465

461466
app::ICDClientInfo clientInfo;
462-
clientInfo.peer_node = nodeId;
467+
clientInfo.peer_node = chip::ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
463468
clientInfo.monitored_subject = mICDMonitoredSubject.Value();
464469
clientInfo.start_icd_counter = icdCounter;
465470

examples/fabric-admin/commands/pairing/PairingCommand.h

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class PairingCommand : public CHIPCommand,
8484
"The check-in node id for the ICD, default: node id of the commissioner.");
8585
AddArgument("icd-monitored-subject", 0, UINT64_MAX, &mICDMonitoredSubject,
8686
"The monitored subject of the ICD, default: The node id used for icd-check-in-nodeid.");
87+
AddArgument("icd-client-type", 0, 1, &mICDClientType,
88+
"The ClientType of the client registering, default: Permanent client - 0");
8789
AddArgument("icd-symmetric-key", &mICDSymmetricKey, "The 16 bytes ICD symmetric key, default: randomly generated.");
8890
AddArgument("icd-stay-active-duration", 0, UINT32_MAX, &mICDStayActiveDurationMsec,
8991
"If set, a LIT ICD that is commissioned will be requested to stay active for this many milliseconds");
@@ -258,6 +260,7 @@ class PairingCommand : public CHIPCommand,
258260
chip::Optional<char *> mCountryCode;
259261
chip::Optional<bool> mICDRegistration;
260262
chip::Optional<NodeId> mICDCheckInNodeId;
263+
chip::Optional<chip::app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
261264
chip::Optional<chip::ByteSpan> mICDSymmetricKey;
262265
chip::Optional<uint64_t> mICDMonitoredSubject;
263266
chip::Optional<uint32_t> mICDStayActiveDurationMsec;

examples/light-switch-app/light-switch-common/light-switch-app.matter

+7
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,11 @@ cluster UserLabel = 65 {
19391939
cluster IcdManagement = 70 {
19401940
revision 2;
19411941

1942+
enum ClientTypeEnum : enum8 {
1943+
kPermanent = 0;
1944+
kEphemeral = 1;
1945+
}
1946+
19421947
enum OperatingModeEnum : enum8 {
19431948
kSIT = 0;
19441949
kLIT = 1;
@@ -1973,6 +1978,7 @@ cluster IcdManagement = 70 {
19731978
fabric_scoped struct MonitoringRegistrationStruct {
19741979
fabric_sensitive node_id checkInNodeID = 1;
19751980
fabric_sensitive int64u monitoredSubject = 2;
1981+
fabric_sensitive ClientTypeEnum clientType = 4;
19761982
fabric_idx fabricIndex = 254;
19771983
}
19781984

@@ -1997,6 +2003,7 @@ cluster IcdManagement = 70 {
19972003
int64u monitoredSubject = 1;
19982004
octet_string<16> key = 2;
19992005
optional octet_string<16> verificationKey = 3;
2006+
ClientTypeEnum clientType = 4;
20002007
}
20012008

20022009
response struct RegisterClientResponse = 1 {

examples/light-switch-app/qpg/zap/switch.matter

+7
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,11 @@ cluster UserLabel = 65 {
17361736
cluster IcdManagement = 70 {
17371737
revision 2;
17381738

1739+
enum ClientTypeEnum : enum8 {
1740+
kPermanent = 0;
1741+
kEphemeral = 1;
1742+
}
1743+
17391744
enum OperatingModeEnum : enum8 {
17401745
kSIT = 0;
17411746
kLIT = 1;
@@ -1770,6 +1775,7 @@ cluster IcdManagement = 70 {
17701775
fabric_scoped struct MonitoringRegistrationStruct {
17711776
fabric_sensitive node_id checkInNodeID = 1;
17721777
fabric_sensitive int64u monitoredSubject = 2;
1778+
fabric_sensitive ClientTypeEnum clientType = 4;
17731779
fabric_idx fabricIndex = 254;
17741780
}
17751781

@@ -1794,6 +1800,7 @@ cluster IcdManagement = 70 {
17941800
int64u monitoredSubject = 1;
17951801
octet_string<16> key = 2;
17961802
optional octet_string<16> verificationKey = 3;
1803+
ClientTypeEnum clientType = 4;
17971804
}
17981805

17991806
response struct RegisterClientResponse = 1 {

examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter

+7
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,11 @@ cluster BooleanState = 69 {
14131413
cluster IcdManagement = 70 {
14141414
revision 2;
14151415

1416+
enum ClientTypeEnum : enum8 {
1417+
kPermanent = 0;
1418+
kEphemeral = 1;
1419+
}
1420+
14161421
enum OperatingModeEnum : enum8 {
14171422
kSIT = 0;
14181423
kLIT = 1;
@@ -1447,6 +1452,7 @@ cluster IcdManagement = 70 {
14471452
fabric_scoped struct MonitoringRegistrationStruct {
14481453
fabric_sensitive node_id checkInNodeID = 1;
14491454
fabric_sensitive int64u monitoredSubject = 2;
1455+
fabric_sensitive ClientTypeEnum clientType = 4;
14501456
fabric_idx fabricIndex = 254;
14511457
}
14521458

@@ -1471,6 +1477,7 @@ cluster IcdManagement = 70 {
14711477
int64u monitoredSubject = 1;
14721478
octet_string<16> key = 2;
14731479
optional octet_string<16> verificationKey = 3;
1480+
ClientTypeEnum clientType = 4;
14741481
}
14751482

14761483
response struct RegisterClientResponse = 1 {

0 commit comments

Comments
 (0)