diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-04-15 01:46:20 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-04-24 07:28:09 +0200 |
commit | a3fa64fcc489d2cc1776807a37db3464dcc32686 (patch) | |
tree | 2ec9e6abd4b588f6584ec41ea6edf816ad25c98c /src/core/hle/service/nfc/nfc.cpp | |
parent | Merge pull request #10074 from Kelebek1/fermi_blit (diff) | |
download | yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.gz yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.bz2 yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.lz yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.xz yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.zst yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.zip |
Diffstat (limited to 'src/core/hle/service/nfc/nfc.cpp')
-rw-r--r-- | src/core/hle/service/nfc/nfc.cpp | 110 |
1 files changed, 72 insertions, 38 deletions
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index 6595e34ed..7a8f59725 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -8,12 +8,83 @@ #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/nfc/mifare_user.h" #include "core/hle/service/nfc/nfc.h" -#include "core/hle/service/nfc/nfc_user.h" +#include "core/hle/service/nfc/nfc_interface.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" namespace Service::NFC { +class IUser final : public Interface { +public: + explicit IUser(Core::System& system_) : Interface(system_, "IUser") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &Interface::Initialize, "InitializeOld"}, + {1, &Interface::Finalize, "FinalizeOld"}, + {2, &Interface::GetState, "GetStateOld"}, + {3, &Interface::IsNfcEnabled, "IsNfcEnabledOld"}, + {400, &Interface::Initialize, "Initialize"}, + {401, &Interface::Finalize, "Finalize"}, + {402, &Interface::GetState, "GetState"}, + {403, &Interface::IsNfcEnabled, "IsNfcEnabled"}, + {404, &Interface::ListDevices, "ListDevices"}, + {405, &Interface::GetDeviceState, "GetDeviceState"}, + {406, &Interface::GetNpadId, "GetNpadId"}, + {407, &Interface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {408, &Interface::StartDetection, "StartDetection"}, + {409, &Interface::StopDetection, "StopDetection"}, + {410, &Interface::GetTagInfo, "GetTagInfo"}, + {411, &Interface::AttachActivateEvent, "AttachActivateEvent"}, + {412, &Interface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {1000, nullptr, "ReadMifare"}, + {1001, nullptr, "WriteMifare"}, + {1300, &Interface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + {1301, nullptr, "KeepPassThroughSession"}, + {1302, nullptr, "ReleasePassThroughSession"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class ISystem final : public Interface { +public: + explicit ISystem(Core::System& system_) : Interface{system_, "ISystem"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &Interface::Initialize, "InitializeOld"}, + {1, &Interface::Finalize, "FinalizeOld"}, + {2, &Interface::GetState, "GetStateOld"}, + {3, &Interface::IsNfcEnabled, "IsNfcEnabledOld"}, + {100, nullptr, "SetNfcEnabledOld"}, + {400, &Interface::Initialize, "Initialize"}, + {401, &Interface::Finalize, "Finalize"}, + {402, &Interface::GetState, "GetState"}, + {403, &Interface::IsNfcEnabled, "IsNfcEnabled"}, + {404, &Interface::ListDevices, "ListDevices"}, + {405, &Interface::GetDeviceState, "GetDeviceState"}, + {406, &Interface::GetNpadId, "GetNpadId"}, + {407, &Interface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {408, &Interface::StartDetection, "StartDetection"}, + {409, &Interface::StopDetection, "StopDetection"}, + {410, &Interface::GetTagInfo, "GetTagInfo"}, + {411, &Interface::AttachActivateEvent, "AttachActivateEvent"}, + {412, &Interface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {500, nullptr, "SetNfcEnabled"}, + {510, nullptr, "OutputTestWave"}, + {1000, nullptr, "ReadMifare"}, + {1001, nullptr, "WriteMifare"}, + {1300, &Interface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + {1301, nullptr, "KeepPassThroughSession"}, + {1302, nullptr, "ReleasePassThroughSession"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + class IAm final : public ServiceFramework<IAm> { public: explicit IAm(Core::System& system_) : ServiceFramework{system_, "NFC::IAm"} { @@ -95,43 +166,6 @@ private: } }; -class ISystem final : public ServiceFramework<ISystem> { -public: - explicit ISystem(Core::System& system_) : ServiceFramework{system_, "ISystem"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "Finalize"}, - {2, nullptr, "GetStateOld"}, - {3, nullptr, "IsNfcEnabledOld"}, - {100, nullptr, "SetNfcEnabledOld"}, - {400, nullptr, "InitializeSystem"}, - {401, nullptr, "FinalizeSystem"}, - {402, nullptr, "GetState"}, - {403, nullptr, "IsNfcEnabled"}, - {404, nullptr, "ListDevices"}, - {405, nullptr, "GetDeviceState"}, - {406, nullptr, "GetNpadId"}, - {407, nullptr, "AttachAvailabilityChangeEvent"}, - {408, nullptr, "StartDetection"}, - {409, nullptr, "StopDetection"}, - {410, nullptr, "GetTagInfo"}, - {411, nullptr, "AttachActivateEvent"}, - {412, nullptr, "AttachDeactivateEvent"}, - {500, nullptr, "SetNfcEnabled"}, - {510, nullptr, "OutputTestWave"}, - {1000, nullptr, "ReadMifare"}, - {1001, nullptr, "WriteMifare"}, - {1300, nullptr, "SendCommandByPassThrough"}, - {1301, nullptr, "KeepPassThroughSession"}, - {1302, nullptr, "ReleasePassThroughSession"}, - }; - // clang-format on - - RegisterHandlers(functions); - } -}; - class NFC_SYS final : public ServiceFramework<NFC_SYS> { public: explicit NFC_SYS(Core::System& system_) : ServiceFramework{system_, "nfc:sys"} { |