nfc_get_sp_media_data()

Retrieve the data associated with a specific smart poster media or icon record.

Synopsis:

#include <nfc/nfc_ndef.h>
 
NFC_API nfc_result_t nfc_get_sp_media_data(const nfc_ndef_record_t *sp_rec, unsigned int index, char **mime_type, uchar_t **data, size_t *data_length)

Since:

BlackBerry 10.0.0

Arguments:

sp_rec

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

index

The index of the record found from 0 to the value from nfc_get_sp_media_count() minus 1. Values outside this range returns NFC_RESULT_INVALID_PARAMETER.

mime_type

The returned allocated null-terminated mime type. This string must be de-allocated by calling free().

data

The returned allocated media data. This string must be de-allocated by calling the free() function.

data_length

The length of the data buffer.

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 media record embedded inside the smart poster NDEF record payload.

Returns:

NFC_RESULT_SUCCESS, or one of the following: