Skip to content

Commit

Permalink
changes based on CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
fessehaeve committed May 2, 2023
1 parent d31ca28 commit ac2f0c9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace chip {
// w.put(None, s)
// len(w.encoding)
constexpr size_t kTrustedTimeSourceMaxSerializedSize = 23u + 9u; // adding 9 as buffer
constexpr size_t kDefaultNtpMaxSerializedSize = 133u + 11u; // adding 11 as buffer
constexpr size_t kTimeZoneMaxSerializedSize = 90u + 6u; // adding 6 as buffer
constexpr size_t kDSTOffsetMaxSerializedSize = 34u + 6u; // adding 6 as buffer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@
* limitations under the License.
*/

#include <app-common/zap-generated/cluster-objects.h>

#include "TimeSyncManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
#include <app/util/af.h>
#include <list>

using namespace chip::app::Clusters::TimeSynchronization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@

#pragma once

#include <app-common/zap-generated/cluster-objects.h>

#include "time-synchronization-delegate.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
#include <app/util/af.h>
#include <list>

namespace chip {
namespace app {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@

#pragma once

#include <app-common/zap-generated/cluster-objects.h>

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
#include <app/util/af.h>
#include <list>

namespace chip {
namespace app {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ CHIP_ERROR TimeSynchronizationServer::SetTimeZone(DataModel::DecodableList<TimeS
{
auto tzL = mTimeZoneList.begin();
auto newTzL = tz.begin();
size_t i = 0;
uint8_t i = 0;

while (newTzL.Next() && i < CHIP_CONFIG_TIME_ZONE_LIST_MAX_SIZE)
{
Expand All @@ -169,7 +169,7 @@ TimeSynchronizationServer::SetDSTOffset(DataModel::DecodableList<TimeSynchroniza
{
auto dstL = mDstOffsetList.begin();
auto newDstL = dst.begin();
size_t i = 0;
uint8_t i = 0;

while (newDstL.Next() && i < CHIP_CONFIG_DST_OFFSET_LIST_MAX_SIZE)
{
Expand Down Expand Up @@ -260,7 +260,7 @@ TimeSynchronizationAttrAccess gAttrAccess;

CHIP_ERROR TimeSynchronizationAttrAccess::ReadTrustedTimeSource(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
auto tts = TimeSynchronizationServer::Instance().GetTrustedTimeSource();
auto tts = TimeSynchronizationServer::Instance().GetTrustedTimeSource();
return aEncoder.Encode(tts);
}

Expand Down Expand Up @@ -464,8 +464,6 @@ static bool utcTimeChanged(uint64_t utcTime)
Server::GetInstance().GetFabricTable().GetLastKnownGoodChipEpochTime(lastKnownGoodChipEpoch);
System::SystemClock().GetClock_RealTime(realTime);
chip::UnixEpochToChipEpochTime((uint32_t)(utcTime / chip::kMicrosecondsPerSecond), utcTimetoChipEpoch);
ChipLogProgress(Zcl, "UTC ChipEpoch Time: %u Last Known Good Time: %u Real Time: %llu", utcTimetoChipEpoch,
lastKnownGoodChipEpoch.count(), realTime.count());

VerifyOrReturnValue(Server::GetInstance().GetFabricTable().SetLastKnownGoodChipEpochTime(
System::Clock::Seconds32(utcTimetoChipEpoch)) == CHIP_NO_ERROR,
Expand All @@ -474,7 +472,6 @@ static bool utcTimeChanged(uint64_t utcTime)

Server::GetInstance().GetFabricTable().GetLastKnownGoodChipEpochTime(lastKnownGoodChipEpoch);
System::SystemClock().GetClock_RealTime(realTime);
ChipLogProgress(Zcl, " Last Known Good Time: %u Real Time: %llu", lastKnownGoodChipEpoch.count(), realTime.count());
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/controller/data_model/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ if (current_os == "android" || build_java_matter_controller) {
"jni/UnitTestingClient-InvokeSubscribeImpl.cpp",
"jni/ClientMonitoringClient-ReadImpl.cpp",
"jni/ClientMonitoringClient-InvokeSubscribeImpl.cpp",
"jni/TimeSynchronizationClient-ReadImpl.cpp",
"jni/TimeSynchronizationClient-InvokeSubscribeImpl.cpp",
]

deps = [
Expand Down

0 comments on commit ac2f0c9

Please sign in to comment.