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_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.
| Name | Type | Summary | Optional |
|---|---|---|---|
sectorIndex | Number | Index of sector to authenticate, starting from 0. | No |
key | Titanium.Buffer | 6-byte authentication key. | No |
Returns: Boolean — Returns true on success, false on authentication failure.
authenticateSectorWithKeyB #
Authenticate a sector with key B.
| Name | Type | Summary | Optional |
|---|---|---|---|
sectorIndex | Number | Index of sector to authenticate, starting from 0. | No |
key | Titanium.Buffer | 6-byte authentication key. | No |
Returns: Boolean — Returns true on success, false on authentication failure.
blockToSector #
Return the sector that contains a given block.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index 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.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to decrement, starting from 0. | No |
value | Number | Non-negative to decrement by. | No |
getBlockCountInSector #
Return the number of blocks in the given sector.
| Name | Type | Summary | Optional |
|---|---|---|---|
sectorIndex | Number | Index of sector, starting from 0. | No |
Returns: Number
getMaxTransceiveLength #
Return the maximum number of bytes that can be sent with transceive.
Returns: Number
increment #
Increment a value block, storing the result in the temporary block on the tag.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to increment, starting from 0. | No |
value | Number | Non-negative to increment by. | No |
readBlock #
Read 16-byte block.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to read, starting from 0. | No |
Returns: Titanium.Buffer — 16 byte block.
restore #
Copy from a value block to the temporary block.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to copy from. | No |
sectorToBlock #
Return the first block of a given sector.
| Name | Type | Summary | Optional |
|---|---|---|---|
sectorIndex | Number | Index of sector to lookup, starting from 0. | No |
Returns: Number
setTimeout #
Set the transceive timeout in milliseconds.
| Name | Type | Summary | Optional |
|---|---|---|---|
timeout | Number | Timeout value in milliseconds. | No |
transceive #
Send raw NfcA data to the tag and receive the response.
| Name | Type | Summary | Optional |
|---|---|---|---|
data | Titanium.Buffer | Bytes to send. | No |
Returns: Titanium.Buffer — Response bytes received.
transfer #
Copy from the temporary block to a value block.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to copy to. | No |
writeBlock #
Write 16-byte block.
| Name | Type | Summary | Optional |
|---|---|---|---|
blockIndex | Number | Index of block to write, starting from 0. | No |
data | Titanium.Buffer | 16 bytes of data to write. | No |