Skip to content

Commit

Permalink
Merge branch 'main' into revert_workflow_deletion_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mykrupp authored Oct 10, 2024
2 parents 0c075f9 + 17940c7 commit 2779e6a
Show file tree
Hide file tree
Showing 138 changed files with 11,292 additions and 846 deletions.
3 changes: 0 additions & 3 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ endif()

if(CONFIG_ENABLE_ICD_SERVER)
chip_gn_arg_append("chip_enable_icd_server" "true")
if(CONFIG_ICD_ENFORCE_SIT_SLOW_POLL_LIMIT)
chip_gn_arg_append("icd_enforce_sit_slow_poll_limit" "true")
endif()
if(CONFIG_ICD_REPORT_ON_ACTIVE_MODE)
chip_gn_arg_append("chip_icd_report_on_active_mode" "true")
endif()
Expand Down
9 changes: 1 addition & 8 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ menu "CHIP Core"
default 8
help
The maximum number of simultaneously active CHIP exchange contexts.

An exchange context object is used to track the state of an ongoing CHIP message
exchange (conversation) with a peer, e.g. a cloud service, a mobile application, or
another device.
Expand Down Expand Up @@ -410,13 +410,6 @@ menu "CHIP Device Layer"
help
Enables or Disables ICD server

config ICD_ENFORCE_SIT_SLOW_POLL_LIMIT
bool "Enforce SIT Slow Polling Max value to 15 seconds"
depends on ENABLE_ICD_SERVER
default n
help
Set to true to enforce SIT Slow Polling Max value to 15seconds

config ICD_REPORT_ON_ACTIVE_MODE
bool "Emit a report on entering active mode"
depends on ENABLE_ICD_SERVER
Expand Down
1 change: 0 additions & 1 deletion config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
matter_add_gn_arg_bool ("chip_enable_icd_dsls" CONFIG_CHIP_ICD_DSLS_SUPPORT)
matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE)
endif()

