|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MFManufacturerBlock
A class representing a Mifare Standard manufacturer block. Manufacturer block is always the first block of the first sector of a card.
Field Summary | |
---|---|
static int |
UID_LEN
Number of bytes in a Mifare Standard card UID. |
Fields inherited from interface com.nokia.nfc.nxp.mfstd.MFBlock |
---|
BLOCK_LEN, BLOCKTYPE_DATA, BLOCKTYPE_MANUFACTURER, BLOCKTYPE_TRAILER, MAX_DIFF, MIN_DIFF |
Method Summary | |
---|---|
int |
getCheckByte()
Reads the check byte from the manufacturer block. |
byte[] |
getManufacturerData()
Reads the manufacturer data from the manufacturer block. |
byte[] |
getUID()
Returns the serial number of the card as a byte array. |
boolean |
isValueBlock(MFKey key)
Always returns false as a manufacturer block can
never be a value block. |
void |
write(MFKey key,
byte[] src,
int dstOffset)
Always throws a MFStandardException because the
manufacturer block is read-only. |
void |
write(MFKey key,
byte[] src,
int srcOffset,
int length,
int dstOffset)
Always throws a MFStandardException because the
manufacturer block is read-only. |
void |
writeValue(MFKey key,
MFValue newValue)
Always throws a MFStandardException because the
manufacturer block is read-only. |
Methods inherited from interface com.nokia.nfc.nxp.mfstd.MFBlock |
---|
copyFrom, copyTo, decrement, getBlockIndex, getBlockType, increment, readValue |
Methods inherited from interface com.nokia.nfc.nxp.mfstd.MFDataArea |
---|
read, size, toString |
Field Detail |
---|
static final int UID_LEN
Method Detail |
---|
boolean isValueBlock(MFKey key) throws MFStandardException, java.io.IOException
false
as a manufacturer block can
never be a value block. No communication with the card is done
if this method is called.
isValueBlock
in interface MFBlock
key
- the authentication key.
false
.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.MFBlock.isValueBlock(com.nokia.nfc.nxp.mfstd.MFKey)
byte[] getUID()
Returns the serial number of the card as a byte array.
The bytes in the returned array are in the same order
as these are in the raw contents of manufacturer block.
The length of the array is always 4
.
Note that no communication with the card is required when this method is called once the connection has been established.
int getCheckByte() throws java.io.IOException
java.io.IOException
- if a connection error occurs.byte[] getManufacturerData() throws java.io.IOException
java.io.IOException
- if a connection error occurs.void write(MFKey key, byte[] src, int dstOffset) throws MFStandardException, java.io.IOException
MFStandardException
because the
manufacturer block is read-only.
write
in interface MFDataArea
key
- the authentication key. If null
then the device's default keys are used.src
- the data to write.dstOffset
- the offset in this data area.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.MFDataArea.write(com.nokia.nfc.nxp.mfstd.MFKey, byte[], int)
void write(MFKey key, byte[] src, int srcOffset, int length, int dstOffset) throws MFStandardException, java.io.IOException
MFStandardException
because the
manufacturer block is read-only.
write
in interface MFDataArea
key
- the authentication key. If null
then the device's default keys are used.src
- the source array.srcOffset
- the offset in the source array.length
- the number of bytes to read from the source array.dstOffset
- the offset in this data area.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.MFDataArea.write(com.nokia.nfc.nxp.mfstd.MFKey, byte[], int, int, int)
void writeValue(MFKey key, MFValue newValue) throws MFStandardException, java.io.IOException
MFStandardException
because the
manufacturer block is read-only.
writeValue
in interface MFBlock
key
- the authentication key. If null
then the device's default keys are used.newValue
- new value block contents
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.MFBlock.writeValue(com.nokia.nfc.nxp.mfstd.MFKey, com.nokia.nfc.nxp.mfstd.MFValue)
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |