mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-24 07:31:11 +01:00
Stub ntc
This commit is contained in:
parent
79683f7beb
commit
99f400a8bf
@ -0,0 +1,17 @@
|
|||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
// Copyright © 2023 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include "IEnsureNetworkClockAvailabilityService.h"
|
||||||
|
#include <common/settings.h>
|
||||||
|
|
||||||
|
namespace skyline::service::ntc {
|
||||||
|
IEnsureNetworkClockAvailabilityService::IEnsureNetworkClockAvailabilityService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager),
|
||||||
|
finishNotificationEvent(std::make_shared<kernel::type::KEvent>(state, false)) {}
|
||||||
|
|
||||||
|
Result IEnsureNetworkClockAvailabilityService::StartTask(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
|
if (!(*state.settings->isInternetEnabled))
|
||||||
|
return result::NetworkTimeNotAvailable;
|
||||||
|
finishNotificationEvent->Signal();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
// Copyright © 2023 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
|
namespace skyline::service::ntc {
|
||||||
|
namespace result {
|
||||||
|
constexpr Result NetworkTimeNotAvailable{116, 1000};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @url https://switchbrew.org/wiki/NIM_services#IEnsureNetworkClockAvailabilityService
|
||||||
|
*/
|
||||||
|
class IEnsureNetworkClockAvailabilityService : public BaseService {
|
||||||
|
private:
|
||||||
|
std::shared_ptr<kernel::type::KEvent> finishNotificationEvent;
|
||||||
|
|
||||||
|
public:
|
||||||
|
IEnsureNetworkClockAvailabilityService(const DeviceState &state, ServiceManager &manager);
|
||||||
|
|
||||||
|
Result StartTask(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||||
|
|
||||||
|
SERVICE_DECL(
|
||||||
|
SFUNC(0x0, IEnsureNetworkClockAvailabilityService, StartTask)
|
||||||
|
)
|
||||||
|
};
|
||||||
|
}
|
@ -57,6 +57,7 @@
|
|||||||
#include "ro/IRoInterface.h"
|
#include "ro/IRoInterface.h"
|
||||||
#include "mii/IStaticService.h"
|
#include "mii/IStaticService.h"
|
||||||
#include "olsc/IOlscServiceForApplication.h"
|
#include "olsc/IOlscServiceForApplication.h"
|
||||||
|
#include "ntc/IEnsureNetworkClockAvailabilityService.h"
|
||||||
#include "serviceman.h"
|
#include "serviceman.h"
|
||||||
|
|
||||||
#define SERVICE_CASE(class, name, ...) \
|
#define SERVICE_CASE(class, name, ...) \
|
||||||
@ -124,6 +125,7 @@ namespace skyline::service {
|
|||||||
SERVICE_CASE(nfp::IUserManager, "nfp:user")
|
SERVICE_CASE(nfp::IUserManager, "nfp:user")
|
||||||
SERVICE_CASE(nifm::IStaticService, "nifm:u")
|
SERVICE_CASE(nifm::IStaticService, "nifm:u")
|
||||||
SERVICE_CASE(socket::IClient, "bsd:u")
|
SERVICE_CASE(socket::IClient, "bsd:u")
|
||||||
|
SERVICE_CASE(socket::IClient, "bsd:s")
|
||||||
SERVICE_CASE(socket::IManager, "nsd:u")
|
SERVICE_CASE(socket::IManager, "nsd:u")
|
||||||
SERVICE_CASE(socket::IManager, "nsd:a")
|
SERVICE_CASE(socket::IManager, "nsd:a")
|
||||||
SERVICE_CASE(socket::IResolver, "sfdnsres")
|
SERVICE_CASE(socket::IResolver, "sfdnsres")
|
||||||
@ -144,6 +146,7 @@ namespace skyline::service {
|
|||||||
SERVICE_CASE(mii::IStaticService, "mii:e")
|
SERVICE_CASE(mii::IStaticService, "mii:e")
|
||||||
SERVICE_CASE(mii::IStaticService, "mii:u")
|
SERVICE_CASE(mii::IStaticService, "mii:u")
|
||||||
SERVICE_CASE(olsc::IOlscServiceForApplication, "olsc:u")
|
SERVICE_CASE(olsc::IOlscServiceForApplication, "olsc:u")
|
||||||
|
SERVICE_CASE(ntc::IEnsureNetworkClockAvailabilityService, "ntc")
|
||||||
default:
|
default:
|
||||||
std::string_view nameString(span(reinterpret_cast<char *>(&name), sizeof(name)).as_string(true));
|
std::string_view nameString(span(reinterpret_cast<char *>(&name), sizeof(name)).as_string(true));
|
||||||
throw std::out_of_range(fmt::format("CreateService called with an unknown service name: {}", nameString));
|
throw std::out_of_range(fmt::format("CreateService called with an unknown service name: {}", nameString));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user