Skip to content

Modules.Nfc.TagTechnologyMifareClassic

Provides access to MIFARE Classic properties and I/O operations on a Modules.Nfc.NfcTag.

Use the Modules.Nfc.createTagTechnologyMifareClassic method to create this tag technology.

See also: MifareClassic

Extends: Modules.Nfc.TagTechnology · Since: 1.1.0 · Platforms: android

Properties #

KEY_DEFAULT#

Type: Titanium.Buffer

The default factory key.

KEY_MIFARE_APPLICATION_DIRECTORY#

Type: Titanium.Buffer

The well-known key for tags formatted according to the MIFARE Application Directory (MAD) specification.

KEY_NFC_FORUM#

Type: Titanium.Buffer

The well-known key for tags formatted according to the NDEF on MIFARE Classic specification.

Methods #

authenticateSectorWithKeyA #

Authenticate a sector with key A.

Parameters:
NameTypeSummaryOptional
sectorIndexNumberIndex of sector to authenticate, starting from 0.No
keyTitanium.Buffer6-byte authentication key.No

Returns: Boolean — Returns true on success, false on authentication failure.

authenticateSectorWithKeyB #

Authenticate a sector with key B.

Parameters:
NameTypeSummaryOptional
sectorIndexNumberIndex of sector to authenticate, starting from 0.No
keyTitanium.Buffer6-byte authentication key.No

Returns: Boolean — Returns true on success, false on authentication failure.

blockToSector #

Return the sector that contains a given block.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to lookup, starting from 0.No

Returns: Number

decrement #

Decrement a value block, storing the result in the temporary block on the tag.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to decrement, starting from 0.No
valueNumberNon-negative to decrement by.No

getBlockCount #

Return the total number of MIFARE Classic blocks.

Returns: Number

getBlockCountInSector #

Return the number of blocks in the given sector.

Parameters:
NameTypeSummaryOptional
sectorIndexNumberIndex of sector, starting from 0.No

Returns: Number

getMaxTransceiveLength #

Return the maximum number of bytes that can be sent with transceive.

Returns: Number

getSectorCount #

Return the number of MIFARE Classic sectors.

Returns: Number

getSize #

Return the size of the tag in bytes.

Returns: Number

getTimeout #

Get the current transceive timeout in milliseconds.

Returns: Number

getType #

Return the type of this MIFARE Classic compatible tag.

Returns: Number

increment #

Increment a value block, storing the result in the temporary block on the tag.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to increment, starting from 0.No
valueNumberNon-negative to increment by.No

readBlock #

Read 16-byte block.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to read, starting from 0.No

Returns: Titanium.Buffer — 16 byte block.

restore #

Copy from a value block to the temporary block.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to copy from.No

sectorToBlock #

Return the first block of a given sector.

Parameters:
NameTypeSummaryOptional
sectorIndexNumberIndex of sector to lookup, starting from 0.No

Returns: Number

setTimeout #

Set the transceive timeout in milliseconds.

Parameters:
NameTypeSummaryOptional
timeoutNumberTimeout value in milliseconds.No

transceive #

Send raw NfcA data to the tag and receive the response.

Parameters:
NameTypeSummaryOptional
dataTitanium.BufferBytes to send.No

Returns: Titanium.Buffer — Response bytes received.

transfer #

Copy from the temporary block to a value block.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to copy to.No

writeBlock #

Write 16-byte block.

Parameters:
NameTypeSummaryOptional
blockIndexNumberIndex of block to write, starting from 0.No
dataTitanium.Buffer16 bytes of data to write.No

Titanium SDK Documentation