diff options
| author | 2023-06-14 18:16:23 -0600 | |
|---|---|---|
| committer | 2023-06-14 18:16:23 -0600 | |
| commit | 61b45885176e8045f8df19085e1588c8f0da60b0 (patch) | |
| tree | 2848fef0cb6569d93d491cfc403b3c2c487636d1 /src/core/hle/service/nfc | |
| parent | service: nfc: Accuracy fixes (diff) | |
| download | yuzu-61b45885176e8045f8df19085e1588c8f0da60b0.tar.gz yuzu-61b45885176e8045f8df19085e1588c8f0da60b0.tar.xz yuzu-61b45885176e8045f8df19085e1588c8f0da60b0.zip | |
service: nfc: Read tag protocol only for nfc backend
Diffstat (limited to 'src/core/hle/service/nfc')
| -rw-r--r-- | src/core/hle/service/nfc/nfc_interface.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/nfc/nfc_types.h | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp index 48405f6f2..130fb7f78 100644 --- a/src/core/hle/service/nfc/nfc_interface.cpp +++ b/src/core/hle/service/nfc/nfc_interface.cpp | |||
| @@ -142,9 +142,13 @@ void NfcInterface::AttachAvailabilityChangeEvent(HLERequestContext& ctx) { | |||
| 142 | void NfcInterface::StartDetection(HLERequestContext& ctx) { | 142 | void NfcInterface::StartDetection(HLERequestContext& ctx) { |
| 143 | IPC::RequestParser rp{ctx}; | 143 | IPC::RequestParser rp{ctx}; |
| 144 | const auto device_handle{rp.Pop<u64>()}; | 144 | const auto device_handle{rp.Pop<u64>()}; |
| 145 | const auto tag_protocol{rp.PopEnum<NfcProtocol>()}; | 145 | auto tag_protocol{NfcProtocol::All}; |
| 146 | LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol); | 146 | |
| 147 | if (backend_type == BackendType::Nfc) { | ||
| 148 | tag_protocol = rp.PopEnum<NfcProtocol>(); | ||
| 149 | } | ||
| 147 | 150 | ||
| 151 | LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol); | ||
| 148 | auto result = GetManager()->StartDetection(device_handle, tag_protocol); | 152 | auto result = GetManager()->StartDetection(device_handle, tag_protocol); |
| 149 | result = TranslateResultToServiceError(result); | 153 | result = TranslateResultToServiceError(result); |
| 150 | 154 | ||
diff --git a/src/core/hle/service/nfc/nfc_types.h b/src/core/hle/service/nfc/nfc_types.h index 1a0866e78..68e724442 100644 --- a/src/core/hle/service/nfc/nfc_types.h +++ b/src/core/hle/service/nfc/nfc_types.h | |||
| @@ -59,14 +59,11 @@ enum class PackedTagType : u8 { | |||
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | // This is nn::nfc::NfcProtocol | 61 | // This is nn::nfc::NfcProtocol |
| 62 | // Verify this enum. It might be completely wrong default protocol is 0x48 | ||
| 63 | enum class NfcProtocol : u32 { | 62 | enum class NfcProtocol : u32 { |
| 64 | None, | 63 | None, |
| 65 | TypeA = 1U << 0, // ISO14443A | 64 | TypeA = 1U << 0, // ISO14443A |
| 66 | TypeB = 1U << 1, // ISO14443B | 65 | TypeB = 1U << 1, // ISO14443B |
| 67 | TypeF = 1U << 2, // Sony FeliCa | 66 | TypeF = 1U << 2, // Sony FeliCa |
| 68 | Unknown1 = 1U << 3, | ||
| 69 | Unknown2 = 1U << 5, | ||
| 70 | All = 0xFFFFFFFFU, | 67 | All = 0xFFFFFFFFU, |
| 71 | }; | 68 | }; |
| 72 | 69 | ||