org.opennfc.cardemulation
Interface CardEmulationRegistry


public interface CardEmulationRegistry

The card emulation registry is used to register a card emulation.

Since:
Open NFC 4.1

Method Summary
 boolean checkConnectionProperty(ConnectionProperty property)
          Checks if the NFC Controller supports a connection property for the card emulation function.
 CardEmulation createCardEmulation(ConnectionProperty cardType, byte[] identifier)
          Creates a new instance of a card emulation.
 CardEmulation createCardEmulation(ConnectionProperty cardType, int randomIdentifierLength)
          Creates a new instance of a card emulation.
 

Method Detail

createCardEmulation

CardEmulation createCardEmulation(ConnectionProperty cardType,
                                  byte[] identifier)
Creates a new instance of a card emulation.

The emulation will start only when CardEmulation.start() is called.

Parameters:
cardType - the type of the card to be created:
identifier - the card identifier. For a tag of type A, the length of the identifier may be 4, 7 or 10 bytes. For a tag of type B, the length of the identifier shall be 4.
Returns:
the card emulation instance.
Throws:
SecurityException - if the calling application is not allowed to perform card emulation.
IllegalArgumentException - if cardType or identifier is null.
IllegalArgumentException - if cardType is unknown or the identifier length is not compliant with the card type.

createCardEmulation

CardEmulation createCardEmulation(ConnectionProperty cardType,
                                  int randomIdentifierLength)
Creates a new instance of a card emulation.

The emulation will start only when CardEmulation.start() is called.

Parameters:
cardType - the type of the card to be created:
randomIdentifierLength - the length in byte of the card identifier randomly generated for each reader selection. For a tag of type A, the length of the identifier may be 4, 7 or 10 bytes. For a tag of type B, the length of the identifier shall be 4.
Returns:
the card emulation instance.
Throws:
SecurityException - if the calling application is not allowed to perform card emulation.
IllegalArgumentException - if cardType is null.
IllegalArgumentException - if cardType is unknown or randomIdentifierLength is not compliant with the card type.

checkConnectionProperty

boolean checkConnectionProperty(ConnectionProperty property)
Checks if the NFC Controller supports a connection property for the card emulation function.

Parameters:
property - the connection property to check.
Returns:
true if the type of connection is supported by the NFC Controller, false if this type of connection is not supported.
Throws:
IllegalArgumentException - if property in null.

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