@@ -381,12 +381,8 @@ void TimeSynchronizationServer::OnTimeSyncCompletionFn(TimeSourceEnum timeSource
381
381
}
382
382
return ;
383
383
}
384
- mGranularity = granularity;
385
- Status status = TimeSource::Set (kRootEndpointId , timeSource);
386
- if (!(status == Status::Success || status == Status::UnsupportedAttribute))
387
- {
388
- ChipLogError (Zcl, " Writing TimeSource failed." );
389
- }
384
+ mGranularity = granularity;
385
+ mTimeSource = timeSource;
390
386
}
391
387
392
388
void TimeSynchronizationServer::OnFallbackNTPCompletionFn (bool timeSyncSuccessful)
@@ -395,11 +391,7 @@ void TimeSynchronizationServer::OnFallbackNTPCompletionFn(bool timeSyncSuccessfu
395
391
{
396
392
mGranularity = GranularityEnum::kMillisecondsGranularity ;
397
393
// Non-matter SNTP because we know it's external and there's only one source
398
- Status status = TimeSource::Set (kRootEndpointId , TimeSourceEnum::kNonMatterSNTP );
399
- if (!(status == Status::Success || status == Status::UnsupportedAttribute))
400
- {
401
- ChipLogError (Zcl, " Writing TimeSource failed." );
402
- }
394
+ mTimeSource = TimeSourceEnum::kNonMatterSNTP ;
403
395
}
404
396
else
405
397
{
@@ -795,13 +787,8 @@ CHIP_ERROR TimeSynchronizationServer::SetUTCTime(EndpointId ep, uint64_t utcTime
795
787
return err;
796
788
}
797
789
GetDelegate ()->UTCTimeAvailabilityChanged (utcTime);
798
- mGranularity = static_cast <GranularityEnum>(to_underlying (granularity) - 1 );
799
- Status status = TimeSource::Set (ep, source);
800
- if (!(status == Status::Success || status == Status::UnsupportedAttribute))
801
- {
802
- ChipLogError (Zcl, " Writing TimeSource failed." );
803
- return StatusIB (status).ToChipError ();
804
- }
790
+ mGranularity = static_cast <GranularityEnum>(to_underlying (granularity) - 1 );
791
+ mTimeSource = source;
805
792
return CHIP_NO_ERROR;
806
793
}
807
794
0 commit comments