Before CyanogenMod 11, CyanogenMod supported its own host-based card emulation functionality. You could register a foreground dispatch for the android.nfc.tech.IsoPcdA
technology and could then emulate a smartcard by using the IsoPcdA.transceive()
method. See Nikolay Elenkov's blog post on how to use this API.
However, browsing through the CyanogenMod 11 source (specifically tht of the NFC service) it seems that this functionality has been dropped in version 11 in favor of Android 4.4's official HCE API.
The official Android 4.4 HCE API permits apps to emulate a contactless smartcard (ISO 14443-4 + ISO 7816-4 APDUs) in an Android service. That service would handle all incoming command APDUs for an application and generate proper response APDUs. See the official API user guide for further information on how to register such a HCE service and this answer on how to handle incoming command APDUs within your HCE service.
Unfortunately this API is not available either on devices that use libnfc-nxp as the low-level NFC stack (see the empty implementation of routeAid()
and enableRoutingToHost()
in the CyanogenMod 11 source code).
So to summarize this, it seems as if it's currently not possible to do host-based card emulation on a Nexus S with CM 11.