Skip to content

Commit 1066776

Browse files
Merge 827aedd into cee75c3
2 parents cee75c3 + 827aedd commit 1066776

File tree

13 files changed

+57
-74
lines changed

13 files changed

+57
-74
lines changed

src/app/AttributeAccessInterface.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#pragma once
2020

21-
#include <app/ClusterInfo.h>
21+
#include <app/ConcreteAttributePath.h>
2222
#include <app/MessageDef/AttributeDataElement.h>
2323
#include <app/data-model/Encode.h>
2424
#include <app/data-model/List.h> // So we can encode lists
@@ -108,7 +108,7 @@ class AttributeAccessInterface
108108
/**
109109
* Callback for reading attributes.
110110
*
111-
* @param [in] aClusterInfo indicates which exact data is being read.
111+
* @param [in] aPath indicates which exact data is being read.
112112
* @param [in] aEncoder the AttributeValueEncoder to use for encoding the
113113
* data. If this function returns scucess and no attempt is
114114
* made to encode data using aEncoder, the
@@ -117,7 +117,7 @@ class AttributeAccessInterface
117117
* This may involve reading from the attribute store or external
118118
* attribute callbacks.
119119
*/
120-
virtual CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) = 0;
120+
virtual CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) = 0;
121121

122122
/**
123123
* Mechanism for keeping track of a chain of AttributeAccessInterfaces.

src/app/InteractionModelEngine.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <app/Command.h>
4343
#include <app/CommandHandler.h>
4444
#include <app/CommandSender.h>
45+
#include <app/ConcreteAttributePath.h>
4546
#include <app/ConcreteCommandPath.h>
4647
#include <app/InteractionModelDelegate.h>
4748
#include <app/ReadClient.h>
@@ -239,15 +240,19 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath);
239240
* This function is implemented by CHIP as a part of cluster data storage & management.
240241
* The apWriter and apDataExists can be nullptr.
241242
*
242-
* @param[in] aClusterInfo The cluster info object, for the path of cluster data.
243+
* @param[in] aPath The concrete path of the data being read.
243244
* @param[in] apWriter The TLVWriter for holding cluster data. Can be a nullptr if the caller does not care
244245
* the exact value of the attribute.
245246
* @param[out] apDataExists Tell whether the cluster data exist on server. Can be a nullptr if the caller does not care
246247
* whether the data exists.
247248
*
248249
* @retval CHIP_NO_ERROR on success
249250
*/
250-
CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists);
251+
CHIP_ERROR ReadSingleClusterData(const ConcreteAttributePath & aPath, TLV::TLVWriter * apWriter, bool * apDataExists);
252+
253+
/**
254+
* TODO: Document.
255+
*/
251256
CHIP_ERROR WriteSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVReader & aReader, WriteHandler * apWriteHandler);
252257
} // namespace app
253258
} // namespace chip

src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface
4242
// Register for the EthernetNetworkDiagnostics cluster on all endpoints.
4343
EthernetDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), EthernetNetworkDiagnostics::Id) {}
4444

45-
CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) override;
45+
CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
4646

4747
private:
4848
template <typename T>
@@ -69,15 +69,15 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (Connectivit
6969

7070
EthernetDiagosticsAttrAccess gAttrAccess;
7171

72-
CHIP_ERROR EthernetDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder)
72+
CHIP_ERROR EthernetDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder)
7373
{
74-
if (aClusterInfo.mClusterId != EthernetNetworkDiagnostics::Id)
74+
if (aPath.mClusterId != EthernetNetworkDiagnostics::Id)
7575
{
7676
// We shouldn't have been called at all.
7777
return CHIP_ERROR_INVALID_ARGUMENT;
7878
}
7979

80-
switch (aClusterInfo.mFieldId)
80+
switch (aPath.mAttributeId)
8181
{
8282
case PHYRate::Id: {
8383
return ReadIfSupported(&ConnectivityManager::GetEthPHYRate, aEncoder);

src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GeneralDiagosticsAttrAccess : public AttributeAccessInterface
3535
// Register for the GeneralDiagnostics cluster on all endpoints.
3636
GeneralDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), GeneralDiagnostics::Id) {}
3737

38-
CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) override;
38+
CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
3939

4040
private:
4141
template <typename T>
@@ -62,15 +62,15 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (PlatformMana
6262

6363
GeneralDiagosticsAttrAccess gAttrAccess;
6464

65-
CHIP_ERROR GeneralDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder)
65+
CHIP_ERROR GeneralDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder)
6666
{
67-
if (aClusterInfo.mClusterId != GeneralDiagnostics::Id)
67+
if (aPath.mClusterId != GeneralDiagnostics::Id)
6868
{
6969
// We shouldn't have been called at all.
7070
return CHIP_ERROR_INVALID_ARGUMENT;
7171
}
7272

73-
switch (aClusterInfo.mFieldId)
73+
switch (aPath.mAttributeId)
7474
{
7575
case RebootCount::Id: {
7676
return ReadIfSupported(&PlatformManager::GetRebootCount, aEncoder);

src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface
4242
// Register for the SoftwareDiagnostics cluster on all endpoints.
4343
SoftwareDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), SoftwareDiagnostics::Id) {}
4444

45-
CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) override;
45+
CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
4646

4747
private:
4848
CHIP_ERROR ReadIfSupported(CHIP_ERROR (PlatformManager::*getter)(uint64_t &), AttributeValueEncoder & aEncoder);
4949
};
5050

5151
SoftwareDiagosticsAttrAccess gAttrAccess;
5252

53-
CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder)
53+
CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder)
5454
{
55-
if (aClusterInfo.mClusterId != SoftwareDiagnostics::Id)
55+
if (aPath.mClusterId != SoftwareDiagnostics::Id)
5656
{
5757
// We shouldn't have been called at all.
5858
return CHIP_ERROR_INVALID_ARGUMENT;
5959
}
6060

61-
switch (aClusterInfo.mFieldId)
61+
switch (aPath.mAttributeId)
6262
{
6363
case CurrentHeapFree::Id: {
6464
return ReadIfSupported(&PlatformManager::GetCurrentHeapFree, aEncoder);

src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ class ThreadDiagosticsAttrAccess : public AttributeAccessInterface
4646
// Register for the ThreadNetworkDiagnostics cluster on all endpoints.
4747
ThreadDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), ThreadNetworkDiagnostics::Id) {}
4848

49-
CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) override;
49+
CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
5050
};
5151

5252
ThreadDiagosticsAttrAccess gAttrAccess;
5353

54-
CHIP_ERROR ThreadDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder)
54+
CHIP_ERROR ThreadDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder)
5555
{
56-
if (aClusterInfo.mClusterId != ThreadNetworkDiagnostics::Id)
56+
if (aPath.mClusterId != ThreadNetworkDiagnostics::Id)
5757
{
5858
// We shouldn't have been called at all.
5959
return CHIP_ERROR_INVALID_ARGUMENT;
6060
}
6161

62-
CHIP_ERROR err = ConnectivityMgr().WriteThreadNetworkDiagnosticAttributeToTlv(aClusterInfo.mFieldId, aEncoder);
62+
CHIP_ERROR err = ConnectivityMgr().WriteThreadNetworkDiagnosticAttributeToTlv(aPath.mAttributeId, aEncoder);
6363

6464
// If it isn't a run time assigned attribute, e.g. ClusterRevision, or if
6565
// not implemented, clear the error so we fall back to the standard read

src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class WiFiDiagosticsAttrAccess : public AttributeAccessInterface
4242
// Register for the WiFiNetworkDiagnostics cluster on all endpoints.
4343
WiFiDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), WiFiNetworkDiagnostics::Id) {}
4444

45-
CHIP_ERROR Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder) override;
45+
CHIP_ERROR Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
4646

