diff --git a/app/src/main/cpp/skyline/services/nfp/IUser.cpp b/app/src/main/cpp/skyline/services/nfp/IUser.cpp index 2e7435d9..d33d435b 100644 --- a/app/src/main/cpp/skyline/services/nfp/IUser.cpp +++ b/app/src/main/cpp/skyline/services/nfp/IUser.cpp @@ -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(0); + response.Push(state); return {}; } } diff --git a/app/src/main/cpp/skyline/services/nfp/IUser.h b/app/src/main/cpp/skyline/services/nfp/IUser.h index 2aa63bd9..d67a277c 100644 --- a/app/src/main/cpp/skyline/services/nfp/IUser.h +++ b/app/src/main/cpp/skyline/services/nfp/IUser.h @@ -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);