Message API provides functions to create NDEF message and insert/remove records in NDEF message.
Required Header
#include <nfc.h>
Overview
The NDEF message api provides functions to make NDEF message
- create / destroy NDEF message
- insert / remove NDEF record
- get NDEF record from NDEF message
Related Features
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions |
int | nfc_ndef_message_create (nfc_ndef_message_h *ndef_message) |
| Creates NDEF message handle.
|
int | nfc_ndef_message_create_from_rawdata (nfc_ndef_message_h *ndef_message, const unsigned char *rawdata, unsigned int rawdata_size) |
| Creates NDEF message handle from raw serial bytes.
|
int | nfc_ndef_message_destroy (nfc_ndef_message_h ndef_message) |
| Destroys NDEF message handle.
|
int | nfc_ndef_message_get_record_count (nfc_ndef_message_h ndef_message, int *count) |
| Gets the number of record in NDEF message.
|
int | nfc_ndef_message_get_rawdata (nfc_ndef_message_h ndef_message, unsigned char **rawdata, unsigned int *rawdata_size) |
| Gets serial bytes array of NDEF message.
|
int | nfc_ndef_message_append_record (nfc_ndef_message_h ndef_message, nfc_ndef_record_h record) |
| Appends a record into NDEF message.
|
int | nfc_ndef_message_insert_record (nfc_ndef_message_h ndef_message, int index, nfc_ndef_record_h record) |
| Inserts a record at index into NDEF message.
|
int | nfc_ndef_message_remove_record (nfc_ndef_message_h ndef_message, int index) |
| Removes the record that indicated by index number and this deleted record will be freed.
|
int | nfc_ndef_message_get_record (nfc_ndef_message_h ndef_message, int index, nfc_ndef_record_h *record) |
| Gets record by index.
|
Typedefs |
typedef struct _ndef_message_s * | nfc_ndef_message_h |
| The handle to the NDEF message.
|
Typedef Documentation
The handle to the NDEF message.
- Since :
- 2.3
Function Documentation
Gets serial bytes array of NDEF message.
- Since :
- 2.3
- Parameters:
-
[in] | ndef_message | The handle to NDEF message |
[out] | rawdata | The bytes array of bytes array |
[out] | rawdata_size | The size of bytes array in byte |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- nfc_ndef_message_create_from_rawdata()
-
nfc_manager_initialize()
Gets record by index.
- Since :
- 2.3
- Parameters:
-
[in] | ndef_message | The handle to NDEF message |
[in] | index | The index of record ( starts from 0 ) |
[out] | record | The handle to record |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- nfc_manager_initialize()
Gets the number of record in NDEF message.
- Since :
- 2.3
- Parameters:
-
[in] | ndef_message | The handle to NDEF message |
[out] | count | The number of record |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- nfc_manager_initialize()