Tizen Native API  5.5

API provides access to MIFARE specific I/O operations on a Tag.

Required Header

#include <nfc.h>

Overview

MIFARE Classic is also known as MIFARE Standard.
MIFARE Classic tags are divided into sectors, and each sector is sub-divided into blocks. Block size is always 16 bytes.

MIFARE Classic Mini are 320 bytes (SIZE_MINI), with 5 sectors each of 4 blocks.
MIFARE Classic 1k are 1024 bytes (SIZE_1K), with 16 sectors each of 4 blocks.
MIFARE Classic 2k are 2048 bytes (SIZE_2K), with 32 sectors each of 4 blocks.
MIFARE Classic 4k are 4096 bytes (SIZE_4K). The first 32 sectors contain 4 blocks and the last 8 sectors contain 16 blocks.

MIFARE Classic tags require authentication on a per-sector basis before any other I/O operations on that sector can be performed.
There are two keys per sector, and ACL bits determine what I/O operations are allowed on that sector after authenticating with a key

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_mifare_authenticate_with_keyA (nfc_tag_h tag, int sector_index, unsigned char *auth_key, nfc_mifare_authenticate_with_keyA_completed_cb callback, void *user_data)
 Authenticates a sector with key A.
int nfc_mifare_authenticate_with_keyB (nfc_tag_h tag, int sector_index, unsigned char *auth_key, nfc_mifare_authenticate_with_keyB_completed_cb callback, void *user_data)
 Authenticates a sector with key B.
int nfc_mifare_read_block (nfc_tag_h tag, int block_index, nfc_mifare_read_block_completed_cb callback, void *user_data)
 Reads a 16-byte block.
int nfc_mifare_read_page (nfc_tag_h tag, int page_index, nfc_mifare_read_page_completed_cb callback, void *user_data)
 Reads 4 pages(16 bytes).
int nfc_mifare_write_block (nfc_tag_h tag, int block_index, unsigned char *buffer, int buffer_size, nfc_mifare_write_block_completed_cb callback, void *user_data)
 Writes block (16 byte) of data to the tag at a given block index.
int nfc_mifare_write_page (nfc_tag_h tag, int page_index, unsigned char *buffer, int buffer_size, nfc_mifare_write_page_completed_cb callback, void *user_data)
 Writes a page (4 bytes) of data to the tag at a given page index.
int nfc_mifare_increment (nfc_tag_h tag, int block_index, int value, nfc_mifare_increment_completed_cb callback, void *user_data)
 Increases a value block, storing the result in the temporary block on the tag.
int nfc_mifare_decrement (nfc_tag_h tag, int block_index, int value, nfc_mifare_decrement_completed_cb callback, void *user_data)
 Decreases a value block, storing the result in the temporary block on the tag.
int nfc_mifare_transfer (nfc_tag_h tag, int block_index, nfc_mifare_transfer_completed_cb callback, void *user_data)
 Copies from the temporary block to the specified block.
int nfc_mifare_restore (nfc_tag_h tag, int block_index, nfc_mifare_restore_completed_cb callback, void *user_data)
 Copies from a value block to the temporary block.

Typedefs

typedef void(* nfc_mifare_authenticate_with_keyA_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_authenticate_with_keyA() has completed.
typedef void(* nfc_mifare_authenticate_with_keyB_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_authenticate_with_keyB() has completed.
typedef void(* nfc_mifare_write_block_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_write_block() has completed.
typedef void(* nfc_mifare_write_page_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_write_page() has completed.
typedef void(* nfc_mifare_read_block_completed_cb )(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data)
 Called after nfc_mifare_read_block() has completed.
typedef void(* nfc_mifare_read_page_completed_cb )(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data)
 Called after nfc_mifare_read_page() has completed.
typedef void(* nfc_mifare_increment_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_increment() has completed.
typedef void(* nfc_mifare_decrement_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_decrement() has completed.
typedef void(* nfc_mifare_transfer_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_transfer() has completed.
typedef void(* nfc_mifare_restore_completed_cb )(nfc_error_e result, void *user_data)
 Called after nfc_mifare_restore() has completed.

Typedef Documentation

typedef void(* nfc_mifare_authenticate_with_keyA_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_authenticate_with_keyA() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_authenticate_with_keyA()
[in]user_dataThe user data passed from nfc_mifare_authenticate_with_keyA()
See also:
nfc_mifare_authenticate_with_keyA()
typedef void(* nfc_mifare_authenticate_with_keyB_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_authenticate_with_keyB() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of function call NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_authenticate_with_keyB()
See also:
nfc_mifare_authenticate_with_keyB()
typedef void(* nfc_mifare_decrement_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_decrement() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_decrement() NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_decrement()
See also:
nfc_mifare_decrement()
typedef void(* nfc_mifare_increment_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_increment() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_increment() NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_increment()
See also:
nfc_mifare_increment()
typedef void(* nfc_mifare_read_block_completed_cb)(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data)

Called after nfc_mifare_read_block() has completed.

Since :
2.3.1
Remarks:
The buffer should not be released.
The buffer can be used only in the callback. To use outside, make a copy.
buffer will be automatically destroyed when the callback function returns. (Do not release buffer.)
Parameters:
[in]resultThe result of function call NFC_ERROR_NONE Success
otherwise negative values
[in]bufferThe read buffer
[in]buffer_sizeThe size of buffer in bytes
[in]user_dataThe user data passed from nfc_mifare_read_block()
See also:
nfc_mifare_read_block()
typedef void(* nfc_mifare_read_page_completed_cb)(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data)

Called after nfc_mifare_read_page() has completed.

Since :
2.3.1
Remarks:
The buffer should not be released.
The buffer can be used only in the callback. To use outside, make a copy.
buffer will be automatically destroyed when the callback function returns. (Do not release buffer.)
Parameters:
[in]resultThe result of nfc_mifare_read_page() NFC_ERROR_NONE Success
otherwise negative values
[in]bufferThe read buffer
[in]buffer_sizeThe size of read buffer in bytes
[in]user_dataThe user data passed from nfc_mifare_read_page()
See also:
nfc_mifare_read_page()
typedef void(* nfc_mifare_restore_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_restore() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_restore() NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_restore()
See also:
nfc_mifare_restore()
typedef void(* nfc_mifare_transfer_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_transfer() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_transfer() NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_transfer()
See also:
nfc_mifare_transfer()
typedef void(* nfc_mifare_write_block_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_write_block() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of nfc_mifare_write_block() NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_write_block()
See also:
nfc_mifare_write_block()
typedef void(* nfc_mifare_write_page_completed_cb)(nfc_error_e result, void *user_data)

Called after nfc_mifare_write_page() has completed.

Since :
2.3.1
Parameters:
[in]resultThe result of function call NFC_ERROR_NONE Success
otherwise negative values
[in]user_dataThe user data passed from nfc_mifare_write_page()
See also:
nfc_mifare_write_page()

Function Documentation

int nfc_mifare_authenticate_with_keyA ( nfc_tag_h  tag,
int  sector_index,
unsigned char *  auth_key,
nfc_mifare_authenticate_with_keyA_completed_cb  callback,
void *  user_data 
)

Authenticates a sector with key A.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
I/O operations(read / write / increment / decrement / transfer / restore) will be available after successful authentication.
This function is only available for MIFARE classic.

MIFARE CLASSIC MINI
=> 0 ~ 4 : 5 sectors having 4 block each with block size of 16 bytes

MIFARE CLASSIC 1K
=> 0 ~ 15 : 16 sectors having 4 block each with block size of 16 bytes

MIFARE CLASSIC 4K
=> 0 ~ 31 : 32 sectors having 4 block each with block size of 16 bytes
=> 32 ~ 39 : 8 sectors having 16 block each with block size of 16 bytes
Parameters:
[in]tagThe handle to NFC tag
[in]sector_indexThe index of sector to authenticate with key A, starting from 0
[in]auth_key6-byte authentication key
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_authenticate_with_keyA_completed_cb() when it has completed to authenticate the given sector with key A.
The Callback can receive error code when process is done.
See also:
nfc_mifare_authenticate_with_keyB()
nfc_mifare_read_block()
nfc_mifare_read_page()
nfc_mifare_write_block()
nfc_mifare_write_page()
nfc_mifare_increment()
nfc_mifare_decrement()
nfc_manager_initialize()
int nfc_mifare_authenticate_with_keyB ( nfc_tag_h  tag,
int  sector_index,
unsigned char *  auth_key,
nfc_mifare_authenticate_with_keyB_completed_cb  callback,
void *  user_data 
)

Authenticates a sector with key B.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
I/O operations(read / write / increment / decrement / transfer / restore) will be available after successful authentication.
This function is only available for MIFARE classic.

MIFARE CLASSIC MINI
=> 0 ~ 4 : 5 sector and 4 block with 16 bytes

MIFARE CLASSIC 1K
=> 0 ~ 15 : 16 sector and 4 block with 16 bytes

MIFARE CLASSIC 4K
=> 0 ~ 31 : 32 sector and 4 block with 16 bytes
=> 32 ~ 39 : 8 sector and 16 block with 16 bytes
Parameters:
[in]tagThe handle to NFC tag
[in]sector_indexThe index of sector to authenticate with key B, starting from 0
[in]auth_key6-byte authentication key
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_authenticate_with_keyB_completed_cb() when it has completed to authenticate the given sector with key B.
The Callback can receive error code when process is done.
See also:
nfc_mifare_authenticate_with_keyA()
nfc_mifare_read_block()
nfc_mifare_read_page()
nfc_mifare_write_block()
nfc_mifare_write_page()
nfc_mifare_increment()
nfc_mifare_decrement()
nfc_manager_initialize()
int nfc_mifare_decrement ( nfc_tag_h  tag,
int  block_index,
int  value,
nfc_mifare_decrement_completed_cb  callback,
void *  user_data 
)

Decreases a value block, storing the result in the temporary block on the tag.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe index of block to decrease, starting from 0
[in]valuenon-negative to decrement by
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_decrement_completed_cb() when it has completed to decrement.
The Callback can receive error code when process is done.
See also:
nfc_mifare_increment()
nfc_mifare_write_block()
nfc_manager_initialize()
int nfc_mifare_increment ( nfc_tag_h  tag,
int  block_index,
int  value,
nfc_mifare_increment_completed_cb  callback,
void *  user_data 
)

Increases a value block, storing the result in the temporary block on the tag.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe index of block to increase, starting from 0
[in]valueNon-negative to increment by
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_NOT_INITIALIZEDNot initialized
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_increment_completed_cb() when it has completed to increment.
The Callback can receive error code when process is done.
See also:
nfc_mifare_decrement()
nfc_mifare_write_block()
nfc_manager_initialize()
int nfc_mifare_read_block ( nfc_tag_h  tag,
int  block_index,
nfc_mifare_read_block_completed_cb  callback,
void *  user_data 
)

Reads a 16-byte block.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic.
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe block or starting page number
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_read_block_completed_cb() when it has completed to read a block.
The Callback can receive error code when process is done.
See also:
nfc_mifare_read_page()
nfc_mifare_write_block()
nfc_manager_initialize()
int nfc_mifare_read_page ( nfc_tag_h  tag,
int  page_index,
nfc_mifare_read_page_completed_cb  callback,
void *  user_data 
)

Reads 4 pages(16 bytes).

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE Ultra light.
The MIFARE Ultralight protocol always reads 4 pages at a time, to reduce the number of commands required to read an entire tag.
Parameters:
[in]tagThe handle to NFC tag
[in]page_indexThe index of page to read, starting from 0
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_read_page_completed_cb() when it has completed to read a page.
The Callback can receive error code when process is done.
See also:
nfc_mifare_read_block()
nfc_mifare_write_page()
nfc_manager_initialize()
int nfc_mifare_restore ( nfc_tag_h  tag,
int  block_index,
nfc_mifare_restore_completed_cb  callback,
void *  user_data 
)

Copies from a value block to the temporary block.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe index of block to copy from, starting from 0
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_restore_completed_cb() when it has completed to restore.
The Callback can receive error code when process is done.
See also:
nfc_mifare_transfer()
nfc_manager_initialize()
int nfc_mifare_transfer ( nfc_tag_h  tag,
int  block_index,
nfc_mifare_transfer_completed_cb  callback,
void *  user_data 
)

Copies from the temporary block to the specified block.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe index of block to copy to, starting from 0
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_transfer_completed_cb() when it has completed to transfer.
The Callback can receive error code when process is done.
See also:
nfc_mifare_restore()
nfc_manager_initialize()
int nfc_mifare_write_block ( nfc_tag_h  tag,
int  block_index,
unsigned char *  buffer,
int  buffer_size,
nfc_mifare_write_block_completed_cb  callback,
void *  user_data 
)

Writes block (16 byte) of data to the tag at a given block index.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE classic.
Parameters:
[in]tagThe handle to NFC tag
[in]block_indexThe index of block to read, starting from 0
[in]buffer16 bytes of data to write
[in]buffer_sizeThe size of buffer in bytes
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_NOT_INITIALIZEDNot initialized
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_write_block_completed_cb() when it has completed to write a block.
The Callback can receive error code when process is done.
See also:
nfc_mifare_write_page()
nfc_mifare_read_block()
nfc_manager_initialize()
int nfc_mifare_write_page ( nfc_tag_h  tag,
int  page_index,
unsigned char *  buffer,
int  buffer_size,
nfc_mifare_write_page_completed_cb  callback,
void *  user_data 
)

Writes a page (4 bytes) of data to the tag at a given page index.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/nfc
Remarks:
This function is only available for MIFARE Ultra light
Parameters:
[in]tagThe handle to NFC tag
[in]page_indexThe index of page to write, starting from 0
[in]buffer4 bytes of data to write
[in]buffer_sizeThe size of buffer in bytes
[in]callbackThe callback function to invoke after this function has completed
It can be null if notification is not required
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
NFC_ERROR_NONESuccessful
NFC_ERROR_NOT_SUPPORTEDNot supported NFC
NFC_ERROR_NOT_INITIALIZEDNot initialized NFC
NFC_ERROR_OUT_OF_MEMORYOut of memory
NFC_ERROR_INVALID_PARAMETERInvalid parameter
NFC_ERROR_DEVICE_BUSYDevice is too busy to handle your request
NFC_ERROR_TIMED_OUTTimeout is reached while communicating with tag
NFC_ERROR_NOT_ACTIVATEDNFC is not activated
NFC_ERROR_OPERATION_FAILEDOperation failed
NFC_ERROR_PERMISSION_DENIEDPermission denied
Postcondition:
It invokes nfc_mifare_write_page_completed_cb() when it has completed to write a page.
The Callback can receive error code when process is done.
See also:
nfc_mifare_write_block()
nfc_mifare_read_page()
nfc_manager_initialize()

Variable Documentation

The well-known key for tags formatted according to the MIFARE Application Directory (MAD) specification.

The key is 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5

Since :
2.3.1
const unsigned char NFC_TAG_MIFARE_KEY_DEFAULT[6]

The default factory key.

The key is 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

Since :
2.3.1
const unsigned char NFC_TAG_MIFARE_KEY_NFC_FORUM[6]

The well-known key for tags formatted according to the NDEF on Mifare Classic specification.

The key is 0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7

Since :
2.3.1