mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 06:44:19 +01:00
Fixup NFP service stub state handling
Previously a broken state value was returned from GetState that caused crashes in games using newer SDKs and NFP, correctly handle state now by updating it after initialisation.
This commit is contained in:
parent
c745e0e02b
commit
c639fdcf06
@ -8,6 +8,7 @@ namespace skyline::service::nfp {
|
||||
IUser::IUser(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
|
||||
|
||||
Result IUser::Initialize(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
state = State::Initialized;
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -17,7 +18,7 @@ namespace skyline::service::nfp {
|
||||
}
|
||||
|
||||
Result IUser::GetState(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
response.Push<u32>(0);
|
||||
response.Push(state);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
@ -7,26 +7,27 @@
|
||||
|
||||
namespace skyline::service::nfp {
|
||||
/**
|
||||
* @brief IUser is used by applications to access NFP (Near Field Proximity) devices
|
||||
* @brief IUser is used by applications to access NFP (Nintendo Figurine Protocol) devices
|
||||
* @url https://switchbrew.org/wiki/NFC_services#IUser_3
|
||||
*/
|
||||
class IUser : public BaseService {
|
||||
private:
|
||||
enum class State : u32 {
|
||||
NotInitialized = 0,
|
||||
Initialized = 1
|
||||
} state{State::NotInitialized};
|
||||
|
||||
public:
|
||||
IUser(const DeviceState &state, ServiceManager &manager);
|
||||
|
||||
/**
|
||||
* @brief Initializes an NFP session
|
||||
*/
|
||||
Result Initialize(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/*
|
||||
* @brief Lists available NFP devices
|
||||
* @url https://switchbrew.org/wiki/NFC_services#ListDevices
|
||||
*/
|
||||
Result ListDevices(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/*
|
||||
* @brief Return the state of the NFP service
|
||||
* @url https://switchbrew.org/wiki/NFC_services#GetState_2
|
||||
*/
|
||||
Result GetState(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
Loading…
Reference in New Issue
Block a user