nfc_get_sp_title()

Return the text and language set inside a smart poster title record.

Synopsis:

#include <nfc/nfc_ndef.h>
 
NFC_API nfc_result_t nfc_get_sp_title(const nfc_ndef_record_t *sp_rec, const char *req_lang, char **utf_title, char **found_lang, nfc_ndef_rtd_encoding_t *title_encoding, bool return_any)

Since:

BlackBerry 10.0.0

Arguments:

sp_rec

The smart poster record containing the embedded title record in its payload. Chunked NDEF records are not supported.

req_lang

The full or partial language to search for. The match compares all available title records languages with the length of the language string specified. For example, a search on "en" will match either "en" or "en-US". The current locale is used when this argument is set to NULL.

utf_title

The returned allocated null-terminated title string encoded in either UTF-8 or UTF-16 format. This string must be deallocated by calling the free() function.

found_lang

The returned allocated null-terminated two or five byte language locale code. This string must be deallocated by calling the free() function.

title_encoding

A pointer to the encoding used for the title argument.

return_any

A flag that specifies whether to return the first title record when no matches are found. When set to true, the first title record that is found is returned when no matches are found. When set to false, no value is returned.

Library:

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

Description:

This function returns, if available, the data associated with the requested title record embedded inside the smart poster NDEF record payload.

Returns:

NFC_RESULT_SUCCESS; otherwise NFC_RESULT_INVALID_PARAMETER to indicate that a parameter is invalid, or that the provided NDEF record is chunked.