// SPDX-License-Identifier: MPL-2.0 // Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) #pragma once #include #include #include #include #include "common.h" namespace skyline::service::timesrv { namespace core { struct TimeServiceObject; } class IStaticService; /** * @brief time:m (we don't expose this as IPC as games don't use it) is used to manage the state of timesrv * @url https://switchbrew.org/w/index.php?title=PSC_services#time:m */ class TimeManagerServer { private: core::TimeServiceObject &core; public: TimeManagerServer(core::TimeServiceObject &core); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#GetStaticServiceAsUser */ std::shared_ptr GetStaticServiceAsUser(const DeviceState &state, ServiceManager &manager); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#GetStaticServiceAsAdmin */ std::shared_ptr GetStaticServiceAsAdmin(const DeviceState &state, ServiceManager &manager); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#GetStaticServiceAsRepair */ std::shared_ptr GetStaticServiceAsRepair(const DeviceState &state, ServiceManager &manager); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#GetStaticServiceAsServiceManager */ std::shared_ptr GetStaticServiceAsServiceManager(const DeviceState &state, ServiceManager &manager); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupStandardSteadyClockCore */ Result SetupStandardSteadyClock(UUID rtcId, TimeSpanType rtcOffset, TimeSpanType internalOffset, TimeSpanType testOffset, bool rtcResetDetected); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupStandardLocalSystemClockCore */ Result SetupStandardLocalSystemClock(const SystemClockContext &context, PosixTime posixTime); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupStandardNetworkSystemClockCore */ Result SetupStandardNetworkSystemClock(const SystemClockContext &context, TimeSpanType sufficientAccuracy); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupStandardUserSystemClockCore */ Result SetupStandardUserSystemClock(bool enableAutomaticCorrection, const SteadyClockTimePoint &automaticCorrectionUpdateTime); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupTimeZoneServiceCore */ Result SetupTimeZoneManager(std::string_view locationName, const SteadyClockTimePoint &updateTime, int locationCount, std::array binaryVersion, span binary); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetupEphemeralNetworkSystemClockCore */ Result SetupEphemeralSystemClock(); std::shared_ptr GetStandardUserSystemClockAutomaticCorrectionEvent(); /** * @url https://switchbrew.org/w/index.php?title=PSC_services#SetStandardSteadyClockBaseTime */ Result SetStandardSteadyClockRtcOffset(TimeSpanType rtcOffset); }; }