service: nfc: Read tag protocol only for nfc backend

This commit is contained in:
Narr the Reg 2023-06-14 18:16:23 -06:00
parent b1b13ddc6b
commit 61b4588517
2 changed files with 6 additions and 5 deletions

View File

@ -142,9 +142,13 @@ void NfcInterface::AttachAvailabilityChangeEvent(HLERequestContext& ctx) {
void NfcInterface::StartDetection(HLERequestContext& ctx) { void NfcInterface::StartDetection(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto device_handle{rp.Pop<u64>()}; const auto device_handle{rp.Pop<u64>()};
const auto tag_protocol{rp.PopEnum<NfcProtocol>()}; auto tag_protocol{NfcProtocol::All};
LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol);
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); auto result = GetManager()->StartDetection(device_handle, tag_protocol);
result = TranslateResultToServiceError(result); result = TranslateResultToServiceError(result);

View File

@ -59,14 +59,11 @@ enum class PackedTagType : u8 {
}; };
// This is nn::nfc::NfcProtocol // This is nn::nfc::NfcProtocol
// Verify this enum. It might be completely wrong default protocol is 0x48
enum class NfcProtocol : u32 { enum class NfcProtocol : u32 {
None, None,
TypeA = 1U << 0, // ISO14443A TypeA = 1U << 0, // ISO14443A
TypeB = 1U << 1, // ISO14443B TypeB = 1U << 1, // ISO14443B
TypeF = 1U << 2, // Sony FeliCa TypeF = 1U << 2, // Sony FeliCa
Unknown1 = 1U << 3,
Unknown2 = 1U << 5,
All = 0xFFFFFFFFU, All = 0xFFFFFFFFU,
}; };