Skip to content

Commit 52fefc3

Browse files
authored
Merge branch 'master' into add_chef_rootnode_fan
2 parents 792b0df + d30bdd5 commit 52fefc3

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/controller/python/chip/clusters/Attribute.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,14 @@ def UpdateCachedData(self):
408408
endpointCache = attributeCache[endpoint]
409409

410410
for cluster in tlvCache[endpoint]:
411+
if cluster not in _ClusterIndex:
412+
#
413+
# #22599 tracks dealing with unknown clusters more
414+
# gracefully so that clients can still access this data.
415+
#
416+
continue
417+
411418
clusterType = _ClusterIndex[cluster]
412-
if (clusterType is None):
413-
raise Exception("Cannot find cluster in cluster index")
414419

415420
if (clusterType not in endpointCache):
416421
endpointCache[clusterType] = {}
@@ -427,9 +432,6 @@ def UpdateCachedData(self):
427432
endpointCache[clusterType].SetDataVersion(
428433
clusterDataVersion)
429434
except Exception as ex:
430-
logging.error(
431-
f"Error converting TLV to Cluster Object for path: Endpoint = {endpoint}, cluster = {str(clusterType)}")
432-
logging.error(f"|-- Exception: {repr(ex)}")
433435
decodedValue = ValueDecodeFailure(
434436
tlvCache[endpoint][cluster], ex)
435437
endpointCache[clusterType] = decodedValue
@@ -438,27 +440,26 @@ def UpdateCachedData(self):
438440
for attribute in tlvCache[endpoint][cluster]:
439441
value = tlvCache[endpoint][cluster][attribute]
440442

443+
if (cluster, attribute) not in _AttributeIndex:
444+
#
445+
# #22599 tracks dealing with unknown clusters more
446+
# gracefully so that clients can still access this data.
447+
#
448+
continue
449+
441450
attributeType = _AttributeIndex[(
442451
cluster, attribute)][0]
443-
if (attributeType is None):
444-
raise Exception(
445-
"Cannot find attribute in attribute index")
446452

447453
if (attributeType not in clusterCache):
448454
clusterCache[attributeType] = {}
449455

450456
if (type(value) is ValueDecodeFailure):
451-
logging.error(
452-
f"For path: Endpoint = {endpoint}, Attribute = {str(attributeType)}, got IM Error: {str(value.Reason)}")
453457
clusterCache[attributeType] = value
454458
else:
455459
try:
456460
decodedValue = attributeType.FromTagDictOrRawValue(
457461
tlvCache[endpoint][cluster][attribute])
458462
except Exception as ex:
459-
logging.error(
460-
f"Error converting TLV to Cluster Object for path: Endpoint = {endpoint}, Attribute = {str(attributeType)}")
461-
logging.error(f"|-- Exception: {repr(ex)}")
462463
decodedValue = ValueDecodeFailure(value, ex)
463464

464465
clusterCache[attributeType] = decodedValue

src/controller/python/chip/clusters/attribute.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ class ReadClientCallback : public ReadClient::Callback
135135
{
136136
version = aPath.mDataVersion.Value();
137137
}
138-
else
139-
{
140-
ChipLogError(DataManagement, "expect aPath has valid mDataVersion");
141-
}
138+
142139
gOnReadAttributeDataCallback(mAppContext, version, aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId,
143140
to_underlying(aStatus.mStatus), buffer.get(), size);
144141
}

src/platform/Infineon/CYW30739/KeyValueStoreManagerImpl.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key)
149149
err = CYW30739Config::ClearConfigValue(entry->GetKeyConfigKey());
150150
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
151151

152-
err = CYW30739Config::ClearConfigValue(entry->GetValueConfigKey());
153-
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
152+
if (entry->GetValueSize() != 0)
153+
{
154+
err = CYW30739Config::ClearConfigValue(entry->GetValueConfigKey());
155+
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
156+
}
154157

155158
slist_del(entry, &mKeyConfigIdList);
156159
Platform::Delete(entry);

0 commit comments

Comments
 (0)