|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.io.nfc.emulation.VirtualTarget
net.rim.device.api.io.nfc.emulation.VirtualNDEFTag
public class VirtualNDEFTag
Represents an emulated NFC NDEF tag target.
| Field Summary | ||
|---|---|---|
static int |
MAX_SIZE
Constant for maximum allowed size for virtual NDEF tag. |
|
static int |
MIN_SIZE
Constant for minimum allowed size for virtual NDEF tag. |
|
| Constructor Summary | ||
|---|---|---|
VirtualNDEFTag(NDEFMessage tagData)
Constructs an emulated NFC Forum Type 4 NDEF tag target as ISO 14443 Type A. |
||
VirtualNDEFTag(NDEFMessage tagData,
int technologyType,
String identifier,
int maxSize)
Constructs an emulated NFC Forum Type 4 NDEF tag target. |
||
VirtualNDEFTag(NDEFMessage tagData,
VirtualNDEFTagCallback callback)
Constructs an emulated NFC Forum Type 4 NDEF tag target as ISO 14443 Type A. |
||
VirtualNDEFTag(NDEFMessage tagData,
VirtualNDEFTagCallback callback,
int technologyType,
String identifier,
int maxSize)
Constructs an emulated NFC Forum Type 4 NDEF tag target. |
||
| Method Summary | ||
|---|---|---|
int |
getType()
Returns the type of the emulated NFC NDEF tag target. |
|
boolean |
isEmulating()
Indicates whether this target is started. |
|
void |
setType(int type)
Sets the type of the emulated NFC NDEF tag target. |
|
void |
startEmulation()
Starts virtual NDEF target emulation. |
|
void |
stopEmulation()
Stops virtual NDEF target emulation. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_SIZE
public static final int MIN_SIZE
| Constructor Detail |
|---|
public VirtualNDEFTag(NDEFMessage tagData)
tagData - An NDEFMessage to store on the emulated tag.
IllegalArgumentException - When tagData is null or has no records.
public VirtualNDEFTag(NDEFMessage tagData,
VirtualNDEFTagCallback callback)
tagData - An NDEFMessage to store on the emulated tag.callback - The optional VirtualNDEFTagCallback callback to
invoke when tag events occur.
IllegalArgumentException - When tagData is null or has no records.
public VirtualNDEFTag(NDEFMessage tagData,
int technologyType,
String identifier,
int maxSize)
tagData - An NDEFMessage to store on the emulated tag.technologyType - The technology type of ISO 14443 NFC emulation
target. Must be one of the constants TechnologyType.ISO14443A
or TechnologyType.ISO14443B.identifier - An identifier for the emulated NFC NDEF tag. If
null, the identifier will be automatically generated. The
identifier for type A must have length 4, 7 or 10. The identifier for
type B must have length 4.maxSize - The maximum length, in bytes, reserved for the data
stored in the NFC NDEF tag.
IllegalArgumentException - When any of the following conditions
are encountered:
tagData is null or has no records. technologyType is not one of
TechnologyType.ISO14443A
or TechnologyType.ISO14443B.identifier for type A is not null and
does not have length 4, 7 or 10.identifier for type B is not null and does not have
length 4. maxSize is out of range.
public VirtualNDEFTag(NDEFMessage tagData,
VirtualNDEFTagCallback callback,
int technologyType,
String identifier,
int maxSize)
tagData - An NDEFMessage to store on the emulated tag.technologyType - The technology type of ISO 14443 NFC emulation
target. Must be one of the constants TechnologyType.ISO14443A
or TechnologyType.ISO14443B.identifier - An identifier for the emulated NFC NDEF tag. If
null, the identifier will be automatically generated. The
identifier for type A must have length 4, 7 or 10. The identifier for
type B must have length 4.maxSize - The maximum length, in bytes, reserved for the data
stored in the NFC NDEF tag.callback - The optional VirtualNDEFTagCallback callback to
invoke when tag events occur.
IllegalArgumentException - When any of the following conditions
are encountered:
tagData is null or has no records. technologyType is not one of
TechnologyType.ISO14443A
or TechnologyType.ISO14443B.identifier for type A is not null and
does not have length 4, 7 or 10.identifier for type B is not null and does not have
length 4. maxSize is out of range.| Method Detail |
|---|
public int getType()
TechnologyType.ISO14443A or TechnologyType.ISO14443B.public void setType(int type)
type - One of TechnologyType.ISO14443A
or TechnologyType.ISO14443B.
public final void startEmulation()
throws EmulationInProgressException,
NFCException
startEmulation in class VirtualTargetEmulationInProgressException - When emulation cannot be started
because an emulation operation is already in progress.
NFCException - When emulation cannot be started for any other reason
ControlledAccessException - When emulation cannot be started
because of insufficient application permissions.
SecurityException - When emulation cannot be started because of IT
Policy restrictions.
public final void stopEmulation()
throws NFCException
stopEmulation in class VirtualTargetNFCException - When emulation cannot be stopped.
public final boolean isEmulating()
throws NFCException
isEmulating in class VirtualTargettrue if target emulation has begun, otherwise
false.
NFCException - If a problem occurs while checking emulation status.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal