Choose card emulation mode on the VTAP
The card emulation mode is set either by the setting CardEmulationMode in config.txt, or by the dynamic command ?cardmode sent over any serial interface you have enabled.
There are three possible values to describe the card emulation mode:
-
0 - Card emulation mode disabled, VTAP operates only as an NFC reader
(this is the default behaviour if CardEmulationMode is not set); -
1 - VTAP operates only as an NFC card emulation;
-
2 - Mixed mode, where the VTAP is able to read tags and wallet passes but will also emulate a card that may be read by another device.
Note: The behaviour of a phone presented to a VTAP in mixed mode can be unpredictable, if the phone itself is also enabled as both reader and card emulation. Unless the wallet app is disabled, current Apple and Android phones often automatically launch their wallet app when brought into the field of any NFC reader, to present the default payment card. This happens even when the reader is not requesting a pass or selecting a payment application.
Card emulation mode on start up
Setting CardEmulationMode in config.txt to one of these values 0, 1 or 2, determines the card emulation mode that will occur at start up, whenever the VTAP reader is power cycled or rebooted. By default, card emulation is disabled on start up, because the CardEmulationMode setting omitted from config.txt.
Dynamic change to card emulation mode
Any ?cardmode command sent over a serial interface will override the initial CardEmulationMode setting in config.txt. Saving a change to config.txt will also change the current card emulation mode with immediate effect.
CAUTION:If your application requires frequent switching of card emulation mode, we recommend that you always implement this using dynamic commands sent over a serial interface. Although the mode could be regularly changed by an update to config.txt file, doing so is likely to cause excessive memory wear, reducing the life of your VTAP reader.
Send the ?cardmode 1 command over any serial interface to change to enable card emulation mode. The VTAP will continue to perform card emulation until you send the command ?cardmode 0 to stop.
Although it is not recommended, you can send the ?cardmode 2 command over any serial interface you have enabled. This will make the VTAP perform card emulation but continue to behave as a reader, which is called 'mixed mode', until you send the command ?cardmode 0 to stop.
The VTAP will respond to every ?cardmode command by returning the number of its current card emulation mode over the serial interface used. If you send the command ?cardmode without specifying a new mode number 0, 1 or 2, the VTAP reader will still respond by returning the number of its current card emulation mode.