|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface CardEmulation
The Card emulation is a feature of the NFC Controller used to emulate a card with the NFC Device.
The following figure depicts the life-cycle of the card emulation:
Starting the Card Emulation
To emulate a card, a client application calls the method start().
When this method returns successfully, an external reader may start to interact with the simulated card.
Answering to the Reader
When a command is received and analyzed, the answer can be sent back
to the reader using the method sendResponse().
Exclusivity
Only one card of a given type can be emulated at the same time. If several applications try to simultaneously emulate the same card type, the first application obtaining the connection has the exclusive use of the service. The other application are rejected. The card emulation can be open when the owner application stops the card emulation.
Stopping the Card Emulation
The card emulation is stopped by calling the method stop().
| Method Summary | |
|---|---|
void |
sendResponse(byte[] response)
Sends the response of the emulated card to the reader. |
void |
start(CardEmulationEventHandler handler)
Starts the emulation of the card. |
void |
stop()
Stop the emulation of the card. |
| Method Detail |
|---|
void start(CardEmulationEventHandler handler)
throws NfcException
handler - a CardEmulationEventHandler whose
onEventReceived() method will be
called for each event received or
onCommandReceived() method will be
called for each command received.
IllegalArgumentException - if handler is null.
IllegalStateException - if the emulation is already started.
NfcException - in case of NFC error.void stop()
void sendResponse(byte[] response)
throws NfcException
response - the buffer with the response data to send to the reader.
IllegalArgumentException - if response is null.
NfcException - if the card emulation is stopped or in case of NFC error.
|
Copyright © 2010-2011 Inside Secure |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||