java.lang.Object
com.pi4j.crowpi.components.internal.rfid.RfidCard
com.pi4j.crowpi.components.internal.rfid.Mifare1K
Implementation of MIFARE Classic 1K cards with 16 sectors with 4 blocks (16 bytes) each.
 First sector with manufacturer block and sector trailers are explicitly hidden from the user.
- 
Field Summary
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the maximum capacity in bytes this card can store.protected byte[]Reads all available blocks from the card and returns a byte array.protected voidwriteBytes(byte[] data) Writes the given data to the card, using as many blocks as needed.Methods inherited from class com.pi4j.crowpi.components.internal.rfid.RfidCardgetSerial, getUid, readObject, readObject, writeObject
- 
Method Details- 
getCapacitypublic int getCapacity()Returns the maximum capacity in bytes this card can store. This method should already subtract all unavailable blocks / sectors, e.g. trailer blocks.- Specified by:
- getCapacityin class- RfidCard
- Returns:
- Maximum capacity in bytes
 
- 
readBytesReads all available blocks from the card and returns a byte array. This method targets the same blocks asRfidCard.writeBytes(byte[])does.- Specified by:
- readBytesin class- RfidCard
- Returns:
- Byte array of available data on card
- Throws:
- RfidException- Reading data from card failed
 
- 
writeBytesWrites the given data to the card, using as many blocks as needed. This method will only write to safe blocks and does not overwrite any internal blocks.- Specified by:
- writeBytesin class- RfidCard
- Parameters:
- data- Data to write to the card
- Throws:
- RfidException- Writing data to card failed
- IllegalArgumentException- Given data exceeds card capacity
 
 
-