Nokia Extensions for JSR-257

com.nokia.nfc.nxp.mfstd
Interface MFManufacturerBlock

All Superinterfaces:
MFBlock, MFDataArea

public interface MFManufacturerBlock
extends MFBlock

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

UID_LEN

static final int UID_LEN
Number of bytes in a Mifare Standard card UID.

See Also:
Constant Field Values
Method Detail

isValueBlock

boolean isValueBlock(MFKey key)
                     throws MFStandardException,
                            java.io.IOException
Always returns false as a manufacturer block can never be a value block. No communication with the card is done if this method is called.

Specified by:
isValueBlock in interface MFBlock
Parameters:
key - the authentication key.
Returns:
always returns false.
Throws:
MFStandardException - if authentication fails.
java.io.IOException - if a connection error occurs.
See Also:
MFBlock.isValueBlock(com.nokia.nfc.nxp.mfstd.MFKey)

getUID

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.

Returns:
the serial number of the card.

getCheckByte

int getCheckByte()
                 throws java.io.IOException
Reads the check byte from the manufacturer block.

Returns:
the read check byte.
Throws:
java.io.IOException - if a connection error occurs.

getManufacturerData

byte[] getManufacturerData()
                           throws java.io.IOException
Reads the manufacturer data from the manufacturer block.

Returns:
the manufacturer data as a 11 byte long byte array.
Throws:
java.io.IOException - if a connection error occurs.

write

void write(MFKey key,
           byte[] src,
           int dstOffset)
           throws MFStandardException,
                  java.io.IOException
Always throws a MFStandardException because the manufacturer block is read-only.

Specified by:
write in interface MFDataArea
Parameters:
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.
Throws:
MFStandardException - if authentication fails.
java.io.IOException - if a connection error occurs.
See Also:
MFDataArea.write(com.nokia.nfc.nxp.mfstd.MFKey, byte[], int)

write

void write(MFKey key,
           byte[] src,
           int srcOffset,
           int length,
           int dstOffset)
           throws MFStandardException,
                  java.io.IOException
Always throws a MFStandardException because the manufacturer block is read-only.

Specified by:
write in interface MFDataArea
Parameters:
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.
Throws:
MFStandardException - if authentication fails.
java.io.IOException - if a connection error occurs.
See Also:
MFDataArea.write(com.nokia.nfc.nxp.mfstd.MFKey, byte[], int, int, int)

writeValue

void writeValue(MFKey key,
                MFValue newValue)
                throws MFStandardException,
                       java.io.IOException
Always throws a MFStandardException because the manufacturer block is read-only.

Specified by:
writeValue in interface MFBlock
Parameters:
key - the authentication key. If null then the device's default keys are used.
newValue - new value block contents
Throws:
MFStandardException - if authentication fails.
java.io.IOException - if a connection error occurs.
See Also:
MFBlock.writeValue(com.nokia.nfc.nxp.mfstd.MFKey, com.nokia.nfc.nxp.mfstd.MFValue)

Nokia Extensions for JSR-257

Copyright � 2010 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.