MifareClassic class
NXP Mifare Classic. Android only -- iOS cannot talk to these tags at all, which is an Apple restriction rather than a gap in this package.
Properties
- blockCount → int
-
How many 16-byte blocks the card holds in total.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxTransceiveLength → int
-
The value at discovery. Call
getMaxTransceiveLengthfor the live one.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sectorCount → int
-
How many sectors the card holds. Sector sizes are not uniform -- see blockToSector.
final
- size → int
-
The tag's total size in bytes.
final
- timeout → Duration
-
The value at discovery. Call
getTimeoutfor the live one.final - type → MifareClassicType
-
Which Mifare Classic product this is.
final
Methods
-
authenticateSectorWithKeyA(
{required int sectorIndex, required Uint8List key}) → Future< bool> - Authenticates a sector with key A. Returns false when the key is wrong.
-
authenticateSectorWithKeyB(
{required int sectorIndex, required Uint8List key}) → Future< bool> - Authenticates a sector with key B. Returns false when the key is wrong.
-
blockToSector(
{required int blockIndex}) → Future< int> - The sector a block belongs to.
-
decrement(
{required int blockIndex, required int value}) → Future< void> - Subtracts from a value block, leaving the result in the internal transfer buffer.
-
getBlockCountInSector(
{required int sectorIndex}) → Future< int> - How many blocks a sector holds.
-
getMaxTransceiveLength(
) → Future< int> -
The largest payload
transceiveaccepts, in bytes.inherited -
getTimeout(
) → Future< Duration> -
The current transceive timeout.
inherited
-
increment(
{required int blockIndex, required int value}) → Future< void> - Adds to a value block, leaving the result in the internal transfer buffer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBlock(
{required int blockIndex}) → Future< Uint8List> - Reads one 16-byte block.
-
reset(
) → Future< void> -
Closes the connection to the tag and opens it again, reselecting it in the RF field.
inherited
-
restore(
{required int blockIndex}) → Future< void> - Copies a value block into the internal transfer buffer.
-
sectorToBlock(
{required int sectorIndex}) → Future< int> - The first block of a sector.
-
setTimeout(
Duration timeout) → Future< void> -
Gives a slow tag more time before the exchange fails as lost.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transceive(
Uint8List data) → Future< Uint8List> -
Sends a raw command to the tag and returns its answer.
inherited
-
transfer(
{required int blockIndex}) → Future< void> - Writes the internal transfer buffer to a value block.
-
writeBlock(
{required int blockIndex, required Uint8List data}) → Future< void> - Writes one 16-byte block.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- keyDefault → Uint8List
-
The factory key,
FF FF FF FF FF FF, that a sector still answers to until someone personalises it. AOSPMifareClassic.KEY_DEFAULT.no setter - keyMifareApplicationDirectory → Uint8List
-
The key
A0 A1 A2 A3 A4 A5, which the Mifare Application Directory in sector 0 is published with. AOSPMifareClassic.KEY_MIFARE_APPLICATION_DIRECTORY.no setter - keyNfcForum → Uint8List
-
The key an NFC Forum formatted card uses for its NDEF sectors,
D3 F7 D3 F7 D3 F7. AOSPMifareClassic.KEY_NFC_FORUM.no setter
Static Methods
-
from(
NfcTag tag) → MifareClassic? -
Returns an instance for
tag, or null when the tag is not a Mifare Classic.
Constants
- blockSize → const int
- Bytes in one block, which is also the length readBlock returns and writeBlock wants.
- size1K → const int
- size of a Mifare Classic 1K, in bytes.
- size2K → const int
- size of a Mifare Classic 2K, in bytes.
- size4K → const int
- size of a Mifare Classic 4K, in bytes.
- sizeMini → const int
- size of a Mifare Classic Mini, in bytes.