org.opennfc.cardemulation
Interface CardEmulationEventHandler


public interface CardEmulationEventHandler

Interface definition used for receiving notifications from the CardEmulation. These callbacks methods are called if the CardEmulationEventHandler has been registered with the Card Emulation Registry using the CardEmulation.start(org.opennfc.cardemulation.CardEmulationEventHandler) method.

Since:
Open NFC 4.0

Field Summary
static int DEACTIVATE
          The card emulation is de-selected by a remote reader or the field is cut off.
static int SELECTION
          The card emulation is selected by a remote reader.
 
Method Summary
 void onCommandReceived(byte[] command)
          Method called when a command is received from a reader.
 void onEventReceived(int event)
          Method called when an event is received from a reader.
 

Field Detail

SELECTION

static final int SELECTION
The card emulation is selected by a remote reader.

See Also:
Constant Field Values

DEACTIVATE

static final int DEACTIVATE
The card emulation is de-selected by a remote reader or the field is cut off.

See Also:
Constant Field Values
Method Detail

onEventReceived

void onEventReceived(int event)
Method called when an event is received from a reader.

Parameters:
event - the event value: SELECTION or DEACTIVATE.

onCommandReceived

void onCommandReceived(byte[] command)
Method called when a command is received from a reader. Use CardEmulation.sendResponse() to send an answer to the reader.

Parameters:
command - the command received from the reader.

Copyright © 2010-2011 Inside Secure
Except as noted, this content is licensed under Apache 2.0 License.