if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ Trigger Support, set the following parameter to true:
chip_enable_icd_lit = true
```

TI examples have only been tested with the ICD Server configuration. To enable
the client configuration, set `chip_enable_icd_client` to true.

Persistent subscriptions allow devices to attempt resuming existing
subscriptions following a device reset. To enable persistent subscriptions, set
the following parameter to true:
Expand Down
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Generally regenerate using one of:
| 1294 | 0x50E | AccountLogin |
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
| 1363 | 0x553 | WebRTCTransportProvider |
| 1366 | 0x556 | Chime |
| 1872 | 0x750 | EcosystemInformation |
| 1873 | 0x751 | CommissionerControl |
Expand Down
7 changes: 7 additions & 0 deletions examples/chef/devices/rootnode_laundrydryer_01796fe396.matter
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ enum TestGlobalEnum : enum8 {
kFinalValue = 2;
}

enum ThreeLevelAutoEnum : enum8 {
kLow = 0;
kMedium = 1;
kHigh = 2;
kAutomatic = 3;
}

bitmap TestGlobalBitmap : bitmap32 {
kFirstBit = 0x1;
kSecondBit = 0x2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CHIP_ERROR OpenCommissioningWindowCommand::RunCommand()
}

void OpenCommissioningWindowCommand::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err,
chip::SetupPayload payload)
SetupPayload payload)
{
LogErrorOnFailure(err);

Expand Down
47 changes: 23 additions & 24 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()

if (!mICDSymmetricKey.HasValue())
{
chip::Crypto::DRBG_get_bytes(mRandomGeneratedICDSymmetricKey, sizeof(mRandomGeneratedICDSymmetricKey));
Crypto::DRBG_get_bytes(mRandomGeneratedICDSymmetricKey, sizeof(mRandomGeneratedICDSymmetricKey));
mICDSymmetricKey.SetValue(ByteSpan(mRandomGeneratedICDSymmetricKey));
}
if (!mICDCheckInNodeId.HasValue())
Expand Down Expand Up @@ -289,7 +289,7 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndexWithCode(NodeId remoteId, uin
// There is no device with this index that has some resolution data. This could simply
// be because the device is a ble device. In this case let's fall back to looking for
// a device with this index and some RendezvousParameters.
chip::SetupPayload payload;
SetupPayload payload;
bool isQRCode = strncmp(mOnboardingPayload, kQRCodePrefix, strlen(kQRCodePrefix)) == 0;
if (isQRCode)
{
Expand Down Expand Up @@ -329,21 +329,21 @@ CHIP_ERROR PairingCommand::PairWithMdns(NodeId remoteId)
Dnssd::DiscoveryFilter filter(mFilterType);
switch (mFilterType)
{
case chip::Dnssd::DiscoveryFilterType::kNone:
case Dnssd::DiscoveryFilterType::kNone:
break;
case chip::Dnssd::DiscoveryFilterType::kShortDiscriminator:
case chip::Dnssd::DiscoveryFilterType::kLongDiscriminator:
case chip::Dnssd::DiscoveryFilterType::kCompressedFabricId:
case chip::Dnssd::DiscoveryFilterType::kVendorId:
case chip::Dnssd::DiscoveryFilterType::kDeviceType:
case Dnssd::DiscoveryFilterType::kShortDiscriminator:
case Dnssd::DiscoveryFilterType::kLongDiscriminator:
case Dnssd::DiscoveryFilterType::kCompressedFabricId:
case Dnssd::DiscoveryFilterType::kVendorId:
case Dnssd::DiscoveryFilterType::kDeviceType:
filter.code = mDiscoveryFilterCode;
break;
case chip::Dnssd::DiscoveryFilterType::kCommissioningMode:
case Dnssd::DiscoveryFilterType::kCommissioningMode:
break;
case chip::Dnssd::DiscoveryFilterType::kCommissioner:
case Dnssd::DiscoveryFilterType::kCommissioner:
filter.code = 1;
break;
case chip::Dnssd::DiscoveryFilterType::kInstanceName:
case Dnssd::DiscoveryFilterType::kInstanceName:
filter.code = 0;
filter.instanceName = mDiscoveryFilterInstanceName;
break;
Expand Down Expand Up @@ -463,13 +463,13 @@ void PairingCommand::OnReadCommissioningInfo(const Controller::ReadCommissioning

void PairingCommand::OnICDRegistrationComplete(ScopedNodeId nodeId, uint32_t icdCounter)
{
char icdSymmetricKeyHex[chip::Crypto::kAES_CCM128_Key_Length * 2 + 1];
char icdSymmetricKeyHex[Crypto::kAES_CCM128_Key_Length * 2 + 1];

chip::Encoding::BytesToHex(mICDSymmetricKey.Value().data(), mICDSymmetricKey.Value().size(), icdSymmetricKeyHex,
sizeof(icdSymmetricKeyHex), chip::Encoding::HexFlags::kNullTerminate);
Encoding::BytesToHex(mICDSymmetricKey.Value().data(), mICDSymmetricKey.Value().size(), icdSymmetricKeyHex,
sizeof(icdSymmetricKeyHex), Encoding::HexFlags::kNullTerminate);

app::ICDClientInfo clientInfo;
clientInfo.check_in_node = chip::ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
clientInfo.check_in_node = ScopedNodeId(mICDCheckInNodeId.Value(), nodeId.GetFabricIndex());
clientInfo.peer_node = nodeId;
clientInfo.monitored_subject = mICDMonitoredSubject.Value();
clientInfo.start_icd_counter = icdCounter;
Expand Down Expand Up @@ -505,15 +505,15 @@ void PairingCommand::OnICDStayActiveComplete(ScopedNodeId deviceId, uint32_t pro
ChipLogValueX64(deviceId.GetNodeId()), promisedActiveDuration);
}

void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::CommissionNodeData & nodeData)
void PairingCommand::OnDiscoveredDevice(const Dnssd::CommissionNodeData & nodeData)
{
// Ignore nodes with closed commissioning window
VerifyOrReturn(nodeData.commissioningMode != 0);

auto & resolutionData = nodeData;

const uint16_t port = resolutionData.port;
char buf[chip::Inet::IPAddress::kMaxStringLength];
char buf[Inet::IPAddress::kMaxStringLength];
resolutionData.ipAddress[0].ToString(buf);
ChipLogProgress(chipTool, "Discovered Device: %s:%u", buf, port);

Expand Down Expand Up @@ -556,20 +556,19 @@ void PairingCommand::OnCurrentFabricRemove(void * context, NodeId nodeId, CHIP_E
command->SetCommandExitStatus(err);
}

chip::Optional<uint16_t> PairingCommand::FailSafeExpiryTimeoutSecs() const
Optional<uint16_t> PairingCommand::FailSafeExpiryTimeoutSecs() const
{
// We don't need to set additional failsafe timeout as we don't ask the final user if he wants to continue
return chip::Optional<uint16_t>();
return Optional<uint16_t>();
}

void PairingCommand::OnDeviceAttestationCompleted(chip::Controller::DeviceCommissioner * deviceCommissioner,
chip::DeviceProxy * device,
const chip::Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info,
chip::Credentials::AttestationVerificationResult attestationResult)
void PairingCommand::OnDeviceAttestationCompleted(Controller::DeviceCommissioner * deviceCommissioner, DeviceProxy * device,
const Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info,
Credentials::AttestationVerificationResult attestationResult)
{
// Bypass attestation verification, continue with success
auto err = deviceCommissioner->ContinueCommissioningAfterDeviceAttestation(
device, chip::Credentials::AttestationVerificationResult::kSuccess);
device, Credentials::AttestationVerificationResult::kSuccess);
if (CHIP_NO_ERROR != err)
{
SetCommandExitStatus(err);
Expand Down
14 changes: 7 additions & 7 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class PairingCommand : public CHIPCommand,
const PairingNetworkType mNetworkType;
const chip::Dnssd::DiscoveryFilterType mFilterType;
Command::AddressWithInterface mRemoteAddr;
NodeId mNodeId;
NodeId mNodeId = chip::kUndefinedNodeId;
chip::Optional<uint16_t> mTimeout;
chip::Optional<bool> mDiscoverOnce;
chip::Optional<bool> mUseOnlyOnNetworkDiscovery;
Expand All @@ -266,7 +266,7 @@ class PairingCommand : public CHIPCommand,
TypedComplexArgument<chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::Type>>
mComplex_DSTOffsets;

uint16_t mRemotePort;
uint16_t mRemotePort = 0;
// mDiscriminator is only used for some situations, but in those situations
// it's mandatory. Track whether we're actually using it; the cases that do
// will emplace this optional.
Expand All @@ -275,15 +275,15 @@ class PairingCommand : public CHIPCommand,
// it's mandatory. Track whether we're actually using it; the cases that do
// will emplace this optional.
std::optional<uint32_t> mSetupPINCode;
uint16_t mIndex;
uint16_t mIndex = 0;
chip::ByteSpan mOperationalDataset;
chip::ByteSpan mSSID;
chip::ByteSpan mPassword;
char * mOnboardingPayload;
uint64_t mDiscoveryFilterCode;
char * mDiscoveryFilterInstanceName;
char * mOnboardingPayload = nullptr;
uint64_t mDiscoveryFilterCode = 0;
char * mDiscoveryFilterInstanceName = nullptr;

bool mDeviceIsICD;
bool mDeviceIsICD = false;
uint8_t mRandomGeneratedICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length];

// For unpair
Expand Down
1 change: 0 additions & 1 deletion examples/contact-sensor-app/nxp/k32w0/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ chip_generate_link_map_file = true

chip_enable_icd_server = true
chip_enable_icd_lit = false
icd_enforce_sit_slow_poll_limit = true
chip_persist_subscriptions = true
chip_subscription_timeout_resumption = true

Expand Down
1 change: 0 additions & 1 deletion examples/contact-sensor-app/nxp/k32w1/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ chip_with_lwip = false
chip_enable_icd_server = true
chip_enable_icd_lit = false
chip_enable_icd_dsls = false
icd_enforce_sit_slow_poll_limit = true
chip_persist_subscriptions = true
chip_subscription_timeout_resumption = true

Expand Down
1 change: 0 additions & 1 deletion examples/contact-sensor-app/nxp/mcxw71/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ chip_with_lwip = false

chip_enable_icd_server = true
chip_enable_icd_lit = false
icd_enforce_sit_slow_poll_limit = true
chip_persist_subscriptions = true
chip_subscription_timeout_resumption = true

Expand Down
2 changes: 1 addition & 1 deletion examples/fabric-admin/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack()
mCredIssuerCmds->SetCredentialIssuerOption(CredentialIssuerCommands::CredentialIssuerOptions::kAllowTestCdSigningKey,
allowTestCdSigningKey);

PairingManager::Instance().Init(&CurrentCommissioner());
ReturnLogErrorOnFailure(PairingManager::Instance().Init(&CurrentCommissioner(), mCredIssuerCmds));

return CHIP_NO_ERROR;
}
Expand Down
3 changes: 2 additions & 1 deletion examples/fabric-admin/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class CHIPCommand : public Command
StopWaiting();
}

static chip::app::DefaultICDClientStorage sICDClientStorage;

protected:
// Will be called in a setting in which it's safe to touch the CHIP
// stack. The rules for Run() are as follows:
Expand Down Expand Up @@ -167,7 +169,6 @@ class CHIPCommand : public Command
static chip::Crypto::RawKeySessionKeystore sSessionKeystore;

static chip::Credentials::GroupDataProviderImpl sGroupDataProvider;
static chip::app::DefaultICDClientStorage sICDClientStorage;
static chip::app::CheckInHandler sCheckInHandler;
CredentialIssuerCommands * mCredIssuerCmds;

Expand Down
46 changes: 5 additions & 41 deletions examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,8 @@ CHIP_ERROR FabricSyncAddBridgeCommand::RunCommand(NodeId remoteId)
return CHIP_NO_ERROR;
}

PairingCommand * pairingCommand = static_cast<PairingCommand *>(CommandMgr().GetCommandByName("pairing", "already-discovered"));
PairingManager::Instance().SetCommissioningDelegate(this);

if (pairingCommand == nullptr)
{
ChipLogError(NotSpecified, "Pairing already-discovered command is not available");
return CHIP_ERROR_NOT_IMPLEMENTED;
}

pairingCommand->RegisterCommissioningDelegate(this);
mBridgeNodeId = remoteId;

DeviceMgr().PairRemoteFabricBridge(remoteId, mSetupPINCode, reinterpret_cast<const char *>(mRemoteAddr.data()), mRemotePort);
Expand Down Expand Up @@ -146,16 +139,7 @@ CHIP_ERROR FabricSyncRemoveBridgeCommand::RunCommand()

mBridgeNodeId = bridgeNodeId;

PairingCommand * pairingCommand = static_cast<PairingCommand *>(CommandMgr().GetCommandByName("pairing", "unpair"));

if (pairingCommand == nullptr)
{
ChipLogError(NotSpecified, "Pairing unpair command is not available");
return CHIP_ERROR_NOT_IMPLEMENTED;
}

pairingCommand->RegisterPairingDelegate(this);

PairingManager::Instance().SetPairingDelegate(this);
DeviceMgr().UnpairRemoteFabricBridge();

return CHIP_NO_ERROR;
Expand Down Expand Up @@ -203,10 +187,7 @@ CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId)
return CHIP_NO_ERROR;
}

PairingCommand * pairingCommand = static_cast<PairingCommand *>(CommandMgr().GetCommandByName("pairing", "already-discovered"));
VerifyOrDie(pairingCommand != nullptr);

pairingCommand->RegisterCommissioningDelegate(this);
PairingManager::Instance().SetCommissioningDelegate(this);
mLocalBridgeNodeId = deviceId;

if (mSetupPINCode.HasValue())
Expand Down Expand Up @@ -259,16 +240,7 @@ CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand()

mLocalBridgeNodeId = bridgeNodeId;

PairingCommand * pairingCommand = static_cast<PairingCommand *>(CommandMgr().GetCommandByName("pairing", "unpair"));

if (pairingCommand == nullptr)
{
ChipLogError(NotSpecified, "Pairing unpair command is not available");
return CHIP_ERROR_NOT_IMPLEMENTED;
}

pairingCommand->RegisterPairingDelegate(this);

PairingManager::Instance().SetPairingDelegate(this);
DeviceMgr().UnpairLocalFabricBridge();

return CHIP_NO_ERROR;
Expand All @@ -287,15 +259,7 @@ void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_
{
NodeId nodeId = DeviceMgr().GetNextAvailableNodeId();

PairingCommand * pairingCommand = static_cast<PairingCommand *>(CommandMgr().GetCommandByName("pairing", "code"));

if (pairingCommand == nullptr)
{
ChipLogError(NotSpecified, "Pairing code command is not available");
return;
}

pairingCommand->RegisterCommissioningDelegate(this);
PairingManager::Instance().SetCommissioningDelegate(this);
mAssignedNodeId = nodeId;

usleep(kCommissionPrepareTimeMs * 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
#pragma once

#include <commands/common/CHIPCommand.h>
#include <commands/pairing/PairingCommand.h>
#include <device_manager/PairingManager.h>

// Constants
constexpr uint32_t kCommissionPrepareTimeMs = 500;
constexpr uint16_t kMaxManualCodeLength = 21;

class FabricSyncAddBridgeCommand : public CHIPCommand, public CommissioningDelegate
{
Expand Down
Loading

0 comments on commit 2779e6a

Please sign in to comment.