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

Don't error when failing to set optional TimeSource attribute #29378

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,9 @@ void TimeSynchronizationServer::OnTimeSyncCompletionFn(TimeSourceEnum timeSource
}
return;
}
mGranularity = granularity;
if (EMBER_ZCL_STATUS_SUCCESS != TimeSource::Set(kRootEndpointId, timeSource))
mGranularity = granularity;
EmberAfStatus status = TimeSource::Set(kRootEndpointId, timeSource);
if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
}
Expand All @@ -405,7 +406,8 @@ void TimeSynchronizationServer::OnFallbackNTPCompletionFn(bool timeSyncSuccessfu
{
mGranularity = GranularityEnum::kMillisecondsGranularity;
// Non-matter SNTP because we know it's external and there's only one source
if (EMBER_ZCL_STATUS_SUCCESS != TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP))
EmberAfStatus status = TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP);
if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
}
Expand Down Expand Up @@ -789,8 +791,9 @@ CHIP_ERROR TimeSynchronizationServer::SetUTCTime(EndpointId ep, uint64_t utcTime
ChipLogError(Zcl, "Error setting UTC time on the device");
return err;
}
mGranularity = granularity;
if (EMBER_ZCL_STATUS_SUCCESS != TimeSource::Set(ep, source))
mGranularity = granularity;
EmberAfStatus status = TimeSource::Set(ep, source);
if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
return CHIP_IM_GLOBAL_STATUS(Failure);
Expand Down