summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/nfc_interface.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-06-17 00:18:24 +0200
committerGitHub <noreply@github.com>2023-06-17 00:18:24 +0200
commita1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16 (patch)
treea7ae4ec330fb52cbda07b929cf920d40eca48775 /src/core/hle/service/nfc/nfc_interface.cpp
parentMerge pull request #10801 from 8bitDream/fix_aspect (diff)
parentservice: nfc: Read tag protocol only for nfc backend (diff)
downloadyuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar.gz
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar.bz2
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar.lz
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar.xz
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.tar.zst
yuzu-a1adcc31d386a19db5cc5d0bf7536b5cc0e7ec16.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nfc/nfc_interface.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp
index 198d0f2b9..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) {
void NfcInterface::StartDetection(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto device_handle{rp.Pop<u64>()};
- const auto tag_protocol{rp.PopEnum<NfcProtocol>()};
- LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol);
+ auto tag_protocol{NfcProtocol::All};
+
+ if (backend_type == BackendType::Nfc) {
+ tag_protocol = rp.PopEnum<NfcProtocol>();
+ }
+ LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol);
auto result = GetManager()->StartDetection(device_handle, tag_protocol);
result = TranslateResultToServiceError(result);
@@ -355,7 +359,7 @@ Result NfcInterface::TranslateResultToNfp(Result result) const {
if (result == ResultApplicationAreaExist) {
return NFP::ResultApplicationAreaExist;
}
- if (result == ResultNotAnAmiibo) {
+ if (result == ResultInvalidTagType) {
return NFP::ResultNotAnAmiibo;
}
if (result == ResultUnableToAccessBackupFile) {
@@ -381,6 +385,9 @@ Result NfcInterface::TranslateResultToMifare(Result result) const {
if (result == ResultTagRemoved) {
return Mifare::ResultTagRemoved;
}
+ if (result == ResultInvalidTagType) {
+ return Mifare::ResultNotAMifare;
+ }
LOG_WARNING(Service_NFC, "Result conversion not handled");
return result;
}