From 7ceaf6f527108e0dbda9729471a6abb6814b5182 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 11 Dec 2024 23:14:53 +0100 Subject: [PATCH] [Fabric-Sync] Synchronize all required attributes (#36780) * [Fabric-Sync] Synchronize all required attributes * Revert commit 8126bbd * Synchronize all required attributes --- .../admin/DeviceSynchronization.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/examples/fabric-sync/admin/DeviceSynchronization.cpp b/examples/fabric-sync/admin/DeviceSynchronization.cpp index fea80780d5bb24..83e3f85ba1e5e4 100644 --- a/examples/fabric-sync/admin/DeviceSynchronization.cpp +++ b/examples/fabric-sync/admin/DeviceSynchronization.cpp @@ -91,6 +91,14 @@ void DeviceSynchronizer::OnAttributeData(const ConcreteDataAttributePath & path, } } break; + case Clusters::BasicInformation::Attributes::VendorID::Id: { + uint32_t vendorId; + if (SuccessOrLog(data->Get(vendorId), "VendorID")) + { + mCurrentDeviceData.vendorId = static_cast(vendorId); + } + } + break; case Clusters::BasicInformation::Attributes::VendorName::Id: { char vendorNameBuffer[kBasicInformationAttributeBufSize]; if (SuccessOrLog(data->GetString(vendorNameBuffer, sizeof(vendorNameBuffer)), "VendorName")) @@ -99,6 +107,14 @@ void DeviceSynchronizer::OnAttributeData(const ConcreteDataAttributePath & path, } } break; + case Clusters::BasicInformation::Attributes::ProductID::Id: { + uint32_t productId; + if (SuccessOrLog(data->Get(productId), "ProductID")) + { + mCurrentDeviceData.productId = productId; + } + } + break; case Clusters::BasicInformation::Attributes::ProductName::Id: { char productNameBuffer[kBasicInformationAttributeBufSize]; if (SuccessOrLog(data->GetString(productNameBuffer, sizeof(productNameBuffer)), "ProductName")) @@ -124,6 +140,14 @@ void DeviceSynchronizer::OnAttributeData(const ConcreteDataAttributePath & path, } } break; + case Clusters::BasicInformation::Attributes::SoftwareVersion::Id: { + uint32_t softwareVersion; + if (SuccessOrLog(data->Get(softwareVersion), "SoftwareVersion")) + { + mCurrentDeviceData.softwareVersion = softwareVersion; + } + } + break; case Clusters::BasicInformation::Attributes::SoftwareVersionString::Id: { char softwareVersionStringBuffer[kBasicInformationAttributeBufSize]; if (SuccessOrLog(data->GetString(softwareVersionStringBuffer, sizeof(softwareVersionStringBuffer)),