4747
private:
4848
template <typename T>
@@ -69,15 +69,15 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (ConnectivityMan
6969

7070
WiFiDiagosticsAttrAccess gAttrAccess;
7171

72-
CHIP_ERROR WiFiDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, AttributeValueEncoder & aEncoder)
72+
CHIP_ERROR WiFiDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPath, AttributeValueEncoder & aEncoder)
7373
{
74-
if (aClusterInfo.mClusterId != WiFiNetworkDiagnostics::Id)
74+
if (aPath.mClusterId != WiFiNetworkDiagnostics::Id)
7575
{
7676
// We shouldn't have been called at all.
7777
return CHIP_ERROR_INVALID_ARGUMENT;
7878
}
7979

80-
switch (aClusterInfo.mFieldId)
80+
switch (aPath.mAttributeId)
8181
{
8282
case Attributes::SecurityType::Id: {
8383
return ReadIfSupported(&ConnectivityManager::GetWiFiSecurityType, aEncoder);

src/app/reporting/Engine.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ EventNumber Engine::CountEvents(ReadHandler * apReadHandler, EventNumber * apIni
6464
CHIP_ERROR
6565
Engine::RetrieveClusterData(AttributeDataList::Builder & aAttributeDataList, ClusterInfo & aClusterInfo)
6666
{
67-
CHIP_ERROR err = CHIP_NO_ERROR;
67+
CHIP_ERROR err = CHIP_NO_ERROR;
68+
ConcreteAttributePath path(aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mFieldId);
6869
AttributeDataElement::Builder attributeDataElementBuilder = aAttributeDataList.CreateAttributeDataElementBuilder();
6970
AttributePath::Builder attributePathBuilder = attributeDataElementBuilder.CreateAttributePathBuilder();
7071
attributePathBuilder.NodeId(aClusterInfo.mNodeId)
@@ -78,7 +79,7 @@ Engine::RetrieveClusterData(AttributeDataList::Builder & aAttributeDataList, Clu
7879
ChipLogDetail(DataManagement, "<RE:Run> Cluster %" PRIx32 ", Field %" PRIx32 " is dirty", aClusterInfo.mClusterId,
7980
aClusterInfo.mFieldId);
8081

81-
err = ReadSingleClusterData(aClusterInfo, attributeDataElementBuilder.GetWriter(), nullptr /* data exists */);
82+
err = ReadSingleClusterData(path, attributeDataElementBuilder.GetWriter(), nullptr /* data exists */);
8283
SuccessOrExit(err);
8384
attributeDataElementBuilder.MoreClusterData(false);
8485
attributeDataElementBuilder.EndOfAttributeDataElement();

src/app/tests/TestReadInteraction.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*
2323
*/
2424

25+
#include <app/AttributeAccessInterface.h>
2526
#include <app/InteractionModelEngine.h>
2627
#include <app/MessageDef/EventDataElement.h>
2728
#include <app/util/basic-types.h>
@@ -230,29 +231,28 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate
230231

231232
namespace chip {
232233
namespace app {
233-
CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists)
234+
CHIP_ERROR ReadSingleClusterData(const ConcreteAttributePath & aPath, TLV::TLVWriter * apWriter, bool * apDataExists)
234235
{
235236
uint64_t version = 0;
236-
ChipLogDetail(DataManagement, "TEST Cluster %" PRIx32 ", Field %" PRIx32 " is dirty", aClusterInfo.mClusterId,
237-
aClusterInfo.mFieldId);
237+
ChipLogDetail(DataManagement, "TEST Cluster %" PRIx32 ", Field %" PRIx32 " is dirty", aPath.mClusterId, aPath.mAttributeId);
238238

239239
if (apDataExists != nullptr)
240240
{
241-
*apDataExists = (aClusterInfo.mClusterId == kTestClusterId && aClusterInfo.mEndpointId == kTestEndpointId);
241+
*apDataExists = (aPath.mClusterId == kTestClusterId && aPath.mEndpointId == kTestEndpointId);
242242
}
243243

244244
if (apWriter == nullptr)
245245
{
246246
return CHIP_NO_ERROR;
247247
}
248248

249-
if (!(aClusterInfo.mClusterId == kTestClusterId && aClusterInfo.mEndpointId == kTestEndpointId))
249+
if (!(aPath.mClusterId == kTestClusterId && aPath.mEndpointId == kTestEndpointId))
250250
{
251251
return apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status),
252252
chip::Protocols::InteractionModel::Status::UnsupportedAttribute);
253253
}
254254

255-
ReturnErrorOnFailure(apWriter->Put(TLV::ContextTag(AttributeDataElement::kCsTag_Data), kTestFieldValue1));
255+
ReturnErrorOnFailure(AttributeValueEncoder(apWriter).Encode(kTestFieldValue1));
256256
return apWriter->Put(TLV::ContextTag(AttributeDataElement::kCsTag_DataVersion), version);
257257
}
258258

src/app/tests/TestReportingEngine.cpp

+1-24
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*
2323
*/
2424

25+
#include <app/ConcreteAttributePath.h>
2526
#include <app/InteractionModelEngine.h>
2627
#include <app/reporting/Engine.h>
2728
#include <lib/core/CHIPCore.h>
@@ -54,32 +55,8 @@ constexpr ClusterId kTestClusterId = 6;
5455
constexpr EndpointId kTestEndpointId = 1;
5556
constexpr chip::AttributeId kTestFieldId1 = 1;
5657
constexpr chip::AttributeId kTestFieldId2 = 2;
57-
constexpr uint8_t kTestFieldValue1 = 1;
58-
constexpr uint8_t kTestFieldValue2 = 2;
5958

6059
namespace app {
61-
CHIP_ERROR ReadSingleClusterData(AttributePathParams & aAttributePathParams, TLV::TLVWriter * apWriter, bool * apDataExists)
62-
{
63-
CHIP_ERROR err = CHIP_NO_ERROR;
64-
VerifyOrExit(aAttributePathParams.mClusterId == kTestClusterId && aAttributePathParams.mEndpointId == kTestEndpointId,
65-
err = CHIP_ERROR_INVALID_ARGUMENT);
66-
VerifyOrExit(apWriter != nullptr, /* no op */);
67-
68-
if (aAttributePathParams.mFieldId == kTestFieldId1)
69-
{
70-
err = apWriter->Put(TLV::ContextTag(kTestFieldId1), kTestFieldValue1);
71-
SuccessOrExit(err);
72-
}
73-
if (aAttributePathParams.mFieldId == kTestFieldId2)
74-
{
75-
err = apWriter->Put(TLV::ContextTag(kTestFieldId2), kTestFieldValue2);
76-
SuccessOrExit(err);
77-
}
78-
79-
exit:
80-
return err;
81-
}
82-
8360
namespace reporting {
8461
class TestReportingEngine
8562
{

src/app/tests/integration/chip_im_initiator.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "system/SystemClock.h"
2828
#include <app/CommandHandler.h>
2929
#include <app/CommandSender.h>
30+
#include <app/ConcreteAttributePath.h>
3031
#include <app/InteractionModelEngine.h>
3132
#include <app/tests/integration/common.h>
3233
#include <chrono>
@@ -635,7 +636,7 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa
635636
gLastCommandResult = TestCommandResult::kSuccess;
636637
}
637638

638-
CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists)
639+
CHIP_ERROR ReadSingleClusterData(const ConcreteAttributePath & aPath, TLV::TLVWriter * apWriter, bool * apDataExists)
639640
{
640641
// We do not really care about the value, just return a not found status code.
641642
VerifyOrReturnError(apWriter != nullptr, CHIP_NO_ERROR);

src/app/tests/integration/chip_im_responder.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626

2727
#include "MockEvents.h"
28+
#include <app/AttributeAccessInterface.h>
2829
#include <app/CommandHandler.h>
2930
#include <app/CommandSender.h>
3031
#include <app/EventManagement.h>
@@ -110,15 +111,14 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa
110111
// Nothing todo.
111112
}
112113

113-
CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists)
114+
CHIP_ERROR ReadSingleClusterData(const ConcreteAttributePath & aPath, TLV::TLVWriter * apWriter, bool * apDataExists)
114115
{
115116
CHIP_ERROR err = CHIP_NO_ERROR;
116117
uint64_t version = 0;
117-
VerifyOrExit(aClusterInfo.mClusterId == kTestClusterId && aClusterInfo.mEndpointId == kTestEndpointId,
118-
err = CHIP_ERROR_INVALID_ARGUMENT);
118+
VerifyOrExit(aPath.mClusterId == kTestClusterId && aPath.mEndpointId == kTestEndpointId, err = CHIP_ERROR_INVALID_ARGUMENT);
119119
VerifyOrExit(apWriter != nullptr, /* no op */);
120120

121-
err = apWriter->Put(TLV::ContextTag(AttributeDataElement::kCsTag_Data), kTestFieldValue1);
121+
err = AttributeValueEncoder(apWriter).Encode(kTestFieldValue1);
122122
SuccessOrExit(err);
123123
err = apWriter->Put(TLV::ContextTag(AttributeDataElement::kCsTag_DataVersion), version);
124124

src/app/util/ember-compatibility-functions.cpp

+11-12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <app/ClusterInfo.h>
2525
#include <app/Command.h>
26+
#include <app/ConcreteAttributePath.h>
2627
#include <app/InteractionModelEngine.h>
2728
#include <app/reporting/Engine.h>
2829
#include <app/util/af.h>
@@ -189,21 +190,19 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath)
189190
return emberAfContainsServer(aCommandPath.mEndpointId, aCommandPath.mClusterId);
190191
}
191192

192-
CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists)
193+
CHIP_ERROR ReadSingleClusterData(const ConcreteAttributePath & aPath, TLV::TLVWriter * apWriter, bool * apDataExists)
193194
{
194195
ChipLogDetail(DataManagement,
195-
"Received Cluster Command: Cluster=" ChipLogFormatMEI " NodeId=0x" ChipLogFormatX64 " Endpoint=%" PRIx16
196-
" AttributeId=%" PRIx32 " ListIndex=%" PRIx16,
197-
ChipLogValueMEI(aClusterInfo.mClusterId), ChipLogValueX64(aClusterInfo.mNodeId), aClusterInfo.mEndpointId,
198-
aClusterInfo.mFieldId, aClusterInfo.mListIndex);
196+
"Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=%" PRIx16 " AttributeId=" ChipLogFormatMEI,
197+
ChipLogValueMEI(aPath.mClusterId), aPath.mEndpointId, ChipLogValueMEI(aPath.mAttributeId));
199198

200-
AttributeAccessInterface * attrOverride = findAttributeAccessOverride(aClusterInfo.mEndpointId, aClusterInfo.mClusterId);
199+
AttributeAccessInterface * attrOverride = findAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId);
201200
if (attrOverride != nullptr)
202201
{
203202
// TODO: We should probably clone the writer and convert failures here
204203
// into status responses, unless our caller already does that.
205204
AttributeValueEncoder valueEncoder(apWriter);
206-
ReturnErrorOnFailure(attrOverride->Read(aClusterInfo, valueEncoder));
205+
ReturnErrorOnFailure(attrOverride->Read(aPath, valueEncoder));
207206

208207
if (valueEncoder.TriedEncode())
209208
{
@@ -223,8 +222,8 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap
223222

224223
EmberAfAttributeType attributeType;
225224
EmberAfStatus status;
226-
status = emberAfReadAttribute(aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mFieldId, CLUSTER_MASK_SERVER,
227-
attributeData, sizeof(attributeData), &attributeType);
225+
status = emberAfReadAttribute(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, CLUSTER_MASK_SERVER, attributeData,
226+
sizeof(attributeData), &attributeType);
228227

229228
if (apDataExists != nullptr)
230229
{
@@ -349,9 +348,9 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap
349348
ReturnErrorOnFailure(
350349
apWriter->StartContainer(TLV::ContextTag(AttributeDataElement::kCsTag_Data), TLV::kTLVType_List, containerType));
351350
// TODO: Encode data in TLV, now raw buffers
352-
ReturnErrorOnFailure(apWriter->PutBytes(
353-
TLV::AnonymousTag, attributeData,
354-
emberAfAttributeValueSize(aClusterInfo.mClusterId, aClusterInfo.mFieldId, attributeType, attributeData)));
351+
ReturnErrorOnFailure(
352+
apWriter->PutBytes(TLV::AnonymousTag, attributeData,
353+
emberAfAttributeValueSize(aPath.mClusterId, aPath.mAttributeId, attributeType, attributeData)));
355354
ReturnErrorOnFailure(apWriter->EndContainer(containerType));
356355
break;
357356
}

0 commit comments

Comments
 (0)