diff options
author | bunnei <bunneidev@gmail.com> | 2023-05-07 21:18:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-07 21:18:09 +0200 |
commit | e58090c9c731701662d0824c2fd081467f21f5c3 (patch) | |
tree | f35c9a080f3b5a9067381b615eca928e8825ee20 /src/core/hle/service/nfc/nfc_device.h | |
parent | Merge pull request #10192 from bunnei/update-dynarmic-2 (diff) | |
parent | service: nfc: Merge device interfaces and create the device manager (diff) | |
download | yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar.gz yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar.bz2 yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar.lz yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar.xz yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.tar.zst yuzu-e58090c9c731701662d0824c2fd081467f21f5c3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/nfc/nfc_device.h | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/src/core/hle/service/nfc/nfc_device.h b/src/core/hle/service/nfc/nfc_device.h deleted file mode 100644 index ea63f0537..000000000 --- a/src/core/hle/service/nfc/nfc_device.h +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/common_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/nfp/nfp_types.h" -#include "core/hle/service/service.h" - -namespace Kernel { -class KEvent; -class KReadableEvent; -} // namespace Kernel - -namespace Core { -class System; -} // namespace Core - -namespace Core::HID { -class EmulatedController; -enum class ControllerTriggerType; -enum class NpadIdType : u32; -} // namespace Core::HID - -namespace Service::NFC { -class NfcDevice { -public: - NfcDevice(Core::HID::NpadIdType npad_id_, Core::System& system_, - KernelHelpers::ServiceContext& service_context_, - Kernel::KEvent* availability_change_event_); - ~NfcDevice(); - - void Initialize(); - void Finalize(); - - Result StartDetection(NFP::TagProtocol allowed_protocol); - Result StopDetection(); - Result Flush(); - - Result GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const; - - Result MifareRead(const NFP::MifareReadBlockParameter& parameter, - NFP::MifareReadBlockData& read_block_data); - - Result MifareWrite(const NFP::MifareWriteBlockParameter& parameter); - - u64 GetHandle() const; - NFP::DeviceState GetCurrentState() const; - Core::HID::NpadIdType GetNpadId() const; - - Kernel::KReadableEvent& GetActivateEvent() const; - Kernel::KReadableEvent& GetDeactivateEvent() const; - -private: - void NpadUpdate(Core::HID::ControllerTriggerType type); - bool LoadNfcTag(std::span<const u8> data); - void CloseNfcTag(); - - bool is_controller_set{}; - int callback_key; - const Core::HID::NpadIdType npad_id; - Core::System& system; - Core::HID::EmulatedController* npad_device = nullptr; - KernelHelpers::ServiceContext& service_context; - Kernel::KEvent* activate_event = nullptr; - Kernel::KEvent* deactivate_event = nullptr; - Kernel::KEvent* availability_change_event = nullptr; - - bool is_initalized{}; - NFP::TagProtocol allowed_protocols{}; - NFP::DeviceState device_state{NFP::DeviceState::Unavailable}; - - NFP::EncryptedNTAG215File encrypted_tag_data{}; - std::vector<u8> tag_data{}; -}; - -} // namespace Service::NFC |