Skip to content

Commit 4478f6e

Browse files
committed
Remove ICD stuff since it is not needed for camera
1 parent c1b95fd commit 4478f6e

10 files changed

+1
-453
lines changed

examples/camera-controller/BUILD.gn

-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ static_library("camera-controller-utils") {
5757
"commands/common/Commands.h",
5858
"commands/common/CredentialIssuerCommands.h",
5959
"commands/common/HexConversion.h",
60-
"commands/common/IcdManager.cpp",
61-
"commands/common/IcdManager.h",
6260
"commands/common/RemoteDataModelLogger.cpp",
6361
"commands/common/RemoteDataModelLogger.h",
64-
"commands/common/StayActiveSender.cpp",
65-
"commands/common/StayActiveSender.h",
6662
"commands/pairing/OpenCommissioningWindowCommand.cpp",
6763
"commands/pairing/OpenCommissioningWindowCommand.h",
6864
"commands/pairing/PairingCommand.cpp",
@@ -83,8 +79,6 @@ static_library("camera-controller-utils") {
8379

8480
public_deps = [
8581
"${chip_root}/examples/common/tracing:commandline",
86-
"${chip_root}/src/app/icd/client:handler",
87-
"${chip_root}/src/app/icd/client:manager",
8882
"${chip_root}/src/app/server",
8983
"${chip_root}/src/app/tests/suites/commands/interaction_model",
9084
"${chip_root}/src/controller/data_model",

examples/camera-controller/commands/clusters/ModelCommand.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "ModelCommand.h"
2020

2121
#include <app/InteractionModelEngine.h>
22-
#include <app/icd/client/DefaultICDClientStorage.h>
2322
#include <inttypes.h>
2423

2524
using namespace ::chip;
@@ -36,7 +35,6 @@ CHIP_ERROR ModelCommand::RunCommand()
3635
}
3736

3837
ChipLogProgress(NotSpecified, "Sending command to node " ChipLogFormatX64, ChipLogValueX64(mDestinationId));
39-
CheckPeerICDType();
4038

4139
CommissioneeDeviceProxy * commissioneeDeviceProxy = nullptr;
4240
if (CHIP_NO_ERROR == CurrentCommissioner().GetDeviceBeingCommissioned(mDestinationId, &commissioneeDeviceProxy))
@@ -75,31 +73,3 @@ void ModelCommand::Shutdown()
7573

7674
CHIPCommand::Shutdown();
7775
}
78-
79-
void ModelCommand::CheckPeerICDType()
80-
{
81-
if (mIsPeerLIT.HasValue())
82-
{
83-
ChipLogProgress(NotSpecified, "Peer ICD type is set to %s", mIsPeerLIT.Value() == 1 ? "LIT-ICD" : "non LIT-ICD");
84-
return;
85-
}
86-
87-
app::ICDClientInfo info;
88-
auto destinationPeerId = chip::ScopedNodeId(mDestinationId, CurrentCommissioner().GetFabricIndex());
89-
auto iter = CHIPCommand::sICDClientStorage.IterateICDClientInfo();
90-
if (iter == nullptr)
91-
{
92-
return;
93-
}
94-
app::DefaultICDClientStorage::ICDClientInfoIteratorWrapper clientInfoIteratorWrapper(iter);
95-
96-
while (iter->Next(info))
97-
{
98-
if (ScopedNodeId(info.peer_node.GetNodeId(), info.peer_node.GetFabricIndex()) == destinationPeerId)
99-
{
100-
ChipLogProgress(NotSpecified, "Peer is a registered LIT ICD.");
101-
mIsPeerLIT.SetValue(true);
102-
return;
103-
}
104-
}
105-
}

examples/camera-controller/commands/clusters/ModelCommand.h

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class ModelCommand : public CHIPCommand
5252
"Endpoint the command is targeted at.");
5353
}
5454
}
55-
AddArgument(
56-
"lit-icd-peer", 0, 1, &mIsPeerLIT,
57-
"Whether to treat the peer as a LIT ICD. false: Always no, true: Always yes, (not set): Yes if the peer is registered "
58-
"to this controller.");
5955
AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
6056
}
6157

examples/camera-controller/commands/common/CHIPCommand.cpp

-18
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#include "CHIPCommand.h"
2020

21-
#include "IcdManager.h"
22-
2321
#include <controller/CHIPDeviceControllerFactory.h>
2422
#include <credentials/attestation_verifier/FileAttestationTrustStore.h>
2523
#include <data-model-providers/codegen/Instance.h>
@@ -52,10 +50,6 @@ constexpr char kCDTrustStorePathVariable[] = "CAMERACONTROLLER_CD_TRUST_STO
5250

5351
const chip::Credentials::AttestationTrustStore * CHIPCommand::sTrustStore = nullptr;
5452
chip::Credentials::GroupDataProviderImpl CHIPCommand::sGroupDataProvider{ kMaxGroupsPerFabric, kMaxGroupKeysPerFabric };
55-
// All fabrics share the same ICD client storage.
56-
chip::app::DefaultICDClientStorage CHIPCommand::sICDClientStorage;
57-
chip::Crypto::RawKeySessionKeystore CHIPCommand::sSessionKeystore;
58-
chip::app::CheckInHandler CHIPCommand::sCheckInHandler;
5953

6054
namespace {
6155

@@ -109,19 +103,12 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack()
109103
ReturnLogErrorOnFailure(mOperationalKeystore.Init(&mDefaultStorage));
110104
ReturnLogErrorOnFailure(mOpCertStore.Init(&mDefaultStorage));
111105

112-
// camera-controller uses a non-persistent keystore.
113-
// ICD storage lifetime is currently tied to the camera-controller's lifetime. Since camera-controller interactive mode is
114-
// currently used for ICD commissioning and check-in validation, this temporary storage meets the test requirements.
115-
// TODO: Implement persistent ICD storage for the camera-controller.
116-
ReturnLogErrorOnFailure(sICDClientStorage.Init(&mDefaultStorage, &sSessionKeystore));
117-
118106
chip::Controller::FactoryInitParams factoryInitParams;
119107

120108
factoryInitParams.fabricIndependentStorage = &mDefaultStorage;
121109
factoryInitParams.operationalKeystore = &mOperationalKeystore;
122110
factoryInitParams.opCertStore = &mOpCertStore;
123111
factoryInitParams.enableServerInteractions = NeedsOperationalAdvertising();
124-
factoryInitParams.sessionKeystore = &sSessionKeystore;
125112
factoryInitParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance(&mDefaultStorage);
126113

127114
// Init group data provider that will be used for all group keys and IPKs for the
@@ -151,9 +138,6 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack()
151138

152139
auto engine = chip::app::InteractionModelEngine::GetInstance();
153140
VerifyOrReturnError(engine != nullptr, CHIP_ERROR_INCORRECT_STATE);
154-
ReturnLogErrorOnFailure(IcdManager::Instance().Init(&sICDClientStorage, engine));
155-
ReturnLogErrorOnFailure(sCheckInHandler.Init(DeviceControllerFactory::GetInstance().GetSystemState()->ExchangeMgr(),
156-
&sICDClientStorage, &IcdManager::Instance(), engine));
157141

158142
CommissionerIdentity nullIdentity{ kIdentityNull, chip::kUndefinedNodeId };
159143
ReturnLogErrorOnFailure(InitializeCommissioner(nullIdentity, kIdentityNullFabricId));
@@ -513,8 +497,6 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(CommissionerIdentity & identity,
513497
chip::Credentials::SetSingleIpkEpochKey(&sGroupDataProvider, fabricIndex, defaultIpk, compressed_fabric_id_span));
514498
}
515499

516-
CHIPCommand::sICDClientStorage.UpdateFabricList(commissioner->GetFabricIndex());
517-
518500
mCommissioners[identity] = std::move(commissioner);
519501

520502
return CHIP_NO_ERROR;

examples/camera-controller/commands/common/CHIPCommand.h

-6
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#include "Command.h"
2626

2727
#include <TracingCommandLineArgument.h>
28-
#include <app/icd/client/CheckInHandler.h>
29-
#include <app/icd/client/DefaultCheckInDelegate.h>
30-
#include <app/icd/client/DefaultICDClientStorage.h>
3128
#include <commands/common/CredentialIssuerCommands.h>
3229
#include <commands/example/ExampleCredentialIssuerCommands.h>
3330
#include <credentials/GroupDataProviderImpl.h>
@@ -121,8 +118,6 @@ class CHIPCommand : public Command
121118
StopWaiting();
122119
}
123120

124-
static chip::app::DefaultICDClientStorage sICDClientStorage;
125-
126121
protected:
127122
// Will be called in a setting in which it's safe to touch the CHIP
128123
// stack. The rules for Run() are as follows:
@@ -170,7 +165,6 @@ class CHIPCommand : public Command
170165
static chip::Crypto::RawKeySessionKeystore sSessionKeystore;
171166

172167
static chip::Credentials::GroupDataProviderImpl sGroupDataProvider;
173-
static chip::app::CheckInHandler sCheckInHandler;
174168
CredentialIssuerCommands * mCredIssuerCmds;
175169

176170
std::string GetIdentity();

examples/camera-controller/commands/common/IcdManager.h

-51
This file was deleted.

examples/camera-controller/commands/common/StayActiveSender.cpp

-99
This file was deleted.

0 commit comments

Comments
 (0)