Skip to content

Commit 5098c63

Browse files
authored
Fix missing report generation for PushAV and TLS clusters when Commands change attributes (project-chip#41837)
* [PushAV] Add call to report generation on SetTransportStatus and ModifyPushTransport. * [TLSCert and TLSClient Management] Add attribute change reporting when commands update the corresponding list attributes.
1 parent bf45da8 commit 5098c63

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,9 @@ PushAvStreamTransportServerLogic::HandleModifyPushTransport(CommandHandler & han
10121012
if (status == Status::Success)
10131013
{
10141014
transportConfiguration->SetTransportOptionsPtr(transportOptionsPtr);
1015+
1016+
MatterReportingAttributeChangeCallback(mEndpointId, PushAvStreamTransport::Id,
1017+
PushAvStreamTransport::Attributes::CurrentConnections::Id);
10151018
}
10161019

10171020
handler.AddStatus(commandPath, status);
@@ -1079,6 +1082,9 @@ PushAvStreamTransportServerLogic::HandleSetTransportStatus(CommandHandler & hand
10791082
}
10801083
}
10811084
}
1085+
1086+
MatterReportingAttributeChangeCallback(mEndpointId, PushAvStreamTransport::Id,
1087+
PushAvStreamTransport::Attributes::CurrentConnections::Id);
10821088
}
10831089
handler.AddStatus(commandPath, status);
10841090

src/app/clusters/tls-certificate-management-server/tls-certificate-management-server.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ void TlsCertificateManagementServer::HandleProvisionRootCertificate(HandlerConte
257257
}
258258

259259
VerifyOrDieWithMsg(response.caid <= kMaxRootCertId, NotSpecified, "Spec requires CAID to be < kMaxRootCertId");
260+
260261
ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response);
262+
263+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsCertificateManagement::Id,
264+
TlsCertificateManagement::Attributes::ProvisionedRootCertificates::Id);
261265
}
262266

263267
void TlsCertificateManagementServer::HandleFindRootCertificate(HandlerContext & ctx, const FindRootCertificate::DecodableType & req)
@@ -338,6 +342,13 @@ void TlsCertificateManagementServer::HandleRemoveRootCertificate(HandlerContext
338342
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::InvalidInState));
339343

340344
auto result = mDelegate.RemoveRootCert(ctx.mRequestPath.mEndpointId, ctx.mCommandHandler.GetAccessingFabricIndex(), req.caid);
345+
346+
if (result == Status::Success)
347+
{
348+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsCertificateManagement::Id,
349+
TlsCertificateManagement::Attributes::ProvisionedRootCertificates::Id);
350+
}
351+
341352
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, result);
342353
}
343354

@@ -412,6 +423,13 @@ void TlsCertificateManagementServer::HandleProvisionClientCertificate(HandlerCon
412423
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::NotFound));
413424

414425
auto status = mDelegate.ProvisionClientCert(ctx.mRequestPath.mEndpointId, fabric, req);
426+
427+
if (status == Status::Success)
428+
{
429+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsCertificateManagement::Id,
430+
TlsCertificateManagement::Attributes::ProvisionedClientCertificates::Id);
431+
}
432+
415433
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status);
416434
}
417435

@@ -498,6 +516,13 @@ void TlsCertificateManagementServer::HandleRemoveClientCertificate(HandlerContex
498516

499517
auto result =
500518
mDelegate.RemoveClientCert(ctx.mRequestPath.mEndpointId, ctx.mCommandHandler.GetAccessingFabricIndex(), req.ccdid);
519+
520+
if (result == Status::Success)
521+
{
522+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsCertificateManagement::Id,
523+
TlsCertificateManagement::Attributes::ProvisionedClientCertificates::Id);
524+
}
525+
501526
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, result);
502527
}
503528

src/app/clusters/tls-client-management-server/tls-client-management-server.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ void TlsClientManagementServer::HandleProvisionEndpoint(HandlerContext & ctx,
169169
if (status.IsSuccess())
170170
{
171171
ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response);
172+
173+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsClientManagement::Id,
174+
TlsClientManagement::Attributes::ProvisionedEndpoints::Id);
172175
}
173176
else
174177
{
@@ -209,6 +212,13 @@ void TlsClientManagementServer::HandleRemoveEndpoint(HandlerContext & ctx, const
209212

210213
auto status = mDelegate.RemoveProvisionedEndpointByID(ctx.mRequestPath.mEndpointId,
211214
ctx.mCommandHandler.GetAccessingFabricIndex(), req.endpointID);
215+
216+
if (status == Status::Success)
217+
{
218+
MatterReportingAttributeChangeCallback(ctx.mRequestPath.mEndpointId, TlsClientManagement::Id,
219+
TlsClientManagement::Attributes::ProvisionedEndpoints::Id);
220+
}
221+
212222
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status);
213223
}
214224

0 commit comments

Comments
 (0)