public abstract class Mifare
extends java.lang.Object
Qualifiers and types | Class and description |
---|---|
static class |
Mifare.CardType |
static class |
Mifare.Device |
static class |
Mifare.KeyType |
Qualifiers and types | Fields and descriptions |
---|---|
static int |
ACCESS_SIZE |
static int |
KEY_BLOCK |
static int |
KEY_SIZE |
static int |
READABLE_BLOCKS_PER_SECTOR |
static int |
S50_BLOCK_SIZE |
static int |
S50_ID_SIZE |
static int |
S50_SECTOR_COUNT |
static int |
S70_BLOCK_SIZE |
static int |
S70_ID_SIZE |
static int |
S70_SECTOR_COUNT |
static int |
VALUE_SIZE |
Constructors and instructions |
---|
Mifare() |
Qualifiers and types | Methods and instructions |
---|---|
abstract void |
close()
Close the interface.
|
abstract void |
decrement(int sectorNo,
int blockNo,
int value)
Impairment.
|
abstract void |
detectCard()
Check if there is a card in the sensing range.
|
abstract void |
encrypt(int sectorNo,
byte[] keyA,
byte[] keyB,
byte[] accessControl)
encryption.
|
abstract byte[] |
getCardID()
Obtain the ID number of the M1 card in the sensing range.
|
abstract byte[] |
getPkgRead() |
abstract byte[] |
getPkgWrite() |
abstract int |
getValue(int sectorNo,
int blockNo)
Get the value.
|
abstract void |
halt()
Hang the card.
|
abstract void |
increment(int sectorNo,
int blockNo,
int value)
Value added.
|
abstract void |
initValue(int sectorNo,
int blockNo,
int value)
Initialize the value.
|
abstract void |
loadSecKey(Mifare.KeyType keyType,
int sectorNo,
byte[] key)
Verify M1 card sector password.
|
static Mifare |
newInstance(Mifare.Device device)
Create a Mifare instance.
|
abstract void |
open()
Open the M1 reader.
|
abstract byte[] |
readBlock(int sectorNo,
int blockNo)
Read a data block from the M1 card.
|
abstract void |
reset()
Card reset.
|
abstract void |
setCardType(Mifare.CardType cardtype)
Set the card type.
|
abstract void |
writeBlock(int sectorNo,
int blockNo,
byte[] blockData)
Write a data block to the M1 card.
|
public static final int S50_ID_SIZE
public static final int S70_ID_SIZE
public static final int S50_SECTOR_COUNT
public static final int S70_SECTOR_COUNT
public static final int S50_BLOCK_SIZE
public static final int S70_BLOCK_SIZE
public static final int READABLE_BLOCKS_PER_SECTOR
public static final int VALUE_SIZE
public static final int KEY_SIZE
public static final int ACCESS_SIZE
public static final int KEY_BLOCK
public static Mifare newInstance(Mifare.Device device) throws java.lang.Throwable
device
- Fixed value is Mifare.Device.RF400Ujava.lang.Throwable
public abstract byte[] getPkgWrite()
public abstract byte[] getPkgRead()
public abstract void open() throws java.lang.Throwable
java.lang.Throwable
public abstract void close()
public abstract void reset() throws java.lang.Throwable
java.lang.Throwable
public abstract void setCardType(Mifare.CardType cardtype)
cardtype
- public abstract void detectCard() throws java.lang.Throwable
java.lang.Throwable
public abstract byte[] getCardID() throws java.lang.Throwable
java.lang.Throwable
public abstract void halt() throws java.lang.Throwable
java.lang.Throwable
public abstract void loadSecKey(Mifare.KeyType keyType, int sectorNo, byte[] key) throws java.lang.Throwable
keyType
- Password Type(KeyA/KeyB)sectorNo
- Sector numberkey
- Password valuejava.lang.Throwable
public abstract byte[] readBlock(int sectorNo, int blockNo) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numberjava.lang.Throwable
public abstract void writeBlock(int sectorNo, int blockNo, byte[] blockData) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numberblockData
- data block(16 Bytes)java.lang.Throwable
public abstract void initValue(int sectorNo, int blockNo, int value) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numbervalue
- The value to be writtenjava.lang.Throwable
public abstract int getValue(int sectorNo, int blockNo) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numberjava.lang.Throwable
- If the non-M1 card's standard storage format, will throw an exceptionpublic abstract void increment(int sectorNo, int blockNo, int value) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numbervalue
- Valuejava.lang.Throwable
public abstract void decrement(int sectorNo, int blockNo, int value) throws java.lang.Throwable
sectorNo
- Sector numberblockNo
- Block numbervalue
- Valuejava.lang.Throwable
public abstract void encrypt(int sectorNo, byte[] keyA, byte[] keyB, byte[] accessControl) throws java.lang.Throwable
sectorNo
- Sector numberkeyA
- PasswordKeyAkeyB
- PasswordKeyBaccessControl
- Control wordjava.lang.Throwable