Skip to content

Commit

Permalink
Merge branch 'master' into UpdateTIApplications_OTA_Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adabreuti authored Jul 1, 2024
2 parents e927c12 + d033f8b commit 3b8999a
Show file tree
Hide file tree
Showing 91 changed files with 2,548 additions and 508 deletions.
2 changes: 0 additions & 2 deletions docs/guides/esp32/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Below are the providers that have been implemented:
- [Device Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32DeviceInfoProvider.h#L31)
This provider provides fixed labels, supported calendar types, and supported
locales from the factory partition.
- [Supported Modes](https://github.com/project-chip/connectedhomeip/blob/master/examples/platform/esp32/mode-support/static-supported-modes-manager.h#L28)
This provider offers the supported modes for the mode-select cluster.

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

Expand Down
3 changes: 0 additions & 3 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/mode-support"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
Expand Down Expand Up @@ -106,8 +105,6 @@ set(SRC_DIRS_LIST
)


set(EXCLUDE_SRCS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp")

if (CONFIG_ENABLE_PW_RPC)
# Append additional directories for RPC build
set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}"
Expand Down
8 changes: 0 additions & 8 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <common/Esp32ThreadInit.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <examples/platform/esp32/mode-support/static-supported-modes-manager.h>
#include <platform/ESP32/ESP32Utils.h>
#include <static-supported-temperature-levels.h>

Expand Down Expand Up @@ -122,13 +121,6 @@ static void InitServer(intptr_t context)
#if CONFIG_DEVICE_TYPE_M5STACK
SetupPretendDevices();
#endif
CHIP_ERROR err =
app::Clusters::ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray(
FIXED_ENDPOINT_COUNT);
if (err != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "Failed to initialize endpoint array for supported-modes, err:%" CHIP_ERROR_FORMAT, err.Format());
}

app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def main() -> int:
"""))
if options.do_clean:
shell.run_cmd("rm -rf out")
shell.run_cmd("gn gen out")
shell.run_cmd("gn gen --export-compile-commands out")
shell.run_cmd("ninja -C out")

#
Expand Down
7 changes: 6 additions & 1 deletion examples/chip-tool/commands/clusters/ClusterCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "DataModelLogger.h"
#include "ModelCommand.h"
#include <app/tests/suites/commands/interaction_model/InteractionModel.h>
#include <lib/core/ClusterEnums.h>

class ClusterCommand : public InteractionModelCommands, public ModelCommand, public chip::app::CommandSender::Callback
{
Expand Down Expand Up @@ -70,6 +71,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value));
mScopedNodeId = chip::ScopedNodeId(value.checkInNodeID, device->GetSecureSession().Value()->GetFabricIndex());
mMonitoredSubject = value.monitoredSubject;
mClientType = value.clientType;
memcpy(mICDSymmetricKey, value.key.data(), value.key.size());
return CHIP_NO_ERROR;
}
Expand Down Expand Up @@ -148,6 +150,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
clientInfo.peer_node = mScopedNodeId;
clientInfo.monitored_subject = mMonitoredSubject;
clientInfo.start_icd_counter = value.ICDCounter;
clientInfo.client_type = mClientType;

StoreICDEntryWithKey(clientInfo, chip::ByteSpan(mICDSymmetricKey));
}
Expand Down Expand Up @@ -258,8 +261,10 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
chip::ClusterId mClusterId;
chip::CommandId mCommandId;
chip::ScopedNodeId mScopedNodeId;
uint64_t mMonitoredSubject = static_cast<uint64_t>(0);
uint64_t mMonitoredSubject = static_cast<uint64_t>(0);
chip::app::Clusters::IcdManagement::ClientTypeEnum mClientType = chip::app::Clusters::IcdManagement::ClientTypeEnum::kPermanent;
uint8_t mICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length];

CHIP_ERROR mError = CHIP_NO_ERROR;
CustomArgument mPayload;
};
24 changes: 13 additions & 11 deletions examples/chip-tool/commands/icd/ICDCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <app/icd/client/DefaultICDClientStorage.h>
#include <crypto/DefaultSessionKeystore.h>
#include <crypto/RawKeySessionKeystore.h>
#include <string>

using namespace ::chip;
using namespace ::chip::app;
Expand All @@ -36,31 +37,32 @@ CHIP_ERROR ICDListCommand::RunCommand()
return CHIP_ERROR_NO_MEMORY;
}
app::DefaultICDClientStorage::ICDClientInfoIteratorWrapper clientInfoIteratorWrapper(iter);
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
fprintf(stderr, " | %-75s |\n", "Known ICDs:");
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
fprintf(stderr, " | %20s | %15s | %15s | %16s |\n", "Fabric Index:Node ID", "Start Counter", "Counter Offset",
"MonitoredSubject");
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
fprintf(stderr, " | %-88s |\n", "Known ICDs:");
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
fprintf(stderr, " | %20s | %15s | %15s | %16s | %10s |\n", "Fabric Index:Node ID", "Start Counter", "Counter Offset",
"MonitoredSubject", "ClientType");

while (iter->Next(info))
{
fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
fprintf(stderr, " | %3" PRIu32 ":" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " |\n",
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
fprintf(stderr, " | %3" PRIu32 ":" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " | %10u |\n",
static_cast<uint32_t>(info.peer_node.GetFabricIndex()), ChipLogValueX64(info.peer_node.GetNodeId()),
info.start_icd_counter, info.offset, ChipLogValueX64(info.monitored_subject));
info.start_icd_counter, info.offset, ChipLogValueX64(info.monitored_subject),
static_cast<uint8_t>(info.client_type));

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

fprintf(stderr, " +-----------------------------------------------------------------------------+\n");
fprintf(stderr, " +------------------------------------------------------------------------------------------+\n");
SetCommandExitStatus(CHIP_NO_ERROR);
return CHIP_NO_ERROR;
}
Expand Down
7 changes: 6 additions & 1 deletion examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
{
mICDMonitoredSubject.SetValue(mICDCheckInNodeId.Value());
}
if (!mICDClientType.HasValue())
{
mICDClientType.SetValue(app::Clusters::IcdManagement::ClientTypeEnum::kPermanent);
}
// These Optionals must have values now.
// The commissioner will verify these values.
params.SetICDSymmetricKey(mICDSymmetricKey.Value());
Expand All @@ -166,6 +170,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
}
params.SetICDCheckInNodeId(mICDCheckInNodeId.Value());
params.SetICDMonitoredSubject(mICDMonitoredSubject.Value());
params.SetICDClientType(mICDClientType.Value());
}

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

app::ICDClientInfo clientInfo;
clientInfo.peer_node = nodeId;
clientInfo.peer_node = chip::ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
clientInfo.monitored_subject = mICDMonitoredSubject.Value();
clientInfo.start_icd_counter = icdCounter;

Expand Down
3 changes: 3 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class PairingCommand : public CHIPCommand,
"The check-in node id for the ICD, default: node id of the commissioner.");
AddArgument("icd-monitored-subject", 0, UINT64_MAX, &mICDMonitoredSubject,
"The monitored subject of the ICD, default: The node id used for icd-check-in-nodeid.");
AddArgument("icd-client-type", 0, 1, &mICDClientType,
"The ClientType of the client registering, default: Permanent client - 0");
AddArgument("icd-symmetric-key", &mICDSymmetricKey, "The 16 bytes ICD symmetric key, default: randomly generated.");
AddArgument("icd-stay-active-duration", 0, UINT32_MAX, &mICDStayActiveDurationMsec,
"If set, a LIT ICD that is commissioned will be requested to stay active for this many milliseconds");
Expand Down Expand Up @@ -245,6 +247,7 @@ class PairingCommand : public CHIPCommand,
chip::Optional<NodeId> mICDCheckInNodeId;
chip::Optional<chip::ByteSpan> mICDSymmetricKey;
chip::Optional<uint64_t> mICDMonitoredSubject;
chip::Optional<chip::app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
chip::Optional<uint32_t> mICDStayActiveDurationMsec;
chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type> mTimeZoneList;
TypedComplexArgument<chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ cluster BooleanState = 69 {
cluster IcdManagement = 70 {
revision 2;

enum ClientTypeEnum : enum8 {
kPermanent = 0;
kEphemeral = 1;
}

enum OperatingModeEnum : enum8 {
kSIT = 0;
kLIT = 1;
Expand Down Expand Up @@ -1349,6 +1354,7 @@ cluster IcdManagement = 70 {
fabric_scoped struct MonitoringRegistrationStruct {
fabric_sensitive node_id checkInNodeID = 1;
fabric_sensitive int64u monitoredSubject = 2;
fabric_sensitive ClientTypeEnum clientType = 4;
fabric_idx fabricIndex = 254;
}

Expand All @@ -1373,6 +1379,7 @@ cluster IcdManagement = 70 {
int64u monitoredSubject = 1;
octet_string<16> key = 2;
optional octet_string<16> verificationKey = 3;
ClientTypeEnum clientType = 4;
}

response struct RegisterClientResponse = 1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ cluster BooleanState = 69 {
cluster IcdManagement = 70 {
revision 2;

enum ClientTypeEnum : enum8 {
kPermanent = 0;
kEphemeral = 1;
}

enum OperatingModeEnum : enum8 {
kSIT = 0;
kLIT = 1;
Expand Down Expand Up @@ -1349,6 +1354,7 @@ cluster IcdManagement = 70 {
fabric_scoped struct MonitoringRegistrationStruct {
fabric_sensitive node_id checkInNodeID = 1;
fabric_sensitive int64u monitoredSubject = 2;
fabric_sensitive ClientTypeEnum clientType = 4;
fabric_idx fabricIndex = 254;
}

Expand All @@ -1373,6 +1379,7 @@ cluster IcdManagement = 70 {
int64u monitoredSubject = 1;
octet_string<16> key = 2;
optional octet_string<16> verificationKey = 3;
ClientTypeEnum clientType = 4;
}

response struct RegisterClientResponse = 1 {
Expand Down
7 changes: 6 additions & 1 deletion examples/fabric-admin/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
{
mICDMonitoredSubject.SetValue(mICDCheckInNodeId.Value());
}
if (!mICDClientType.HasValue())
{
mICDClientType.SetValue(app::Clusters::IcdManagement::ClientTypeEnum::kPermanent);
}
// These Optionals must have values now.
// The commissioner will verify these values.
params.SetICDSymmetricKey(mICDSymmetricKey.Value());
Expand All @@ -166,6 +170,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
}
params.SetICDCheckInNodeId(mICDCheckInNodeId.Value());
params.SetICDMonitoredSubject(mICDMonitoredSubject.Value());
params.SetICDClientType(mICDClientType.Value());
}

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

app::ICDClientInfo clientInfo;
clientInfo.peer_node = nodeId;
clientInfo.peer_node = chip::ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
clientInfo.monitored_subject = mICDMonitoredSubject.Value();
clientInfo.start_icd_counter = icdCounter;

Expand Down
3 changes: 3 additions & 0 deletions examples/fabric-admin/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class PairingCommand : public CHIPCommand,
"The check-in node id for the ICD, default: node id of the commissioner.");
AddArgument("icd-monitored-subject", 0, UINT64_MAX, &mICDMonitoredSubject,
"The monitored subject of the ICD, default: The node id used for icd-check-in-nodeid.");
AddArgument("icd-client-type", 0, 1, &mICDClientType,
"The ClientType of the client registering, default: Permanent client - 0");
AddArgument("icd-symmetric-key", &mICDSymmetricKey, "The 16 bytes ICD symmetric key, default: randomly generated.");
AddArgument("icd-stay-active-duration", 0, UINT32_MAX, &mICDStayActiveDurationMsec,
"If set, a LIT ICD that is commissioned will be requested to stay active for this many milliseconds");
Expand Down Expand Up @@ -258,6 +260,7 @@ class PairingCommand : public CHIPCommand,
chip::Optional<char *> mCountryCode;
chip::Optional<bool> mICDRegistration;
chip::Optional<NodeId> mICDCheckInNodeId;
chip::Optional<chip::app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
chip::Optional<chip::ByteSpan> mICDSymmetricKey;
chip::Optional<uint64_t> mICDMonitoredSubject;
chip::Optional<uint32_t> mICDStayActiveDurationMsec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,11 @@ cluster UserLabel = 65 {
cluster IcdManagement = 70 {
revision 2;

enum ClientTypeEnum : enum8 {
kPermanent = 0;
kEphemeral = 1;
}

enum OperatingModeEnum : enum8 {
kSIT = 0;
kLIT = 1;
Expand Down Expand Up @@ -1973,6 +1978,7 @@ cluster IcdManagement = 70 {
fabric_scoped struct MonitoringRegistrationStruct {
fabric_sensitive node_id checkInNodeID = 1;
fabric_sensitive int64u monitoredSubject = 2;
fabric_sensitive ClientTypeEnum clientType = 4;
fabric_idx fabricIndex = 254;
}

Expand All @@ -1997,6 +2003,7 @@ cluster IcdManagement = 70 {
int64u monitoredSubject = 1;
octet_string<16> key = 2;
optional octet_string<16> verificationKey = 3;
ClientTypeEnum clientType = 4;
}

response struct RegisterClientResponse = 1 {
Expand Down
7 changes: 7 additions & 0 deletions examples/light-switch-app/qpg/zap/switch.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,11 @@ cluster UserLabel = 65 {
cluster IcdManagement = 70 {
revision 2;

enum ClientTypeEnum : enum8 {
kPermanent = 0;
kEphemeral = 1;
}

enum OperatingModeEnum : enum8 {
kSIT = 0;
kLIT = 1;
Expand Down Expand Up @@ -1770,6 +1775,7 @@ cluster IcdManagement = 70 {
fabric_scoped struct MonitoringRegistrationStruct {
fabric_sensitive node_id checkInNodeID = 1;
fabric_sensitive int64u monitoredSubject = 2;
fabric_sensitive ClientTypeEnum clientType = 4;
fabric_idx fabricIndex = 254;
}

Expand All @@ -1794,6 +1800,7 @@ cluster IcdManagement = 70 {
int64u monitoredSubject = 1;
octet_string<16> key = 2;
optional octet_string<16> verificationKey = 3;
ClientTypeEnum clientType = 4;
}

response struct RegisterClientResponse = 1 {
Expand Down
7 changes: 7 additions & 0 deletions examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,11 @@ cluster BooleanState = 69 {
cluster IcdManagement = 70 {
revision 2;

enum ClientTypeEnum : enum8 {
kPermanent = 0;
kEphemeral = 1;
}

enum OperatingModeEnum : enum8 {
kSIT = 0;
kLIT = 1;
Expand Down Expand Up @@ -1447,6 +1452,7 @@ cluster IcdManagement = 70 {
fabric_scoped struct MonitoringRegistrationStruct {
fabric_sensitive node_id checkInNodeID = 1;
fabric_sensitive int64u monitoredSubject = 2;
fabric_sensitive ClientTypeEnum clientType = 4;
fabric_idx fabricIndex = 254;
}

Expand All @@ -1471,6 +1477,7 @@ cluster IcdManagement = 70 {
int64u monitoredSubject = 1;
octet_string<16> key = 2;
optional octet_string<16> verificationKey = 3;
ClientTypeEnum clientType = 4;
}

response struct RegisterClientResponse = 1 {
Expand Down
Loading

0 comments on commit 3b8999a

Please sign in to comment.