Skip to content

Commit

Permalink
[Fabric-Sync] Synchronize all required attributes (project-chip#36780)
Browse files Browse the repository at this point in the history
* [Fabric-Sync] Synchronize all required attributes

* Revert commit 8126bbd

* Synchronize all required attributes
  • Loading branch information
arkq authored Dec 11, 2024
1 parent 572a799 commit 7ceaf6f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/fabric-sync/admin/DeviceSynchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<chip::VendorId>(vendorId);
}
}
break;
case Clusters::BasicInformation::Attributes::VendorName::Id: {
char vendorNameBuffer[kBasicInformationAttributeBufSize];
if (SuccessOrLog(data->GetString(vendorNameBuffer, sizeof(vendorNameBuffer)), "VendorName"))
Expand All @@ -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"))
Expand All @@ -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)),
Expand Down

0 comments on commit 7ceaf6f

Please sign in to comment.