diff --git a/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp b/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp index f50bf4f58f257d..03f2581a0e443f 100644 --- a/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp +++ b/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp @@ -57,10 +57,10 @@ CHIP_ERROR ExtensionFieldSetsImpl::Deserialize(TLV::TLVReader & reader, TLV::Tag } mFieldSetsCount = i; - // In the event of an OTA where the maximum number of cluster per scene has been reduced, the extension field set will be + // In the event of an OTA where the maximum number of clusters per scene has been reduced, the extension field set will be // considered "corrupted" if we don't manage to load it all (if err == CHIP_NO_ERROR after the loop). We therefore return an - // error and this scene will have to be deleted. This is done because truncating an EFS doesn't garrantee the order of the - // clusters loaded, which might allow to load clusters that are no longer supported and loosing supported ones. + // error and this scene will have to be deleted. This is done because truncating an EFS doesn't guarantee the order of the + // clusters loaded, which might lead to loading clusters that are no longer supported and losing supported ones. if (err != CHIP_END_OF_TLV) { if (err == CHIP_NO_ERROR) @@ -75,7 +75,6 @@ CHIP_ERROR ExtensionFieldSetsImpl::Deserialize(TLV::TLVReader & reader, TLV::Tag void ExtensionFieldSetsImpl::Clear() { - for (uint8_t i = 0; i < mFieldSetsCount; i++) { mFieldSets[i].Clear(); diff --git a/src/app/clusters/scenes/SceneTable.h b/src/app/clusters/scenes/SceneTable.h index 6b38add6948ea7..bdb1f261cd9067 100644 --- a/src/app/clusters/scenes/SceneTable.h +++ b/src/app/clusters/scenes/SceneTable.h @@ -82,7 +82,8 @@ class SceneHandler : public IntrusiveListNodeBase<> /// @param extensionFieldSet[in] ExtensionFieldSets provided by the AddScene Command, pre initialized /// @param serialisedBytes[out] Buffer to fill from the ExtensionFieldSet in command /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise - /// @note Only gets called after the scene-cluster has previously verified that the endpoint,cluster valuer pair is supported by + /// @note Only gets called after the scene-cluster has previously verified that the endpoint,cluster pair is supported by + /// the handler. It is therefore the implementation's reponsibility to also implement the SupportsCluster method. virtual CHIP_ERROR SerializeAdd(EndpointId endpoint, const app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & extensionFieldSet, diff --git a/src/app/clusters/scenes/SceneTableImpl.h b/src/app/clusters/scenes/SceneTableImpl.h index 734cc122dfda16..00247c179945a8 100644 --- a/src/app/clusters/scenes/SceneTableImpl.h +++ b/src/app/clusters/scenes/SceneTableImpl.h @@ -78,14 +78,12 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler mValueBuffer[pairCount][valueBytesCount] = value_iterator.GetValue(); valueBytesCount++; } - // Check we could go through all bytes of the value ReturnErrorOnFailure(value_iterator.GetStatus()); mAVPairs[pairCount].attributeValue = mValueBuffer[pairCount]; mAVPairs[pairCount].attributeValue.reduce_size(valueBytesCount); pairCount++; } - // Check we could go through all pairs in incomming command ReturnErrorOnFailure(pair_iterator.GetStatus()); app::DataModel::List attributeValueList; @@ -149,14 +147,12 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler mValueBuffer[pairCount][valueBytesCount] = value_iterator.GetValue(); valueBytesCount++; } - // Check we could go through all bytes of the value ReturnErrorOnFailure(value_iterator.GetStatus()); mAVPairs[pairCount].attributeValue = mValueBuffer[pairCount]; mAVPairs[pairCount].attributeValue.reduce_size(valueBytesCount); pairCount++; }; - // Check we could go through all pairs stored in memory ReturnErrorOnFailure(pair_iterator.GetStatus()); ReturnErrorOnFailure(reader.ExitContainer(outer));