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