MifareUltralightC class
Provides an interface for interacting with Mifare Ultralight C RFID tags via an RFID reader.
This class facilitates operations such as reading and writing data to Mifare Ultralight C RFID tags, authenticating access to the tags, and configuring tag settings. It abstracts the complexities of direct communication with RFID hardware through the use of an RFID reader interface.
Usage
An instance of RFIDReader
must be provided to handle communication with the RFID hardware.
Once instantiated, MifareUltralightC
offers methods for data manipulation, authentication,
and tag configuration management.
Example
MifareUltralightC card = MifareUltralightC(reader: yourRFIDReader);
// Reading data from the tag
List<int> data = await card.readData(blockNumber: 4);
// Writing data to the tag
await card.writeData(blockNumber: 4, data: [0x01, 0x02, 0x03, 0x04]);
Features
- Read and write operations with support for both single and multiple blocks.
- Secure tag authentication using standard and advanced encryption methods.
- Access to tag's unique identification and configuration for advanced management.
Note: This class is specifically designed for Mifare Ultralight C tags and relies on the capabilities
of the provided RFIDReader
implementation. Ensure compatibility of your RFID reader with the class.
Constructors
- MifareUltralightC.new({required RFIDReader reader})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- reader → RFIDReader
-
The RFID reader used for communicating with the RFID tag.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
authenticate(
{required List< int> key}) → Future<void> - Authenticates with a Mifare Ultralight C RFID tag using a 3DES key.
-
changeAuthKey(
{required List< int> key}) → Future<void> - Updates the authentication key on a Mifare Ultralight C RFID tag.
-
getAuthConfig(
) → Future< AuthConfig> - Retrieves the authentication configuration from a Mifare Ultralight C RFID tag.
-
getUID(
) → Future< List< int> > - Retrieves the Unique Identifier (UID) of a Mifare Ultralight C RFID tag.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readData(
{required int blockNumber, int length = BLOCK_SIZE}) → Future< List< int> > - Reads data from a specified block on a Mifare Ultralight C RFID tag.
-
readLongData(
{required int blockNumber, int length = BLOCK_SIZE}) → Future< List< int> > - Reads a sequence of data spanning multiple blocks from a Mifare Ultralight C RFID tag.
-
setAuthConfig(
{required int startingBlock, required AuthLock lock}) → Future< void> - Sets the authentication configuration on a Mifare Ultralight C RFID tag.
-
toString(
) → String -
A string representation of this object.
inherited
-
writeData(
{required int blockNumber, required List< int> data}) → Future<void> - Writes data to a specified block on a Mifare Ultralight C RFID tag.
-
writeLongData(
{required int blockNumber, required List< int> data}) → Future<void> - Writes a sequence of data spanning multiple blocks to a Mifare Ultralight C RFID tag.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- AUTH_CONFIG_ADDRESS_END → const int
- The ending address of the authentication configuration in the RFID tag's memory.
- AUTH_CONFIG_ADDRESS_START → const int
- The starting address of the authentication configuration in the RFID tag's memory.
- AUTH_KEY_ADDRESS_END → const int
- The ending address of the authentication key in the RFID tag's memory.
- AUTH_KEY_ADDRESS_START → const int
- The starting address of the authentication key in the RFID tag's memory.
- BLOCK_SIZE → const int
- The size of a single block in bytes. Mifare Ultralight C tags use a block size of 4 bytes.
- DATA_ADDRESS_END → const int
- The ending address of the general data area in the RFID tag's memory.
- DATA_ADDRESS_START → const int
- The starting address of the general data area in the RFID tag's memory.
- MAX_READ_LENGTH → const int
- The maximum number of bytes that can be read in a single read operation.
- MEMORY_ADDRESS_END → const int
- The ending address of the RFID tag's memory.
- MEMORY_ADDRESS_START → const int
- The starting address of the RFID tag's memory.
- OTP_ADDRESS → const int
- The address of the One-Time Programmable (OTP) area in the RFID tag's memory.
- SERIAL_NUMBER_ADDRESS_END → const int
- The ending address of the serial number in the RFID tag's memory.
- SERIAL_NUMBER_ADDRESS_START → const int
- The starting address of the serial number in the RFID tag's memory.