android.nfc.tech
Class MifareClassic
java.lang.Object
android.nfc.tech.MifareClassic
- All Implemented Interfaces:
- TagTechnology, Closeable
public final class MifareClassic
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_DEFAULT
public static final byte[] KEY_DEFAULT
KEY_MIFARE_APPLICATION_DIRECTORY
public static final byte[] KEY_MIFARE_APPLICATION_DIRECTORY
KEY_NFC_FORUM
public static final byte[] KEY_NFC_FORUM
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN
- See Also:
- Constant Field Values
TYPE_CLASSIC
public static final int TYPE_CLASSIC
- See Also:
- Constant Field Values
TYPE_PLUS
public static final int TYPE_PLUS
- See Also:
- Constant Field Values
TYPE_PRO
public static final int TYPE_PRO
- See Also:
- Constant Field Values
SIZE_1K
public static final int SIZE_1K
- See Also:
- Constant Field Values
SIZE_2K
public static final int SIZE_2K
- See Also:
- Constant Field Values
SIZE_4K
public static final int SIZE_4K
- See Also:
- Constant Field Values
SIZE_MINI
public static final int SIZE_MINI
- See Also:
- Constant Field Values
BLOCK_SIZE
public static final int BLOCK_SIZE
- See Also:
- Constant Field Values
get
public static MifareClassic get(Tag tag)
getType
public int getType()
getSize
public int getSize()
getSectorCount
public int getSectorCount()
getBlockCount
public int getBlockCount()
getBlockCountInSector
public int getBlockCountInSector(int sectorIndex)
blockToSector
public int blockToSector(int blockIndex)
sectorToBlock
public int sectorToBlock(int sectorIndex)
authenticateSectorWithKeyA
public boolean authenticateSectorWithKeyA(int sectorIndex,
byte[] key)
throws IOException
- Throws:
IOException
authenticateSectorWithKeyB
public boolean authenticateSectorWithKeyB(int sectorIndex,
byte[] key)
throws IOException
- Throws:
IOException
readBlock
public byte[] readBlock(int blockIndex)
throws IOException
- Throws:
IOException
writeBlock
public void writeBlock(int blockIndex,
byte[] data)
throws IOException
- Throws:
IOException
increment
public void increment(int blockIndex,
int value)
throws IOException
- Throws:
IOException
decrement
public void decrement(int blockIndex,
int value)
throws IOException
- Throws:
IOException
transfer
public void transfer(int blockIndex)
throws IOException
- Throws:
IOException
restore
public void restore(int blockIndex)
throws IOException
- Throws:
IOException
transceive
public byte[] transceive(byte[] data)
throws IOException
- Throws:
IOException
getMaxTransceiveLength
public int getMaxTransceiveLength()
setTimeout
public void setTimeout(int timeout)
getTimeout
public int getTimeout()
getTag
public Tag getTag()
- Specified by:
getTag
in interface TagTechnology
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interface TagTechnology
connect
public void connect()
throws IOException
- Specified by:
connect
in interface TagTechnology
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface TagTechnology
- Specified by:
close
in interface Closeable
- Throws:
IOException
Copyright © 2008-2012. All Rights Reserved.