Skip to content

Commit 3d39492

Browse files
authored
[TLSCLIENT] Initial PR for conversion to Code Driven - Rename of cluster and associated classes (#42377)
1 parent acd8d82 commit 3d39492

File tree

11 files changed

+48
-48
lines changed

11 files changed

+48
-48
lines changed

examples/all-clusters-app/all-clusters-common/include/tls-client-management-instance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#pragma once
2020

21-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
21+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
2222
#include <app/storage/FabricTableImpl.h>
2323
#include <app/util/config.h>
2424
#include <vector>

examples/all-clusters-app/all-clusters-common/src/tls-client-management-instance.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <app-common/zap-generated/ids/Clusters.h>
2020
#include <app/clusters/tls-certificate-management-server/CertificateTableImpl.h>
2121
#include <app/clusters/tls-certificate-management-server/IncrementingIdHelper.h>
22-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
22+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
2323
#include <app/storage/FabricTableImpl.ipp>
2424
#include <clusters/TlsClientManagement/Commands.h>
2525
#include <lib/support/CHIPMem.h>
@@ -289,7 +289,7 @@ ClusterStatusCode TlsClientManagementCommandDelegate::ProvisionEndpoint(
289289

290290
if (provisionReq.endpointID.IsNull())
291291
{
292-
VerifyOrReturnError(numInFabric < mTlsClientManagementServer->GetMaxProvisioned(),
292+
VerifyOrReturnError(numInFabric < mTlsClientManagementCluster->GetMaxProvisioned(),
293293
ClusterStatusCode(Status::ResourceExhausted));
294294
EndpointSerializer::Clear(endpoint.mEndpoint);
295295
auto & endpointStruct = endpoint.mEndpoint;
@@ -421,16 +421,16 @@ CHIP_ERROR TlsClientManagementCommandDelegate::MutateEndpointReferenceCount(Endp
421421

422422
static CertificateTableImpl gCertificateTableInstance;
423423
TlsClientManagementCommandDelegate TlsClientManagementCommandDelegate::instance;
424-
static TlsClientManagementServer gTlsClientManagementClusterServerInstance = TlsClientManagementServer(
424+
static TlsClientManagementCluster gTlsClientManagementClusterInstance = TlsClientManagementCluster(
425425
EndpointId(1), TlsClientManagementCommandDelegate::GetInstance(), gCertificateTableInstance, kMaxProvisionedEndpoints);
426426

427427
void emberAfTlsClientManagementClusterInitCallback(EndpointId matterEndpoint)
428428
{
429429
TEMPORARY_RETURN_IGNORED gCertificateTableInstance.SetEndpoint(EndpointId(1));
430-
TEMPORARY_RETURN_IGNORED gTlsClientManagementClusterServerInstance.Init();
430+
TEMPORARY_RETURN_IGNORED gTlsClientManagementClusterInstance.Init();
431431
}
432432

433433
void emberAfTlsClientManagementClusterShutdownCallback(EndpointId matterEndpoint)
434434
{
435-
TEMPORARY_RETURN_IGNORED gTlsClientManagementClusterServerInstance.Finish();
435+
TEMPORARY_RETURN_IGNORED gTlsClientManagementClusterInstance.Finish();
436436
}

src/app/clusters/push-av-stream-transport-server/CodegenIntegration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "push-av-stream-transport-delegate.h"
2222
#include <app/clusters/tls-certificate-management-server/tls-certificate-management-server.h>
23-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
23+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
2424

2525
namespace chip {
2626
namespace app {

src/app/clusters/push-av-stream-transport-server/PushAVStreamTransportLogic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <app/clusters/push-av-stream-transport-server/push-av-stream-transport-delegate.h>
88
#include <app/clusters/push-av-stream-transport-server/push-av-stream-transport-storage.h>
99
#include <app/clusters/tls-certificate-management-server/tls-certificate-management-server.h>
10-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
10+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
1111
#include <app/server-cluster/DefaultServerCluster.h>
1212
#include <functional>
1313
#include <protocols/interaction_model/StatusCode.h>

src/app/clusters/push-av-stream-transport-server/push-av-stream-transport-delegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <app/clusters/push-av-stream-transport-server/constants.h>
2323
#include <app/clusters/push-av-stream-transport-server/push-av-stream-transport-storage.h>
2424
#include <app/clusters/tls-certificate-management-server/tls-certificate-management-server.h>
25-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
25+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
2626
#include <functional>
2727
#include <protocols/interaction_model/StatusCode.h>
2828
#include <vector>

src/app/clusters/push-av-stream-transport-server/tests/TestPushAVStreamTransportCluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <app/MessageDef/CommandDataIB.h>
2727
#include <app/clusters/push-av-stream-transport-server/PushAVStreamTransportCluster.h>
2828
#include <app/clusters/testing/MockCommandHandler.h>
29-
#include <app/clusters/tls-client-management-server/tls-client-management-server.h>
29+
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
3030
#include <app/tests/AppTestContext.h>
3131
#include <lib/core/Optional.h>
3232
#include <lib/core/StringBuilderAdapters.h>

src/app/clusters/tls-client-management-server/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import("//build_overrides/chip.gni")
1515

1616
source_set("tls-client-management-server") {
17-
sources = [ "tls-client-management-server.h" ]
17+
sources = [ "TlsClientManagementCluster.h" ]
1818

1919
public_deps = [
2020
"${chip_root}/src/app/",

src/app/clusters/tls-client-management-server/tls-client-management-server.cpp renamed to src/app/clusters/tls-client-management-server/TlsClientManagementCluster.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* @brief Implementation for the TlsClientManagement Server Cluster
2121
***************************************************************************/
2222

23-
#include "tls-client-management-server.h"
23+
#include "TlsClientManagementCluster.h"
2424

2525
#include <app/AttributeAccessInterfaceRegistry.h>
2626
#include <app/CommandHandlerInterfaceRegistry.h>
@@ -44,28 +44,28 @@ using namespace Protocols::InteractionModel;
4444

4545
static constexpr uint16_t kMaxTlsEndpointId = 65534;
4646

47-
TlsClientManagementServer::TlsClientManagementServer(EndpointId endpointId, TlsClientManagementDelegate & delegate,
48-
CertificateTable & certificateTable, uint8_t maxProvisioned) :
47+
TlsClientManagementCluster::TlsClientManagementCluster(EndpointId endpointId, TlsClientManagementDelegate & delegate,
48+
CertificateTable & certificateTable, uint8_t maxProvisioned) :
4949
AttributeAccessInterface(MakeOptional(endpointId), TlsClientManagement::Id),
5050
CommandHandlerInterface(MakeOptional(endpointId), TlsClientManagement::Id), mDelegate(delegate),
5151
mCertificateTable(certificateTable), mMaxProvisioned(maxProvisioned)
5252
{
5353
VerifyOrDieWithMsg(mMaxProvisioned >= 5, NotSpecified, "Spec requires MaxProvisioned be >= 5");
5454
VerifyOrDieWithMsg(mMaxProvisioned <= 254, NotSpecified, "Spec requires MaxProvisioned be <= 254");
55-
mDelegate.SetTlsClientManagementServer(this);
55+
mDelegate.SetTlsClientManagementCluster(this);
5656
}
5757

58-
TlsClientManagementServer::~TlsClientManagementServer()
58+
TlsClientManagementCluster::~TlsClientManagementCluster()
5959
{
6060
// null out the ref to us on the delegate
61-
mDelegate.SetTlsClientManagementServer(nullptr);
61+
mDelegate.SetTlsClientManagementCluster(nullptr);
6262

6363
// unregister
6464
TEMPORARY_RETURN_IGNORED CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this);
6565
AttributeAccessInterfaceRegistry::Instance().Unregister(this);
6666
}
6767

68-
CHIP_ERROR TlsClientManagementServer::Init()
68+
CHIP_ERROR TlsClientManagementCluster::Init()
6969
{
7070
ReturnErrorOnFailure(mCertificateTable.Init(Server::GetInstance().GetPersistentStorage()));
7171
ReturnErrorOnFailure(mDelegate.Init(Server::GetInstance().GetPersistentStorage()));
@@ -76,7 +76,7 @@ CHIP_ERROR TlsClientManagementServer::Init()
7676
return Server::GetInstance().GetFabricTable().AddFabricDelegate(this);
7777
}
7878

79-
CHIP_ERROR TlsClientManagementServer::Finish()
79+
CHIP_ERROR TlsClientManagementCluster::Finish()
8080
{
8181
TEMPORARY_RETURN_IGNORED mCertificateTable.Finish();
8282

@@ -88,7 +88,7 @@ CHIP_ERROR TlsClientManagementServer::Finish()
8888
}
8989

9090
// AttributeAccessInterface
91-
CHIP_ERROR TlsClientManagementServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
91+
CHIP_ERROR TlsClientManagementCluster::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
9292
{
9393
VerifyOrDie(aPath.mClusterId == TlsClientManagement::Id);
9494

@@ -97,9 +97,9 @@ CHIP_ERROR TlsClientManagementServer::Read(const ConcreteReadAttributePath & aPa
9797
case MaxProvisioned::Id:
9898
return aEncoder.Encode(mMaxProvisioned);
9999
case ProvisionedEndpoints::Id: {
100-
TlsClientManagementServer * server = this;
101-
auto matterEndpoint = aPath.mEndpointId;
102-
auto fabric = aEncoder.AccessingFabricIndex();
100+
TlsClientManagementCluster * server = this;
101+
auto matterEndpoint = aPath.mEndpointId;
102+
auto fabric = aEncoder.AccessingFabricIndex();
103103
CHIP_ERROR err = aEncoder.EncodeList([server, matterEndpoint, fabric](const auto & encoder) -> CHIP_ERROR {
104104
return server->EncodeProvisionedEndpoints(matterEndpoint, fabric, encoder);
105105
});
@@ -112,21 +112,21 @@ CHIP_ERROR TlsClientManagementServer::Read(const ConcreteReadAttributePath & aPa
112112
return CHIP_NO_ERROR;
113113
}
114114

115-
uint8_t TlsClientManagementServer::GetMaxProvisioned() const
115+
uint8_t TlsClientManagementCluster::GetMaxProvisioned() const
116116
{
117117
return mMaxProvisioned;
118118
}
119119

120120
// helper method to get the TlsClientManagement provisioned endpoints encoded into a list
121121
CHIP_ERROR
122-
TlsClientManagementServer::EncodeProvisionedEndpoints(EndpointId matterEndpoint, FabricIndex fabric,
123-
const AttributeValueEncoder::ListEncodeHelper & encoder)
122+
TlsClientManagementCluster::EncodeProvisionedEndpoints(EndpointId matterEndpoint, FabricIndex fabric,
123+
const AttributeValueEncoder::ListEncodeHelper & encoder)
124124
{
125125
return mDelegate.ForEachEndpoint(matterEndpoint, fabric,
126126
[&](auto & endpoint) -> CHIP_ERROR { return encoder.Encode(endpoint); });
127127
}
128128

129-
void TlsClientManagementServer::InvokeCommand(HandlerContext & ctx)
129+
void TlsClientManagementCluster::InvokeCommand(HandlerContext & ctx)
130130
{
131131
switch (ctx.mRequestPath.mCommandId)
132132
{
@@ -145,8 +145,8 @@ void TlsClientManagementServer::InvokeCommand(HandlerContext & ctx)
145145
}
146146
}
147147

148-
void TlsClientManagementServer::HandleProvisionEndpoint(HandlerContext & ctx,
149-
const Commands::ProvisionEndpoint::DecodableType & req)
148+
void TlsClientManagementCluster::HandleProvisionEndpoint(HandlerContext & ctx,
149+
const Commands::ProvisionEndpoint::DecodableType & req)
150150
{
151151
ChipLogDetail(Zcl, "TlsClientManagement: ProvisionEndpoint");
152152

@@ -179,7 +179,7 @@ void TlsClientManagementServer::HandleProvisionEndpoint(HandlerContext & ctx,
179179
}
180180
}
181181

182-
void TlsClientManagementServer::HandleFindEndpoint(HandlerContext & ctx, const Commands::FindEndpoint::DecodableType & req)
182+
void TlsClientManagementCluster::HandleFindEndpoint(HandlerContext & ctx, const Commands::FindEndpoint::DecodableType & req)
183183
{
184184
ChipLogDetail(Zcl, "TlsClientManagement: FindEndpoint");
185185

@@ -204,7 +204,7 @@ void TlsClientManagementServer::HandleFindEndpoint(HandlerContext & ctx, const C
204204
}
205205
}
206206

207-
void TlsClientManagementServer::HandleRemoveEndpoint(HandlerContext & ctx, const Commands::RemoveEndpoint::DecodableType & req)
207+
void TlsClientManagementCluster::HandleRemoveEndpoint(HandlerContext & ctx, const Commands::RemoveEndpoint::DecodableType & req)
208208
{
209209
ChipLogDetail(Zcl, "TlsClientManagement: RemoveEndpoint");
210210

@@ -222,7 +222,7 @@ void TlsClientManagementServer::HandleRemoveEndpoint(HandlerContext & ctx, const
222222
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status);
223223
}
224224

225-
void TlsClientManagementServer::OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex)
225+
void TlsClientManagementCluster::OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex)
226226
{
227227
TEMPORARY_RETURN_IGNORED mDelegate.RemoveFabric(fabricIndex);
228228
}

src/app/clusters/tls-client-management-server/tls-client-management-server.h renamed to src/app/clusters/tls-client-management-server/TlsClientManagementCluster.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ static constexpr uint16_t kSpecMaxHostname = 253;
3535

3636
class TlsClientManagementDelegate;
3737

38-
class TlsClientManagementServer : private AttributeAccessInterface,
39-
private CommandHandlerInterface,
40-
private chip::FabricTable::Delegate
38+
class TlsClientManagementCluster : private AttributeAccessInterface,
39+
private CommandHandlerInterface,
40+
private chip::FabricTable::Delegate
4141
{
4242
public:
4343
/**
@@ -49,9 +49,9 @@ class TlsClientManagementServer : private AttributeAccessInterface,
4949
* @param maxProvisioned The maximum number of endpoints which can be provisioned
5050
* Note: the caller must ensure that the delegate lives throughout the instance's lifetime.
5151
*/
52-
TlsClientManagementServer(EndpointId endpointId, TlsClientManagementDelegate & delegate,
53-
Tls::CertificateTable & certificateTable, uint8_t maxProvisioned);
54-
~TlsClientManagementServer();
52+
TlsClientManagementCluster(EndpointId endpointId, TlsClientManagementDelegate & delegate,
53+
Tls::CertificateTable & certificateTable, uint8_t maxProvisioned);
54+
~TlsClientManagementCluster();
5555

5656
/**
5757
* Initialise the TLS Client Management server instance.
@@ -184,16 +184,16 @@ class TlsClientManagementDelegate : public Tls::CertificateDependencyChecker
184184
int8_t delta) = 0;
185185

186186
protected:
187-
friend class TlsClientManagementServer;
187+
friend class TlsClientManagementCluster;
188188

189-
TlsClientManagementServer * mTlsClientManagementServer = nullptr;
189+
TlsClientManagementCluster * mTlsClientManagementCluster = nullptr;
190190

191-
// sets the TlsClientManagement Server pointer
192-
void SetTlsClientManagementServer(TlsClientManagementServer * tlsClientManagementServer)
191+
// sets the TlsClientManagement Cluster pointer
192+
void SetTlsClientManagementCluster(TlsClientManagementCluster * tlsClientManagementServer)
193193
{
194-
mTlsClientManagementServer = tlsClientManagementServer;
194+
mTlsClientManagementCluster = tlsClientManagementServer;
195195
}
196-
TlsClientManagementServer * GetTlsClientManagementServer() const { return mTlsClientManagementServer; }
196+
TlsClientManagementCluster * GetTlsClientManagementCluster() const { return mTlsClientManagementCluster; }
197197
};
198198

199199
} // namespace Clusters

src/app/clusters/tls-client-management-server/app_config_dependent_sources.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ TARGET_SOURCES(
1818
PRIVATE
1919
"${CHIP_APP_BASE_DIR}/clusters/tls-certificate-management-server/CertificateTableImpl.cpp"
2020
"${CHIP_APP_BASE_DIR}/clusters/tls-certificate-management-server/CertificateTableImpl.h"
21-
"${CLUSTER_DIR}/tls-client-management-server.cpp"
22-
"${CLUSTER_DIR}/tls-client-management-server.h"
21+
"${CLUSTER_DIR}/TlsClientManagementCluster.cpp"
22+
"${CLUSTER_DIR}/TlsClientManagementCluster.h"
2323
)

0 commit comments

Comments
 (0)