diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index 7e499a55178141..870cd9593bd510 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -300,21 +300,18 @@ void TimeSynchronizationServer::AttemptToGetFallbackNTPTimeFromDelegate() void TimeSynchronizationServer::OnDeviceConnectedFn(Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle) { // Connected to our trusted time source, let's read the time. - app::AttributePathParams readPaths[2]; - readPaths[0] = app::AttributePathParams(kRootEndpointId, app::Clusters::TimeSynchronization::Id, - app::Clusters::TimeSynchronization::Attributes::UTCTime::Id); - readPaths[1] = app::AttributePathParams(kRootEndpointId, app::Clusters::TimeSynchronization::Id, - app::Clusters::TimeSynchronization::Attributes::Granularity::Id); - - app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); - app::ReadPrepareParams readParams(sessionHandle); + AttributePathParams readPaths[2]; + readPaths[0] = AttributePathParams(kRootEndpointId, Id, Attributes::UTCTime::Id); + readPaths[1] = AttributePathParams(kRootEndpointId, Id, Attributes::Granularity::Id); + + InteractionModelEngine * engine = InteractionModelEngine::GetInstance(); + ReadPrepareParams readParams(sessionHandle); readParams.mpAttributePathParamsList = readPaths; readParams.mAttributePathParamsListSize = 2; mTrustedNodeUtcTime.SetNull(); mTrustedNodeGranularity = GranularityEnum::kNoTimeGranularity; - auto readClient = - chip::Platform::MakeUnique(engine, &exchangeMgr, *this, app::ReadClient::InteractionType::Read); + auto readClient = Platform::MakeUnique(engine, &exchangeMgr, *this, ReadClient::InteractionType::Read); if (readClient == nullptr) { // This is unlikely to work if we don't have memory, but let's try @@ -347,13 +344,13 @@ void TimeSynchronizationServer::OnAttributeData(const ConcreteDataAttributePath switch (aPath.mAttributeId) { case Attributes::UTCTime::Id: - if (chip::app::DataModel::Decode(*apData, mTrustedNodeUtcTime) != CHIP_NO_ERROR) + if (DataModel::Decode(*apData, mTrustedNodeUtcTime) != CHIP_NO_ERROR) { mTrustedNodeUtcTime.SetNull(); } break; case Attributes::Granularity::Id: - if (chip::app::DataModel::Decode(*apData, mTrustedNodeGranularity) != CHIP_NO_ERROR) + if (DataModel::Decode(*apData, mTrustedNodeGranularity) != CHIP_NO_ERROR) { mTrustedNodeGranularity = GranularityEnum::kNoTimeGranularity; } @@ -365,8 +362,6 @@ void TimeSynchronizationServer::OnAttributeData(const ConcreteDataAttributePath void TimeSynchronizationServer::OnDone(ReadClient * apReadClient) { - using namespace chip::app::Clusters::TimeSynchronization::Attributes; - if (!mTrustedNodeUtcTime.IsNull() && mTrustedNodeGranularity != GranularityEnum::kNoTimeGranularity) { GranularityEnum ourGranularity;