diff options
| author | 2023-06-28 00:20:38 -0600 | |
|---|---|---|
| committer | 2023-06-28 09:49:47 -0600 | |
| commit | df9685a21c105962e90dbd95133c5a1bcef7886f (patch) | |
| tree | acfd98ca20286dca669077b165943f6c4af711a6 /src/input_common/helpers/joycon_protocol/nfc.h | |
| parent | Merge pull request #10933 from merryhime/dunno (diff) | |
| download | yuzu-df9685a21c105962e90dbd95133c5a1bcef7886f.tar.gz yuzu-df9685a21c105962e90dbd95133c5a1bcef7886f.tar.xz yuzu-df9685a21c105962e90dbd95133c5a1bcef7886f.zip | |
input_common: Remove duplicated DriverResult enum
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/nfc.h')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/nfc.h | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/src/input_common/helpers/joycon_protocol/nfc.h b/src/input_common/helpers/joycon_protocol/nfc.h index 0be95e40e..22db95170 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.h +++ b/src/input_common/helpers/joycon_protocol/nfc.h | |||
| @@ -13,30 +13,34 @@ | |||
| 13 | #include "input_common/helpers/joycon_protocol/common_protocol.h" | 13 | #include "input_common/helpers/joycon_protocol/common_protocol.h" |
| 14 | #include "input_common/helpers/joycon_protocol/joycon_types.h" | 14 | #include "input_common/helpers/joycon_protocol/joycon_types.h" |
| 15 | 15 | ||
| 16 | namespace Common::Input { | ||
| 17 | enum class DriverResult; | ||
| 18 | } | ||
| 19 | |||
| 16 | namespace InputCommon::Joycon { | 20 | namespace InputCommon::Joycon { |
| 17 | 21 | ||
| 18 | class NfcProtocol final : private JoyconCommonProtocol { | 22 | class NfcProtocol final : private JoyconCommonProtocol { |
| 19 | public: | 23 | public: |
| 20 | explicit NfcProtocol(std::shared_ptr<JoyconHandle> handle); | 24 | explicit NfcProtocol(std::shared_ptr<JoyconHandle> handle); |
| 21 | 25 | ||
| 22 | DriverResult EnableNfc(); | 26 | Common::Input::DriverResult EnableNfc(); |
| 23 | 27 | ||
| 24 | DriverResult DisableNfc(); | 28 | Common::Input::DriverResult DisableNfc(); |
| 25 | 29 | ||
| 26 | DriverResult StartNFCPollingMode(); | 30 | Common::Input::DriverResult StartNFCPollingMode(); |
| 27 | 31 | ||
| 28 | DriverResult StopNFCPollingMode(); | 32 | Common::Input::DriverResult StopNFCPollingMode(); |
| 29 | 33 | ||
| 30 | DriverResult GetTagInfo(Joycon::TagInfo& tag_info); | 34 | Common::Input::DriverResult GetTagInfo(Joycon::TagInfo& tag_info); |
| 31 | 35 | ||
| 32 | DriverResult ReadAmiibo(std::vector<u8>& data); | 36 | Common::Input::DriverResult ReadAmiibo(std::vector<u8>& data); |
| 33 | 37 | ||
| 34 | DriverResult WriteAmiibo(std::span<const u8> data); | 38 | Common::Input::DriverResult WriteAmiibo(std::span<const u8> data); |
| 35 | 39 | ||
| 36 | DriverResult ReadMifare(std::span<const MifareReadChunk> read_request, | 40 | Common::Input::DriverResult ReadMifare(std::span<const MifareReadChunk> read_request, |
| 37 | std::span<MifareReadData> out_data); | 41 | std::span<MifareReadData> out_data); |
| 38 | 42 | ||
| 39 | DriverResult WriteMifare(std::span<const MifareWriteChunk> write_request); | 43 | Common::Input::DriverResult WriteMifare(std::span<const MifareWriteChunk> write_request); |
| 40 | 44 | ||
| 41 | bool HasAmiibo(); | 45 | bool HasAmiibo(); |
| 42 | 46 | ||
| @@ -54,37 +58,41 @@ private: | |||
| 54 | TagUUID uuid; | 58 | TagUUID uuid; |
| 55 | }; | 59 | }; |
| 56 | 60 | ||
| 57 | DriverResult WaitUntilNfcIs(NFCStatus status); | 61 | Common::Input::DriverResult WaitUntilNfcIs(NFCStatus status); |
| 58 | 62 | ||
| 59 | DriverResult IsTagInRange(TagFoundData& data, std::size_t timeout_limit = 1); | 63 | Common::Input::DriverResult IsTagInRange(TagFoundData& data, std::size_t timeout_limit = 1); |
| 60 | 64 | ||
| 61 | DriverResult GetAmiiboData(std::vector<u8>& data); | 65 | Common::Input::DriverResult GetAmiiboData(std::vector<u8>& data); |
| 62 | 66 | ||
| 63 | DriverResult WriteAmiiboData(const TagUUID& tag_uuid, std::span<const u8> data); | 67 | Common::Input::DriverResult WriteAmiiboData(const TagUUID& tag_uuid, std::span<const u8> data); |
| 64 | 68 | ||
| 65 | DriverResult GetMifareData(const MifareUUID& tag_uuid, | 69 | Common::Input::DriverResult GetMifareData(const MifareUUID& tag_uuid, |
| 66 | std::span<const MifareReadChunk> read_request, | 70 | std::span<const MifareReadChunk> read_request, |
| 67 | std::span<MifareReadData> out_data); | 71 | std::span<MifareReadData> out_data); |
| 68 | 72 | ||
| 69 | DriverResult WriteMifareData(const MifareUUID& tag_uuid, | 73 | Common::Input::DriverResult WriteMifareData(const MifareUUID& tag_uuid, |
| 70 | std::span<const MifareWriteChunk> write_request); | 74 | std::span<const MifareWriteChunk> write_request); |
| 71 | 75 | ||
| 72 | DriverResult SendStartPollingRequest(MCUCommandResponse& output, | 76 | Common::Input::DriverResult SendStartPollingRequest(MCUCommandResponse& output, |
| 73 | bool is_second_attempt = false); | 77 | bool is_second_attempt = false); |
| 74 | 78 | ||
| 75 | DriverResult SendStopPollingRequest(MCUCommandResponse& output); | 79 | Common::Input::DriverResult SendStopPollingRequest(MCUCommandResponse& output); |
| 76 | 80 | ||
| 77 | DriverResult SendNextPackageRequest(MCUCommandResponse& output, u8 packet_id); | 81 | Common::Input::DriverResult SendNextPackageRequest(MCUCommandResponse& output, u8 packet_id); |
| 78 | 82 | ||
| 79 | DriverResult SendReadAmiiboRequest(MCUCommandResponse& output, NFCPages ntag_pages); | 83 | Common::Input::DriverResult SendReadAmiiboRequest(MCUCommandResponse& output, |
| 84 | NFCPages ntag_pages); | ||
| 80 | 85 | ||
| 81 | DriverResult SendWriteAmiiboRequest(MCUCommandResponse& output, const TagUUID& tag_uuid); | 86 | Common::Input::DriverResult SendWriteAmiiboRequest(MCUCommandResponse& output, |
| 87 | const TagUUID& tag_uuid); | ||
| 82 | 88 | ||
| 83 | DriverResult SendWriteDataAmiiboRequest(MCUCommandResponse& output, u8 block_id, | 89 | Common::Input::DriverResult SendWriteDataAmiiboRequest(MCUCommandResponse& output, u8 block_id, |
| 84 | bool is_last_packet, std::span<const u8> data); | 90 | bool is_last_packet, |
| 91 | std::span<const u8> data); | ||
| 85 | 92 | ||
| 86 | DriverResult SendReadDataMifareRequest(MCUCommandResponse& output, u8 block_id, | 93 | Common::Input::DriverResult SendReadDataMifareRequest(MCUCommandResponse& output, u8 block_id, |
| 87 | bool is_last_packet, std::span<const u8> data); | 94 | bool is_last_packet, |
| 95 | std::span<const u8> data); | ||
| 88 | 96 | ||
| 89 | std::vector<u8> SerializeWritePackage(const NFCWritePackage& package) const; | 97 | std::vector<u8> SerializeWritePackage(const NFCWritePackage& package) const; |
| 90 | 98 | ||