uFCoder 2.62
Loading...
Searching...
No Matches
NTAG2XX (Type 2) specific commands

Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. More...

Functions

UFR_STATUS DL_API GetNfcT2TVersion (OUT uint8_t lpucVersionResponse[8])
 This function returns 8 bytes of the T2T version.
 
UFR_STATUS DL_API IncrementCounter (uint8_t counter_address, uint32_t inc_value)
 This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family.
 
void DL_API NfcT2TSafeConvertVersion (t2t_version_t *version, const uint8_t *version_record)
 This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion().
 
UFR_STATUS DL_API ReadCounter (uint8_t counter_address, VAR uint32_t *value)
 This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family.
 
UFR_STATUS DL_API ReadNFCCounter (VAR uint32_t *value)
 This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication.
 
UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK (VAR uint32_t *value, IN const uint8_t *key)
 Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”.
 
UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK (VAR uint32_t *value, uint8_t reader_key_index)
 This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”.
 

Detailed Description

Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag.

Function Documentation

◆ GetNfcT2TVersion()

UFR_STATUS DL_API GetNfcT2TVersion ( OUT uint8_t lpucVersionResponse[8])

This function returns 8 bytes of the T2T version.

All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()).

Parameters
lpucVersionResponsearray containing 8 bytes which will receive raw T2T version.
Returns
Operation status

◆ IncrementCounter()

UFR_STATUS DL_API IncrementCounter ( uint8_t counter_address,
uint32_t inc_value )

This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family.

Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter.

Parameters
counter_addressAddress of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space.
inc_valueIncrement value. Only the 3 least significant bytes are relevant.
Returns
Operation status

◆ NfcT2TSafeConvertVersion()

void DL_API NfcT2TSafeConvertVersion ( t2t_version_t * version,
const uint8_t * version_record )

This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion().

All modern T2T chips having same or very similar structure of the T2T version data represented in the uFR API by the structure type t2t_version_t: typedef struct t2t_version_struct { uint8_t header; uint8_t vendor_id; uint8_t product_type; uint8_t product_subtype; uint8_t major_product_version; uint8_t minor_product_version; uint8_t storage_size; uint8_t protocol_type; } t2t_version_t; This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). Conversion done by this function is "alignment safe".

Parameters
versionpointer to the structure of the t2t_version_t type which will receive converted T2T version
version_recordpointer to array containing 8 bytes of the raw T2T version acquired using function GetNfcT2TVersion()

◆ ReadCounter()

UFR_STATUS DL_API ReadCounter ( uint8_t counter_address,
VAR uint32_t * value )

This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family.

Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0.

Parameters
counter_addressAddress of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space.
valuePointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0.
Returns
Operation status

◆ ReadNFCCounter()

UFR_STATUS DL_API ReadNFCCounter ( VAR uint32_t * value)

This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication.

If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR.

Parameters
valuePointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0.
Returns
Operation status

◆ ReadNFCCounterPwdAuth_PK()

UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK ( VAR uint32_t * value,
IN const uint8_t * key )

Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”.

If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR.

Parameters
valuePointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0.
keyointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication.
Returns
Operation status

◆ ReadNFCCounterPwdAuth_RK()

UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK ( VAR uint32_t * value,
uint8_t reader_key_index )

This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”.

If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR.

Parameters
valuePointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0.
reader_key_indexIndex of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31.
Returns
Operation status