Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

NFCTagTechnology_MifareClassic API

Subset of NFCTagTechnology. For code examples, see Rhodes System API Samples: NFC.

As of Rhodes version 3.3.3, the Barcode, NFC, and Signature Capture APIs, as well as Rhom data encryption are removed from Rhodes. These features are only supported in Zebra RhoMobile Suite. If you wish to use these features, you will need to upgrade to RhoMobile Suite. Your application’s build.yml will also need to be modified to indicate the application type is ‘Rhoelements’. Additionally, a RhoElements license is required.

Enabling NFC

To use the NFC methods, you need to enable NFC on the Android device and ensure that the version is 2.3.3 or later. Do this by adding that capability to the build.yml file:

android: 
  version 2.3.3
  extensions:
  - nfc

Constants

KEY_DEFAULT = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
KEY_MIFARE_APPLICATION_DIRECTORY = [0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5]
KEY_NFC_FORUM =[0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7]    

Types

TYPE_CLASSIC = 0
TYPE_PLUS = 1
TYPE_PRO = 2
TYPE_UNKNOWN = -1

get_type

Returns an int: the type of a MifareClassic tag.

NFCTagTechnology_MifareClassic.convert_type_to_string(type)

Returns a string: the named type of a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.convert_type_to_string(type)
type int: the type of a MifareClassic tag.

write_block(index, block)

Writes a block to a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.write_block(index, block)
index integer: the index to where in the tag sector the block will be written.
block a 16 byte array written to the tag.

read_block(index)

Returns a block: a 16 byte array of data read from a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.read_block(index)
index integer: the index to where in the tag sector the block is read from.

get_size

Return the size in bytes of a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.get_size

get_block_count

Return the number of blocks in a MifareClassic tag.

get_sector_count

Returns the sector count in a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.get_block_count

get_blocks_in_sector_count

Returns the number of blocks in a sector of a MifareClassic tag.

Rho::NFCTagTechnology_MifareClassic.get_blocks_in_sector_count(index)
index integer: the index to the tag sector.

sector_to_block

Returns the index of the first block in a sector in a MifareClassic tag. Does not cause any RF activity.

Rho::NFCTagTechnology_MifareClassic.sector_to_block(index)
index integer: the index to the tag sector.

authenticate_sector_with_key_A

Authenticates a sector with a key. Returns true if the authenticate was passed.

Rho::NFCTagTechnology_MifareClassic.authenticate_sector_with_key_A(index, key)
index integer: the index to the tag sector.
key a 6 byte array containing the key.

authenticate_sector_with_key_B

Authenticates a sector with a key. Returns true if the authenticate was passed.

Rho::NFCTagTechnology_MifareClassic.authenticate_sector_with_key_B(index, key)
index integer: the index to the tag sector.
key a 6 byte array containing the key.

transceive

Sends data in a byte array to a tag and returns the result from the tag in a byte array.

Rho::NFCTagTechnology_MifareClassic.transceive(data)
data byte[] sent to the tag.
Back to Top