简体   繁体   中英

Samsung device nfc mode and host card emulation

Thanks for reading this question. I wish you have a good day.

I'm currently developing a NFC host app that generate a NFC with data I want to transfer. But I'm stuck with details about NFC modes in Samsung devices.

As you know, Samsung devices have two modes in NFC, standard mode and card mode. I thought that standard mode provides basic NFC functionalities such as generating NFC and reading NFC, and card mode is used for Samsung pay. But Some posts says that card mode is actually card emulating mode. I wonder if this "card" emulating mode has anything to do with host "card" emulation or it's just Samsung pay "card".

Long story shorts,

  1. Which NFC mode do I have to use for HCE in Samsung device?
  2. If I have to use card mode for HCE, can I check if NFC card mode is on?

(NfcAdapter.isEnabled() checks if the standard mode NFC is on and card mode is considered NFC off with this method)

My Samsung Device does not have 2 separate NFC modes but does have 2 different NFC capabilities - Emulation a Card or Reading/Writing to a Card. But these capabilities are not mutually exclusive they are enabled together.

It does have 2 locations where Card Emulation can happen, the first being in the NFC's Chip Secure Element (an independent CPU) or on the Host CPU (Hence the term Host Card Emulation).

All card emulation is about emulation of Type 4 NFC vards (Credit cards and similar cards)

Type 4 Nfc cards have an "Application Identifier" number or AID that identifies the format to the card.

Normally the Secure Element handles the AID's first that it has been configure to process before passing them on to the Host CPU. Normally the order of routing of AID's is seamless with Secure Element first, then Host CPU but Samsung does offer settings to change this order.

But

NfcAdapter.isEnabled() says

If this method returns false, the NFC hardware is guaranteed not to generate or respond to any NFC communication over its NFC radio.

My understanding is the UI setting that influences this status is basically a hardware power switch for the NFC chip, if this returns false the chip is turned off and won't do any NFC (Secure Emulation, Host Emulation or reading/writing)

So I would check NfcAdapter.isEnabled() before starting your HCE service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM