nfc_get_tag_id()

Retrieve the ID associated with the tag.

Synopsis:

#include <nfc/nfc.h>
 
NFC_API nfc_result_t nfc_get_tag_id(const nfc_target_t *target, uchar_t *id, size_t max_id_length, size_t *id_length)

Since:

BlackBerry 10.0.0

Arguments:

target

The NFC target returned from the nfc_get_target() function.

id

A pointer to a preallocated buffer to return the identifier.

max_id_length

The length of the preallocated buffer.

id_length

The length of the returned ID copied into the id buffer.

Library:

libnfc (For the qcc command, use the -l nfc option to link against this library)

Description:

This function returns the ID associated with the tag.

Whether a tag ID is returned depends on the following three factors:
  • the connection type (ISO14443-3, ISO14443-4, NDEF, ISO15693-3, or ISO18092)
  • the tag variant (Topaz, MIFARE UL, MIFARE UL C, Jewel, etc.)
  • the feature set (feature set 1 or feature set 2)
If the tag ID is not provided in the combination of the factors, the function returns NFC_RESULT_SUCCESS and sets id_length to zero.

Returns:

NFC_RESULT_SUCCESS, or NFC_RESULT_INVALID_PARAMETER, which indicates that an invalid argument was passed to the function.

Last modified: 2015-04-16



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus