Start Host Card Emulation (HCE) for the calling application.
NFC_API nfc_result_t nfc_start_iso14443_4_emulation(const nfc_iso14443_4_card_t *card)
The structure containing the information that will be emulated
Library:libnfc (For the qcc command, use the -l nfc option to link against this library)
HCE emulates an ISO 14443-4 smart card. This function registers card emulation information within the NFC service. It also starts HCE when the application is in the foreground. Only one instance of HCE is allowed at one time, and emulation is only active while this application is in the foreground. If an application is placed in the background, the NFC service automatically stops the appplication's HCE.
If you want to start HCE in the background, you can use nfc_hce_register_aid() with a dedicated AID for the registration.
Once the application is placed in the foreground again, the NFC service resumes HCE. If an application attempts to call this function while it is already emulating an ISO 14443-4 card, the second call will fail with NFC_RESULT_LIMITATION_EXCEEDED.
- NFC_ISO14443_4_COMMAND_EVENT: This event indicates that a command was generated by the target reader. The application must first call nfc_get_target() to retrieve the event target, and then call nfc_get_iso14443_4_emulation_command() using the target retrieved to extract the command data from the triggered event.
- NFC_ISO14443_4_EVENT_CODE_EVENT: This event indicates that an ISO 14443-4 related event has occurred. This event is associated with an event code from the target reader. Call nfc_get_notification_value() to extract the event code, which is of type iso14443_4_event_t.
- NFC_RESULT_INVALID_PARAMETER: A parameter is invalid.
- NFC_RESULT_SERVICE_CONNECTION_ERROR: The application is not connected to NFC service.
- NFC_RESULT_OUT_OF_MEMORY: The system memory available for the NFC system to complete this operation is insufficient.
- NFC_RESULT_LIMITATION_EXCEEDED: Host Card Emulation (HCE) is already running.
- NFC_RESULT_OPERATION_REJECTED: NFC is not enabled, or application is not in foreground.
- NFC_RESULT_OPERATION_NOT_SUPPORTED: The Application Data buffer of the Type A card, or Higher Layer Response buffer of the Type B card is too large for the capabilities of the NFC Controller.
Last modified: 2014-06-24