public final class MifareClassic extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BLOCK_SIZE |
static byte[] |
KEY_DEFAULT |
static byte[] |
KEY_MIFARE_APPLICATION_DIRECTORY |
static byte[] |
KEY_NFC_FORUM |
static int |
SIZE_1K |
static int |
SIZE_2K |
static int |
SIZE_4K |
static int |
SIZE_MINI |
static int |
TYPE_CLASSIC |
static int |
TYPE_PLUS |
static int |
TYPE_PRO |
static int |
TYPE_UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateSectorWithKeyA(int sectorIndex,
byte[] key) |
boolean |
authenticateSectorWithKeyB(int sectorIndex,
byte[] key) |
int |
blockToSector(int blockIndex) |
void |
close() |
void |
connect() |
void |
decrement(int blockIndex,
int value) |
static MifareClassic |
get(Tag tag) |
int |
getBlockCount() |
int |
getBlockCountInSector(int sectorIndex) |
int |
getMaxTransceiveLength() |
int |
getSectorCount() |
int |
getSize() |
Tag |
getTag() |
int |
getTimeout() |
int |
getType() |
void |
increment(int blockIndex,
int value) |
boolean |
isConnected() |
byte[] |
readBlock(int blockIndex) |
void |
restore(int blockIndex) |
int |
sectorToBlock(int sectorIndex) |
void |
setTimeout(int timeout) |
byte[] |
transceive(byte[] data) |
void |
transfer(int blockIndex) |
void |
writeBlock(int blockIndex,
byte[] data) |
public static final byte[] KEY_DEFAULT
public static final byte[] KEY_MIFARE_APPLICATION_DIRECTORY
public static final byte[] KEY_NFC_FORUM
public static final int TYPE_UNKNOWN
public static final int TYPE_CLASSIC
public static final int TYPE_PLUS
public static final int TYPE_PRO
public static final int SIZE_1K
public static final int SIZE_2K
public static final int SIZE_4K
public static final int SIZE_MINI
public static final int BLOCK_SIZE
public static MifareClassic get(Tag tag)
public int getType()
public int getSize()
public int getSectorCount()
public int getBlockCount()
public int getBlockCountInSector(int sectorIndex)
public int blockToSector(int blockIndex)
public int sectorToBlock(int sectorIndex)
public boolean authenticateSectorWithKeyA(int sectorIndex,
byte[] key)
throws IOException
IOExceptionpublic boolean authenticateSectorWithKeyB(int sectorIndex,
byte[] key)
throws IOException
IOExceptionpublic byte[] readBlock(int blockIndex)
throws IOException
IOExceptionpublic void writeBlock(int blockIndex,
byte[] data)
throws IOException
IOExceptionpublic void increment(int blockIndex,
int value)
throws IOException
IOExceptionpublic void decrement(int blockIndex,
int value)
throws IOException
IOExceptionpublic void transfer(int blockIndex)
throws IOException
IOExceptionpublic void restore(int blockIndex)
throws IOException
IOExceptionpublic byte[] transceive(byte[] data)
throws IOException
IOExceptionpublic int getMaxTransceiveLength()
public void setTimeout(int timeout)
public int getTimeout()
public Tag getTag()
getTag in interface TagTechnologypublic boolean isConnected()
isConnected in interface TagTechnologypublic void connect()
throws IOException
connect in interface TagTechnologyIOExceptionpublic void close()
throws IOException
close in interface TagTechnologyclose in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2008-2013. All Rights Reserved.