Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fabric-Sync] Synchronize all required attributes #36780

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading