Skip to content

Commit

Permalink
- made AttemptToGetTimeFromTrustedNode() public API
Browse files Browse the repository at this point in the history
- free readclient memory after read is complete
  • Loading branch information
fessehaeve committed Apr 4, 2024
1 parent a142745 commit 1e5de9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ void TimeSynchronizationServer::OnDone(ReadClient * apReadClient)
SetUTCTime(kRootEndpointId, mTimeReadInfo->utcTime.Value(), ourGranularity, TimeSourceEnum::kNodeTimeCluster);
if (err == CHIP_NO_ERROR)
{
mTimeReadInfo = nullptr;
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class TimeSynchronizationServer : public FabricTable::Delegate
// ReadClient::Callback functions
void OnAttributeData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) override;
void OnDone(ReadClient * apReadClient) override;

CHIP_ERROR AttemptToGetTimeFromTrustedNode();
#endif

// Platform event handler functions
Expand Down Expand Up @@ -166,7 +168,6 @@ class TimeSynchronizationServer : public FabricTable::Delegate

// Called when the platform is set up - attempts to get time using the recommended source list in the spec.
void AttemptToGetTime();
CHIP_ERROR AttemptToGetTimeFromTrustedNode();
// Attempts to get fallback NTP from the delegate (last available source)
// If successful, the function will set mGranulatiry and the time source
// If unsuccessful, it will emit a TimeFailure event.
Expand Down

0 comments on commit 1e5de9c

Please sign in to comment.