Add additional nifm stubs

This commit is contained in:
Billy Laws 2022-05-11 23:15:56 +01:00
parent a164635f32
commit 7d30ac0cd8
5 changed files with 51 additions and 2 deletions

View File

@ -317,6 +317,7 @@ add_library(skyline SHARED
${source_DIR}/skyline/services/nfp/IUser.cpp ${source_DIR}/skyline/services/nfp/IUser.cpp
${source_DIR}/skyline/services/nifm/IStaticService.cpp ${source_DIR}/skyline/services/nifm/IStaticService.cpp
${source_DIR}/skyline/services/nifm/IGeneralService.cpp ${source_DIR}/skyline/services/nifm/IGeneralService.cpp
${source_DIR}/skyline/services/nifm/IScanRequest.cpp
${source_DIR}/skyline/services/nifm/IRequest.cpp ${source_DIR}/skyline/services/nifm/IRequest.cpp
${source_DIR}/skyline/services/socket/bsd/IClient.cpp ${source_DIR}/skyline/services/socket/bsd/IClient.cpp
${source_DIR}/skyline/services/spl/IRandomInterface.cpp ${source_DIR}/skyline/services/spl/IRandomInterface.cpp

View File

@ -1,14 +1,26 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) // Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include "IScanRequest.h"
#include "IRequest.h" #include "IRequest.h"
#include "IGeneralService.h" #include "IGeneralService.h"
namespace skyline::service::nifm { namespace skyline::service::nifm {
IGeneralService::IGeneralService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} IGeneralService::IGeneralService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
Result IGeneralService::CreateScanRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
manager.RegisterService(SRVREG(IScanRequest), session, response);
return {};
}
Result IGeneralService::CreateRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { Result IGeneralService::CreateRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
manager.RegisterService(SRVREG(IRequest), session, response); manager.RegisterService(SRVREG(IRequest), session, response);
return {}; return {};
} }
Result IGeneralService::IsAnyInternetRequestAccepted(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
// We don't emulate networking so always return false
response.Push(false);
return {};
}
} }

View File

@ -15,13 +15,24 @@ namespace skyline::service::nifm {
IGeneralService(const DeviceState &state, ServiceManager &manager); IGeneralService(const DeviceState &state, ServiceManager &manager);
/** /**
* @brief Creates an IRequest instance that can be used to bring up the network * @url https://switchbrew.org/wiki/Network_Interface_services#CreateScanRequest
*/
Result CreateScanRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/**
* @url https://switchbrew.org/wiki/Network_Interface_services#CreateRequest * @url https://switchbrew.org/wiki/Network_Interface_services#CreateRequest
*/ */
Result CreateRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); Result CreateRequest(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/**
* @url https://switchbrew.org/wiki/Network_Interface_services#IsAnyInternetRequestAccepted
*/
Result IsAnyInternetRequestAccepted(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
SERVICE_DECL( SERVICE_DECL(
SFUNC(0x4, IGeneralService, CreateRequest) SFUNC(0x1, IGeneralService, CreateScanRequest),
SFUNC(0x4, IGeneralService, CreateRequest),
SFUNC(0x15, IGeneralService, IsAnyInternetRequestAccepted)
) )
}; };
} }

View File

@ -0,0 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include "IScanRequest.h"
namespace skyline::service::nifm {
IScanRequest::IScanRequest(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
}

View File

@ -0,0 +1,17 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
#pragma once
#include <services/serviceman.h>
namespace skyline::service::nifm {
/**
* @brief IScanRequest is used by applications to scan for networks
* @url https://switchbrew.org/wiki/Network_Interface_services#IScanRequest
*/
class IScanRequest : public BaseService {
public:
IScanRequest(const DeviceState &state, ServiceManager &manager);
};
}