hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Data Structures | Macros | Enumerations | Functions
nbt-cmd.h File Reference

Collection of the NBT operational commands. More...

#include "infineon/nbt-apdu-lib.h"
#include "infineon/nbt-apdu.h"
#include "infineon/nbt-parse-response.h"

Go to the source code of this file.

Data Structures

struct  nbt_file_access_policy_t
 Store the file access condition for both NFC and I2C (read/write operation) interface with FileID. More...
 

Macros

#define NBT_AUTHENTICATE_TAG   UINT8_C(0x01)
 Identifier for command authenticate tag.
 
#define NBT_APPLET_VERSION   UINT8_C(0x02)
 Identifier for command get data applet version.
 
#define NBT_AVAILABLE_MEMORY   UINT8_C(0x03)
 Identifier for command get data available memory.
 
#define NBT_CHANGE_PASSWORD   UINT8_C(0x04)
 Identifier for command change password.
 
#define NBT_CREATE_PASSWORD   UINT8_C(0x05)
 Identifier for command create password.
 
#define NBT_DELETE_PASSWORD   UINT8_C(0x06)
 Identifier for command delete password.
 
#define NBT_GET_DATA   UINT8_C(0x07)
 Identifier for command get data.
 
#define NBT_GET_FAP_BYTES   UINT8_C(0x08)
 Identifier for command get FAP bytes.
 
#define NBT_READ_BINARY   UINT8_C(0x09)
 Identifier for command read binary.
 
#define NBT_READ_FAP_WITH_PASSWORD   UINT8_C(0x0A)
 Identifier for command read FAP with password.
 
#define NBT_PARSE_FAP_BYTES   UINT8_C(0x0B)
 Identifier for command parse FAP bytes.
 
#define NBT_PASS_THROUGH_FETCH_DATA   UINT8_C(0x0C)
 Identifier for command pass-through fetch data.
 
#define NBT_PASS_THROUGH_PUT_RESPONSE   UINT8_C(0x0D)
 Identifier for command pass-through put response.
 
#define NBT_SELECT_APPLICATION   UINT8_C(0x0E)
 Identifier for command select AID.
 
#define NBT_SELECT_FILE_BY_ID   UINT8_C(0x0F)
 Identifier for command select file by ID.
 
#define NBT_UNBLOCK_PASSWORD   UINT8_C(0x10)
 Identifier for command unblock password.
 
#define NBT_UPDATE_BINARY   UINT8_C(0x11)
 Identifier for command update binary.
 
#define NBT_UPDATE_FAP_BYTES_WITH_PASSWORD   UINT8_C(0x12)
 Identifier for command update FAP bytes with password.
 
#define NBT_UPDATE_RECURSIVE_BINARY   UINT8_C(0x13)
 Identifier for command recursive update binary.
 
#define NBT_FAP_FILE_ID   UINT16_C(0xE1AF)
 FileID of FAP file.
 
#define NBT_NDEF_FILE_ID   UINT16_C(0xE104)
 FileID of NDEF file.
 
#define NBT_TOTAL_FILE   UINT8_C(0x07)
 Total number of file available in NBT.
 
#define NBT_FAP_ACCESS_CONDITION_LENGTH   UINT8_C(0x06)
 Length of access condition, including FileID, NFC read/write and I2C read/write access condition.
 
#define NBT_FILE_ID_LENGTH   UINT8_C(0x02)
 length of FileID
 
#define NBT_MAX_LE   UINT16_C(0x00FF)
 Constant defines maximum possible LE value.
 
#define NBT_MAX_LC   UINT16_C(0x00FF)
 Constant defines maximum possible LC value.
 
#define NBT_PASSWORD_ID_MASK   UINT8_C(0x1F)
 Masking for access condition byte with password protected.
 
#define NBT_SIZE_OF_FAP_FILE   UINT8_C(0x2A)
 Size of FAP file in bytes.
 
#define NBT_RECURSIVE_READ_INIT_OFFSET   UINT16_C(0x0000)
 Constant defines initial offset value for recursive read binary function.
 
#define NBT_RECURSIVE_UPDATE_INIT_OFFSET   UINT16_C(0x0000)
 Constant defines initial offset value for recursive update binary function.
 
#define NBT_RECURSIVE_READ_INIT_MSG_LEN   UINT8_C(0xFF)
 Constant defines initial LE value for recursive read binary function.
 

Enumerations

enum  nbt_access_condition { NBT_ACCESS_ALWAYS = UINT8_C(0x40) , NBT_ACCESS_NEVER = UINT8_C(0x00) , NBT_ACCESS_PASSWORD_PROTECTED = UINT8_C(0x80) }
 Enumeration defines the access condition of file access policy. More...
 
enum  nbt_bit_mask_for_pass_through_status_word {
  NBT_BIT_MASK_STATE_L4_EXIT = UINT16_C(0x0040) , NBT_BIT_MASK_STATE_L4_ENTRY = UINT16_C(0x0020) , NBT_BIT_MASK_STATE_FIELD_EXIT = UINT16_C(0x0010) , NBT_BIT_MASK_STATE_FIELD_ENTRY ,
  NBT_BIT_MASK_PASS_THROUGH_APDU_AVAILABLE , NBT_BIT_MASK_LAYER_4_ACTIVE , NBT_BIT_MASK_NFC_FIELD_IS_PRESENT =
}
 Enumeration provides the bit masks to verify the status of pass-though status words. More...
 

Functions

ifx_status_t nbt_select_application (nbt_cmd_t *self)
 Selects the NBT application.
 
ifx_status_t nbt_select_file (nbt_cmd_t *self, uint16_t file_id)
 Selects the elementary file (EF) with the FileID.
 
ifx_status_t nbt_select_file_with_password (nbt_cmd_t *self, uint16_t file_id, const ifx_blob_t *read_password, const ifx_blob_t *write_password)
 Selects the elementary file with FileID and read or write password. Note that the status word of the command is not checked by this API.
 
ifx_status_t nbt_read_binary (nbt_cmd_t *self, uint16_t offset, uint8_t binary_data_length)
 Reads the binary data from the currently selected elementary file.
 
ifx_status_t nbt_update_binary (nbt_cmd_t *self, uint16_t offset, uint32_t data_length, const uint8_t *data)
 Updates the binary data into the currently selected elementary file.
 
ifx_status_t nbt_change_password (nbt_cmd_t *self, uint8_t pwd_id, const ifx_blob_t *master_password, const ifx_blob_t *new_password)
 Changes an existing password with a new password. If the FAP file update operation is password protected, the master password is required to change the password.
 
ifx_status_t nbt_unblock_password (nbt_cmd_t *self, uint8_t pwd_id, const ifx_blob_t *master_password)
 Unblocks the password, which is in blocked state because wrong password limit exceeds.
 
ifx_status_t nbt_authenticate_tag (nbt_cmd_t *self, const ifx_blob_t *challenge)
 Issues an authenticate tag command, which generates the signature on the challenge and can be used for brand protection use case in offline mode.
 
ifx_status_t nbt_create_password (nbt_cmd_t *self, const ifx_blob_t *master_password, uint8_t new_password_id, const ifx_blob_t *new_password, uint16_t pwd_resp, uint16_t pwd_limit)
 Creates a new password. If create password command is password-protected then the password to authenticate will be passed in the command data as master password.
 
ifx_status_t nbt_delete_password (nbt_cmd_t *self, const ifx_blob_t *master_password, uint8_t password_id)
 Deletes an existing password, when the FAP file update operation is allowed with ALWAYS access condition, then no need to authenticate with the master password.
 
ifx_status_t nbt_get_data (nbt_cmd_t *self, uint16_t get_data_rcp)
 Issues a get data command to retrieve the NBT application specific information like applet version and available memory. GET_DATA constants that can be passed with an example: get data (TAG_AVAILABLE_MEMORY, TAG_APPLET_VERSION)
 
ifx_status_t nbt_get_data_applet_version (nbt_cmd_t *self, nbt_applet_version_t *applet_version)
 Issues a get data command to retrieve the applet version information.
 
ifx_status_t nbt_get_data_available_memory (nbt_cmd_t *self, nbt_available_memory_t *available_memory)
 Issues a get data command to retrieve the available memory.
 
uint8_t nbt_access_condition_get (nbt_access_condition access_type, const uint8_t *password_id)
 Get the access condition policy byte for NFC read/write and I2C read/write interface password ID as NULL, if nbt_access_condition is ALWAYS and NEVER, otherwise pass valid password ID (0x01 - 0x1F) with nbt_access_condition PASSWORD_PROTECTED.
 
ifx_status_t nbt_update_fap (nbt_cmd_t *self, const nbt_file_access_policy_t *fap_policy)
 Updates file access conditions in FAP file, if FAP file is update always (not password protected).
 
ifx_status_t nbt_update_fap_with_password (nbt_cmd_t *self, const nbt_file_access_policy_t *fap_policy, const ifx_blob_t *master_password)
 Updates file access conditions in FAP file. when FAP file is password protected(optional). If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.
 
ifx_status_t nbt_update_fap_bytes (nbt_cmd_t *self, const ifx_blob_t *policy_bytes)
 Updates file access conditions in FAP file from policy bytes, if FAP file is update always (not password protected).
 
ifx_status_t nbt_update_fap_bytes_with_password (nbt_cmd_t *self, const ifx_blob_t *policy_bytes, const ifx_blob_t *master_password)
 Updates file access conditions in FAP file from policy bytes. When FAP file is password protected (optional). If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.
 
ifx_status_t nbt_parse_fap_bytes (const ifx_blob_t *fap_bytes, uint8_t no_of_fap_policies, nbt_file_access_policy_t *fap_policies)
 Parse response (APDU response type) bytes to array of nbt_file_access_policy_t type object of FAP file.
 
ifx_status_t nbt_read_fap (nbt_cmd_t *self, nbt_file_access_policy_t *fap_policies)
 Reads binary data (fap bytes of elementary files) from FAP file and store the fap bytes into nbt_file_access_policy_t type object array.
 
ifx_status_t nbt_read_fap_with_password (nbt_cmd_t *self, const ifx_blob_t *master_password, nbt_file_access_policy_t *fap_policies)
 Reads binary data (access condition policy bytes of elementary files) from FAP file and store the fap bytes into nbt_file_access_policy_t type object array. If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.
 
ifx_status_t nbt_read_fap_bytes (nbt_cmd_t *self)
 Reads binary data (fap bytes of elementary files) from FAP file.
 
ifx_status_t nbt_read_fap_bytes_with_password (nbt_cmd_t *self, const ifx_blob_t *master_password)
 Reads binary data (fap bytes of elementary files) from FAP file. If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.
 
ifx_status_t nbt_pass_through_fetch_data (nbt_cmd_t *self, ifx_apdu_response_t *response)
 Issues a pass-through fetch data APDU command. This command can be issued from host devices through I2C interfaces.
 
ifx_status_t nbt_pass_through_decode_sw (const ifx_apdu_response_t *response, uint16_t *pass_through_status_word)
 Gets the pass-through status word from the response of pass_through_fetch_data() command.
 
ifx_status_t nbt_pass_through_decode_apdu_bytes (const ifx_apdu_response_t *response, ifx_blob_t *nfc_apdu)
 Gets the pass-through NFC APDU in byte array from the response of pass_through_fetch_data() command.
 
ifx_status_t nbt_pass_through_decode_apdu (const ifx_apdu_response_t *response, ifx_apdu_t *nfc_apdu)
 Gets the pass-through NFC APDU in APDU format from the response of pass_through_fetch_data() command.
 
ifx_status_t nbt_pass_through_put_response (nbt_cmd_t *self, const ifx_apdu_response_t *pass_through_response_data, ifx_apdu_response_t *response)
 Sends the response to pass-through fetch data command, forwarding the response over the NFC interface.
 
ifx_status_t nbt_ndef_read_with_id_password (nbt_cmd_t *self, uint16_t file_id, const ifx_blob_t *read_password)
 Reads NDEF file with password and return the NDEF message byte data. Method performs the select file with password if available and then read binary until data is available in file.
 
ifx_status_t nbt_ndef_read_with_id (nbt_cmd_t *self, uint16_t file_id)
 Reads NDEF file and return the NDEF message byte data. Method performs the select file and then read binary until data is available in file.
 
ifx_status_t nbt_ndef_read_with_password (nbt_cmd_t *self, const ifx_blob_t *read_password)
 Reads NDEF file with password and returns the NDEF message byte data. Method performs the select file with default NDEF FileID (E104) and with optional password and then read binary until data is available in file.
 
ifx_status_t nbt_ndef_read (nbt_cmd_t *self)
 Reads NDEF file with password and returns the NDEF message byte data. Method performs the select file with default NDEF FileID (E104) and then read binary until data is available in file.
 
ifx_status_t nbt_ndef_update_with_id_password (nbt_cmd_t *self, uint16_t file_id, const ifx_blob_t *write_password, ifx_blob_t *ndef_bytes)
 Updates NDEF file with FileID, 4-byte password (Optional). Method performs the select file with file_id and then update binary until data is available.
 
ifx_status_t nbt_ndef_update_with_id (nbt_cmd_t *self, uint16_t file_id, ifx_blob_t *ndef_bytes)
 Updates the NDEF file with FileID. Method performs the select file with file_id and then update binary until data is available.
 
ifx_status_t nbt_ndef_update_with_password (nbt_cmd_t *self, const ifx_blob_t *write_password, ifx_blob_t *ndef_bytes)
 Updates NDEF file with 4-byte password (Optional) and default NDEF file Id (E104). Method performs the select file with file_id and then update binary until data is available.
 
ifx_status_t nbt_ndef_update (nbt_cmd_t *self, ifx_blob_t *ndef_bytes)
 Updates NDEF file default ndef FileID (E104), Method performs the select file with file_id and then update binary until data is available.
 

Detailed Description

Collection of the NBT operational commands.

Definition in file nbt-cmd.h.

Macro Definition Documentation

◆ NBT_APPLET_VERSION

#define NBT_APPLET_VERSION   UINT8_C(0x02)

Identifier for command get data applet version.

Definition at line 29 of file nbt-cmd.h.

◆ NBT_AUTHENTICATE_TAG

#define NBT_AUTHENTICATE_TAG   UINT8_C(0x01)

Identifier for command authenticate tag.

Definition at line 24 of file nbt-cmd.h.

◆ NBT_AVAILABLE_MEMORY

#define NBT_AVAILABLE_MEMORY   UINT8_C(0x03)

Identifier for command get data available memory.

Definition at line 34 of file nbt-cmd.h.

◆ NBT_CHANGE_PASSWORD

#define NBT_CHANGE_PASSWORD   UINT8_C(0x04)

Identifier for command change password.

Definition at line 39 of file nbt-cmd.h.

◆ NBT_CREATE_PASSWORD

#define NBT_CREATE_PASSWORD   UINT8_C(0x05)

Identifier for command create password.

Definition at line 44 of file nbt-cmd.h.

◆ NBT_DELETE_PASSWORD

#define NBT_DELETE_PASSWORD   UINT8_C(0x06)

Identifier for command delete password.

Definition at line 49 of file nbt-cmd.h.

◆ NBT_FAP_ACCESS_CONDITION_LENGTH

#define NBT_FAP_ACCESS_CONDITION_LENGTH   UINT8_C(0x06)

Length of access condition, including FileID, NFC read/write and I2C read/write access condition.

Definition at line 135 of file nbt-cmd.h.

◆ NBT_FAP_FILE_ID

#define NBT_FAP_FILE_ID   UINT16_C(0xE1AF)

FileID of FAP file.

Definition at line 119 of file nbt-cmd.h.

◆ NBT_FILE_ID_LENGTH

#define NBT_FILE_ID_LENGTH   UINT8_C(0x02)

length of FileID

Definition at line 140 of file nbt-cmd.h.

◆ NBT_GET_DATA

#define NBT_GET_DATA   UINT8_C(0x07)

Identifier for command get data.

Definition at line 54 of file nbt-cmd.h.

◆ NBT_GET_FAP_BYTES

#define NBT_GET_FAP_BYTES   UINT8_C(0x08)

Identifier for command get FAP bytes.

Definition at line 59 of file nbt-cmd.h.

◆ NBT_MAX_LC

#define NBT_MAX_LC   UINT16_C(0x00FF)

Constant defines maximum possible LC value.

Definition at line 150 of file nbt-cmd.h.

◆ NBT_MAX_LE

#define NBT_MAX_LE   UINT16_C(0x00FF)

Constant defines maximum possible LE value.

Definition at line 145 of file nbt-cmd.h.

◆ NBT_NDEF_FILE_ID

#define NBT_NDEF_FILE_ID   UINT16_C(0xE104)

FileID of NDEF file.

Definition at line 124 of file nbt-cmd.h.

◆ NBT_PARSE_FAP_BYTES

#define NBT_PARSE_FAP_BYTES   UINT8_C(0x0B)

Identifier for command parse FAP bytes.

Definition at line 74 of file nbt-cmd.h.

◆ NBT_PASS_THROUGH_FETCH_DATA

#define NBT_PASS_THROUGH_FETCH_DATA   UINT8_C(0x0C)

Identifier for command pass-through fetch data.

Definition at line 79 of file nbt-cmd.h.

◆ NBT_PASS_THROUGH_PUT_RESPONSE

#define NBT_PASS_THROUGH_PUT_RESPONSE   UINT8_C(0x0D)

Identifier for command pass-through put response.

Definition at line 84 of file nbt-cmd.h.

◆ NBT_PASSWORD_ID_MASK

#define NBT_PASSWORD_ID_MASK   UINT8_C(0x1F)

Masking for access condition byte with password protected.

Definition at line 155 of file nbt-cmd.h.

◆ NBT_READ_BINARY

#define NBT_READ_BINARY   UINT8_C(0x09)

Identifier for command read binary.

Definition at line 64 of file nbt-cmd.h.

◆ NBT_READ_FAP_WITH_PASSWORD

#define NBT_READ_FAP_WITH_PASSWORD   UINT8_C(0x0A)

Identifier for command read FAP with password.

Definition at line 69 of file nbt-cmd.h.

◆ NBT_RECURSIVE_READ_INIT_MSG_LEN

#define NBT_RECURSIVE_READ_INIT_MSG_LEN   UINT8_C(0xFF)

Constant defines initial LE value for recursive read binary function.

Definition at line 178 of file nbt-cmd.h.

◆ NBT_RECURSIVE_READ_INIT_OFFSET

#define NBT_RECURSIVE_READ_INIT_OFFSET   UINT16_C(0x0000)

Constant defines initial offset value for recursive read binary function.

Definition at line 166 of file nbt-cmd.h.

◆ NBT_RECURSIVE_UPDATE_INIT_OFFSET

#define NBT_RECURSIVE_UPDATE_INIT_OFFSET   UINT16_C(0x0000)

Constant defines initial offset value for recursive update binary function.

Definition at line 172 of file nbt-cmd.h.

◆ NBT_SELECT_APPLICATION

#define NBT_SELECT_APPLICATION   UINT8_C(0x0E)

Identifier for command select AID.

Definition at line 89 of file nbt-cmd.h.

◆ NBT_SELECT_FILE_BY_ID

#define NBT_SELECT_FILE_BY_ID   UINT8_C(0x0F)

Identifier for command select file by ID.

Definition at line 94 of file nbt-cmd.h.

◆ NBT_SIZE_OF_FAP_FILE

#define NBT_SIZE_OF_FAP_FILE   UINT8_C(0x2A)

Size of FAP file in bytes.

Definition at line 160 of file nbt-cmd.h.

◆ NBT_TOTAL_FILE

#define NBT_TOTAL_FILE   UINT8_C(0x07)

Total number of file available in NBT.

Definition at line 129 of file nbt-cmd.h.

◆ NBT_UNBLOCK_PASSWORD

#define NBT_UNBLOCK_PASSWORD   UINT8_C(0x10)

Identifier for command unblock password.

Definition at line 99 of file nbt-cmd.h.

◆ NBT_UPDATE_BINARY

#define NBT_UPDATE_BINARY   UINT8_C(0x11)

Identifier for command update binary.

Definition at line 104 of file nbt-cmd.h.

◆ NBT_UPDATE_FAP_BYTES_WITH_PASSWORD

#define NBT_UPDATE_FAP_BYTES_WITH_PASSWORD   UINT8_C(0x12)

Identifier for command update FAP bytes with password.

Definition at line 109 of file nbt-cmd.h.

◆ NBT_UPDATE_RECURSIVE_BINARY

#define NBT_UPDATE_RECURSIVE_BINARY   UINT8_C(0x13)

Identifier for command recursive update binary.

Definition at line 114 of file nbt-cmd.h.

Enumeration Type Documentation

◆ nbt_access_condition

Enumeration defines the access condition of file access policy.

Enumerator
NBT_ACCESS_ALWAYS 

No password verification is required, if the file is configured with ALWAYS access condition.

NBT_ACCESS_NEVER 

Access is not allowed to the file, if file is configured with NEVER access condition.

NBT_ACCESS_PASSWORD_PROTECTED 

Access is allowed only after password verification, if the file is configured with PASSWORD_PROTECTED access condition. This config byte has to be appended with password ID (5 bits).

Definition at line 219 of file nbt-cmd.h.

220{
225 NBT_ACCESS_ALWAYS = UINT8_C(0x40),
226
231 NBT_ACCESS_NEVER = UINT8_C(0x00),
232
238 NBT_ACCESS_PASSWORD_PROTECTED = UINT8_C(0x80)
nbt_access_condition
Enumeration defines the access condition of file access policy.
Definition nbt-cmd.h:220
@ NBT_ACCESS_NEVER
Access is not allowed to the file, if file is configured with NEVER access condition.
Definition nbt-cmd.h:231
@ NBT_ACCESS_ALWAYS
No password verification is required, if the file is configured with ALWAYS access condition.
Definition nbt-cmd.h:225
@ NBT_ACCESS_PASSWORD_PROTECTED
Access is allowed only after password verification, if the file is configured with PASSWORD_PROTECTED...
Definition nbt-cmd.h:238

◆ nbt_bit_mask_for_pass_through_status_word

Enumeration provides the bit masks to verify the status of pass-though status words.

Note
Use the output pass_through_status_word parameter of get_pt_fetch_data_response_pt_sw() API.
Enumerator
NBT_BIT_MASK_STATE_L4_EXIT 

State L4 exit since last status bit field retrieval by host(1) / No change(0)

NBT_BIT_MASK_STATE_L4_ENTRY 

State L4 exit since last status bit field retrieval by host(1) / No change(0)

NBT_BIT_MASK_STATE_FIELD_EXIT 

State L4 exit since last status bit field retrieval by host(1) / No change(0)

NBT_BIT_MASK_STATE_FIELD_ENTRY 

State L4 exit since last status bit field retrieval by host(1) / No change(0)

NBT_BIT_MASK_PASS_THROUGH_APDU_AVAILABLE 

NFC APDU Available(1) / Not available(0)

NBT_BIT_MASK_LAYER_4_ACTIVE 

Layer 4 Active(1) / inactive(0)

NBT_BIT_MASK_NFC_FIELD_IS_PRESENT 

NFC field present(1) / off(0)

Definition at line 247 of file nbt-cmd.h.

248{
249 NBT_BIT_MASK_STATE_L4_EXIT = UINT16_C(0x0040),
252 NBT_BIT_MASK_STATE_L4_ENTRY = UINT16_C(0x0020),
255 NBT_BIT_MASK_STATE_FIELD_EXIT = UINT16_C(0x0010),
259 UINT16_C(0x0008),
263 UINT16_C(0x0004),
266 UINT16_C(0x0002),
269 UINT16_C(0x0001)
nbt_bit_mask_for_pass_through_status_word
Enumeration provides the bit masks to verify the status of pass-though status words.
Definition nbt-cmd.h:248
@ NBT_BIT_MASK_STATE_FIELD_ENTRY
Definition nbt-cmd.h:258
@ NBT_BIT_MASK_STATE_L4_ENTRY
Definition nbt-cmd.h:252
@ NBT_BIT_MASK_NFC_FIELD_IS_PRESENT
Definition nbt-cmd.h:268
@ NBT_BIT_MASK_STATE_L4_EXIT
Definition nbt-cmd.h:249
@ NBT_BIT_MASK_PASS_THROUGH_APDU_AVAILABLE
Definition nbt-cmd.h:262
@ NBT_BIT_MASK_LAYER_4_ACTIVE
Definition nbt-cmd.h:265
@ NBT_BIT_MASK_STATE_FIELD_EXIT
Definition nbt-cmd.h:255

Function Documentation

◆ nbt_access_condition_get()

uint8_t nbt_access_condition_get ( nbt_access_condition access_type,
const uint8_t * password_id )

Get the access condition policy byte for NFC read/write and I2C read/write interface password ID as NULL, if nbt_access_condition is ALWAYS and NEVER, otherwise pass valid password ID (0x01 - 0x1F) with nbt_access_condition PASSWORD_PROTECTED.

Parameters
access_typeAccess_condition type object (ALWAYS, NEVER_ACCESS and PASSWORD_PROTECTED)
password_idPointer to store password ID
Returns
uint8_t Returns a valid access byte, if password_id is NULL and nbt_access_condition is ALWAYS, NEVER_ACCESS return valid access byte, if password_id (0x01 - 0x0F) and nbt_access_condition is PASSWORD_PROTECTED return invalid access byte (0x80), if password_id is NULL & nbt_access_condition is PASSWORD_PROTECTED.

◆ nbt_authenticate_tag()

ifx_status_t nbt_authenticate_tag ( nbt_cmd_t * self,
const ifx_blob_t * challenge )

Issues an authenticate tag command, which generates the signature on the challenge and can be used for brand protection use case in offline mode.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]challengeInstance holds challenge data.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_change_password()

ifx_status_t nbt_change_password ( nbt_cmd_t * self,
uint8_t pwd_id,
const ifx_blob_t * master_password,
const ifx_blob_t * new_password )

Changes an existing password with a new password. If the FAP file update operation is password protected, the master password is required to change the password.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]pwd_id5-bit password ID (Between 01 to 1F).
[in]master_passwordMaster password for verification. Required if this password is used with password-protected access condition (Optional).
[in]new_passwordNew password to be changed.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_create_password()

ifx_status_t nbt_create_password ( nbt_cmd_t * self,
const ifx_blob_t * master_password,
uint8_t new_password_id,
const ifx_blob_t * new_password,
uint16_t pwd_resp,
uint16_t pwd_limit )

Creates a new password. If create password command is password-protected then the password to authenticate will be passed in the command data as master password.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]master_passwordMaster password for verification. Required if this password is already used with password-protected access condition (Optional).
[in]new_password_id5-bits password ID (Between 01 to 1F).
[in]new_passwordPassword value to be updated.
[in]pwd_resp2-bytes success response, which will be sent on successful password verification.
[in]pwd_limit2-bytes password retry limit (Between 0001 to 007F). if limit set to FFFF, applet will treat this as an infinite try limit.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_delete_password()

ifx_status_t nbt_delete_password ( nbt_cmd_t * self,
const ifx_blob_t * master_password,
uint8_t password_id )

Deletes an existing password, when the FAP file update operation is allowed with ALWAYS access condition, then no need to authenticate with the master password.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]master_passwordMaster password for verification. Required if this password is already used with password-protected access condition (Optional).
[in]password_idOffset value for p2 is 5-bit password ID (Between 01 to 1F).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_get_data()

ifx_status_t nbt_get_data ( nbt_cmd_t * self,
uint16_t get_data_rcp )

Issues a get data command to retrieve the NBT application specific information like applet version and available memory. GET_DATA constants that can be passed with an example: get data (TAG_AVAILABLE_MEMORY, TAG_APPLET_VERSION)

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]get_data_rcpget data reference control parameters.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_get_data_applet_version()

ifx_status_t nbt_get_data_applet_version ( nbt_cmd_t * self,
nbt_applet_version_t * applet_version )

Issues a get data command to retrieve the applet version information.

Parameters
[in,out]selfCommand set with communication protocol and response.
[out]applet_versionBuffer to store applet version.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_get_data_available_memory()

ifx_status_t nbt_get_data_available_memory ( nbt_cmd_t * self,
nbt_available_memory_t * available_memory )

Issues a get data command to retrieve the available memory.

Parameters
[in,out]selfCommand set with communication protocol and response.
[out]available_memoryBuffer to store available memory.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_read()

ifx_status_t nbt_ndef_read ( nbt_cmd_t * self)

Reads NDEF file with password and returns the NDEF message byte data. Method performs the select file with default NDEF FileID (E104) and then read binary until data is available in file.

Note: Application must be selected already with selectApplication() API before use this API

Note: application must be selected already with selectApplication() API before use this API

Parameters
[in,out]selfCommand set with communication protocol and response.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_read_with_id()

ifx_status_t nbt_ndef_read_with_id ( nbt_cmd_t * self,
uint16_t file_id )

Reads NDEF file and return the NDEF message byte data. Method performs the select file and then read binary until data is available in file.

Note: Application must be selected already with selectApplication() API before use this API.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an EF file.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_read_with_id_password()

ifx_status_t nbt_ndef_read_with_id_password ( nbt_cmd_t * self,
uint16_t file_id,
const ifx_blob_t * read_password )

Reads NDEF file with password and return the NDEF message byte data. Method performs the select file with password if available and then read binary until data is available in file.

Note: Application must be selected already with selectApplication() API before use this API.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an NDEF file.
[in]read_password4-byte password for read operation (Optional- Null if not required).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_read_with_password()

ifx_status_t nbt_ndef_read_with_password ( nbt_cmd_t * self,
const ifx_blob_t * read_password )

Reads NDEF file with password and returns the NDEF message byte data. Method performs the select file with default NDEF FileID (E104) and with optional password and then read binary until data is available in file.

Note: Application must be selected already with selectApplication() API before use this API.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]read_password4-byte password for read operation (Optional- Null if not required).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_update()

ifx_status_t nbt_ndef_update ( nbt_cmd_t * self,
ifx_blob_t * ndef_bytes )

Updates NDEF file default ndef FileID (E104), Method performs the select file with file_id and then update binary until data is available.

Note
: Application must be selected already with selectApplication() API before use this API
Parameters
[in,out]selfCommand set with communication protocol and response.
[in]ndef_bytesNDEF message to be updated
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_update_with_id()

ifx_status_t nbt_ndef_update_with_id ( nbt_cmd_t * self,
uint16_t file_id,
ifx_blob_t * ndef_bytes )

Updates the NDEF file with FileID. Method performs the select file with file_id and then update binary until data is available.

Note: application must be selected already with selectApplication() API before use this API

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an EF file.
[in]ndef_bytesNDEF message to be updated
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_update_with_id_password()

ifx_status_t nbt_ndef_update_with_id_password ( nbt_cmd_t * self,
uint16_t file_id,
const ifx_blob_t * write_password,
ifx_blob_t * ndef_bytes )

Updates NDEF file with FileID, 4-byte password (Optional). Method performs the select file with file_id and then update binary until data is available.

Note: Application must be selected already with selectApplication() API before use this API

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an EF file.
[in]write_password4-byte password for write operation (Optional- Null if not required)
[in]ndef_bytesData to be write
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_ndef_update_with_password()

ifx_status_t nbt_ndef_update_with_password ( nbt_cmd_t * self,
const ifx_blob_t * write_password,
ifx_blob_t * ndef_bytes )

Updates NDEF file with 4-byte password (Optional) and default NDEF file Id (E104). Method performs the select file with file_id and then update binary until data is available.

Note: Application must be selected already with selectApplication() API before use this API.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]write_password4-byte password for write operation (Optional- Null if not required)
[in]ndef_bytesNDEF message to be updated
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_parse_fap_bytes()

ifx_status_t nbt_parse_fap_bytes ( const ifx_blob_t * fap_bytes,
uint8_t no_of_fap_policies,
nbt_file_access_policy_t * fap_policies )

Parse response (APDU response type) bytes to array of nbt_file_access_policy_t type object of FAP file.

Note
:Memory should be allocated allocated for the 'fap_policies' array parameter externally before passing to function. Example: nbt_file_access_policy_t policies[7]; // 7 => NBT_TOTAL_FILES NBT_TOTAL_FILES
Parameters
[in]fap_bytesPointer to ifx_blob_t handler to store fap bytes Format of FAP:<FileID (2B)> <Config byte for I2C read(1B)> <Config byte for I2C write(1B)> <Config byte for NFC read(1B)> <Config byte for NFC write(1B)>
[in]no_of_fap_policiesNumber of fap policies (nbt_file_access_policy_t object type) that's to be parsed. Make sure memory should be allocated for nbt_file_access_policy_t object (0x00 < no_of_fap_policies <= NBT_TOTAL_FILE(7))
[out]fap_policiesPointer to nbt_file_access_policy_t handler to store store fap file access conditions for I2C and NFC interface along with FileID.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If successful
IFX_ILLEGAL_ARGUMENT: If function parameter is NULL or no_of_fap_policies is zero
NBT_FAP_PARSE_ERROR: If expected(NBT_FAP_ACCESS_CONDITION_LENGTH(6 bytes))fap bytes is not available

◆ nbt_pass_through_decode_apdu()

ifx_status_t nbt_pass_through_decode_apdu ( const ifx_apdu_response_t * response,
ifx_apdu_t * nfc_apdu )

Gets the pass-through NFC APDU in APDU format from the response of pass_through_fetch_data() command.

Note
This API can be called only after pass_through_fetch_data() is called. This is a helper function to decode the response of pass_through_fetch_data() command
Parameters
[in]responseAPDU response of pass_through_fetch_data() command
[out]nfc_apduNFC APDU data in APDU format
Returns
ifx_status_t
Return values
IFX_SUCCESS: If pass-through NFC APDU data is retrieved successfully
INVALID_ARGUMENT: If input argument is invalid that is NULL input parameter
NFC_APDU_IS_NOT_AVAILABLE: If response does not contain NFC APDU data IFX_OUT_OF_MEMORY if memory allocation fails

◆ nbt_pass_through_decode_apdu_bytes()

ifx_status_t nbt_pass_through_decode_apdu_bytes ( const ifx_apdu_response_t * response,
ifx_blob_t * nfc_apdu )

Gets the pass-through NFC APDU in byte array from the response of pass_through_fetch_data() command.

Note
This API can be called only after pass_through_fetch_data() is called. This is a helper function to decode the response of pass_through_fetch_data() command
Parameters
[in]responseAPDU response of pass_through_fetch_data() command
[out]nfc_apduNFC APDU data in byte array
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_pass_through_decode_sw()

ifx_status_t nbt_pass_through_decode_sw ( const ifx_apdu_response_t * response,
uint16_t * pass_through_status_word )

Gets the pass-through status word from the response of pass_through_fetch_data() command.

Note
This API can be called only after pass_through_fetch_data() is called. This is a helper function to decode the response of pass_through_fetch_data() command
Parameters
[in]responseAPDU response of pass_through_fetch_data() command
[out]pass_through_status_wordpass-through status word - this status word can be further decoded using nbt_bit_mask_for_pass_through_status_word enumeration
Returns
ifx_status_t
Return values
IFX_SUCCESS: If pass-through status word is retrieved successfully
INVALID_ARGUMENT: If input argument is invalid that is NULL input parameter

◆ nbt_pass_through_fetch_data()

ifx_status_t nbt_pass_through_fetch_data ( nbt_cmd_t * self,
ifx_apdu_response_t * response )

Issues a pass-through fetch data APDU command. This command can be issued from host devices through I2C interfaces.

This command can be used in NFC-I2C pass-through communication mode to fetch the NFC interface-specific status information concatenated with the NFC received APDU over the I2C interface. When the NFC-I2C pass-through communication mode is not active or the NFC APDU is received only the NFC interface-specific status information is returned. This command is limited to the I2C communication interface.

Parameters
[in,out]selfCommand set with communication protocol.
[out]responseBuffer to store response data
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_pass_through_put_response()

ifx_status_t nbt_pass_through_put_response ( nbt_cmd_t * self,
const ifx_apdu_response_t * pass_through_response_data,
ifx_apdu_response_t * response )

Sends the response to pass-through fetch data command, forwarding the response over the NFC interface.

Note
This command is limited to the I2C communication interface. The command can only be executed after entering PT-Mode and the execution of the PT Fetch command. Otherwise an Exception is returned

The Pass-through put response APDU has a proprietary format. The data section of pass_through_response_data must include the response to be forwarded over the NFC communication, including the status word SW1 and SW2. The Data field must contain at least the status word (2 bytes) meant to be sent over the NFC interface.

Parameters
[in]selfCommand set with communication protocol.
[in]pass_through_response_dataResponse to PT fetch command,including SW
[out]responseBuffer to store response data
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_read_binary()

ifx_status_t nbt_read_binary ( nbt_cmd_t * self,
uint16_t offset,
uint8_t binary_data_length )

Reads the binary data from the currently selected elementary file.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]offsetOffset to read data from file
[in]binary_data_lengthData length to be read from file.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_read_fap()

ifx_status_t nbt_read_fap ( nbt_cmd_t * self,
nbt_file_access_policy_t * fap_policies )

Reads binary data (fap bytes of elementary files) from FAP file and store the fap bytes into nbt_file_access_policy_t type object array.

Note
:Memory :Memory should be allocated for the 'fap_policies' array parameter externally passing to this function. Example: nbt_file_access_policy_t policies[7]; // 7 => // 7 => NBT_TOTAL_FILES.
Parameters
[in,out]selfCommand set with communication protocol and response.
[out]fap_policiesPointer to nbt_file_access_policy_t handler to store fap file access conditions for I2C and NFC interface
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_read_fap_bytes()

ifx_status_t nbt_read_fap_bytes ( nbt_cmd_t * self)

Reads binary data (fap bytes of elementary files) from FAP file.

Parameters
[in,out]selfCommand set with communication protocol and response.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_read_fap_bytes_with_password()

ifx_status_t nbt_read_fap_bytes_with_password ( nbt_cmd_t * self,
const ifx_blob_t * master_password )

Reads binary data (fap bytes of elementary files) from FAP file. If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]master_passwordPointer to ifx_blob_t handler to store FAP file write write password(4 bytes), if FAP file write operation is password protected(optional).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_read_fap_with_password()

ifx_status_t nbt_read_fap_with_password ( nbt_cmd_t * self,
const ifx_blob_t * master_password,
nbt_file_access_policy_t * fap_policies )

Reads binary data (access condition policy bytes of elementary files) from FAP file and store the fap bytes into nbt_file_access_policy_t type object array. If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.

Note
:Memory should be allocated for the 'fap_policies' array parameter externally before passing to this function. Example: nbt_file_access_policy_t policies[7]; // 7 => NBT_TOTAL_FILES.
Parameters
[in,out]selfCommand set with communication protocol and response.
[in]master_passwordPointer to ifx_blob_t handler to store FAP file write write password(4 bytes), if FAP file write operation is password protected(optional)
[out]fap_policiesPointer to nbt_file_access_policy_t handler to store fap file access conditions for I2C and NFC interface
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_select_application()

ifx_status_t nbt_select_application ( nbt_cmd_t * self)

Selects the NBT application.

Parameters
[in,out]selfCommand set with communication protocol and response.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_select_file()

ifx_status_t nbt_select_file ( nbt_cmd_t * self,
uint16_t file_id )

Selects the elementary file (EF) with the FileID.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an EF file.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_select_file_with_password()

ifx_status_t nbt_select_file_with_password ( nbt_cmd_t * self,
uint16_t file_id,
const ifx_blob_t * read_password,
const ifx_blob_t * write_password )

Selects the elementary file with FileID and read or write password. Note that the status word of the command is not checked by this API.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]file_idFileID to select an EF file.
[in]read_passwordBlob_t 4-byte password for read operation (Optional)
[in]write_passwordBlob_t 4-byte password for write operation (Optional)
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_unblock_password()

ifx_status_t nbt_unblock_password ( nbt_cmd_t * self,
uint8_t pwd_id,
const ifx_blob_t * master_password )

Unblocks the password, which is in blocked state because wrong password limit exceeds.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]pwd_id5-bit password ID (Between 01 to 1F).
[in]master_passwordMaster password for verification. Required if this password is used with password-protected access condition (Optional).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_update_binary()

ifx_status_t nbt_update_binary ( nbt_cmd_t * self,
uint16_t offset,
uint32_t data_length,
const uint8_t * data )

Updates the binary data into the currently selected elementary file.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]offsetOffset from where data to be updated in file.
[in]data_lengthLength of the data to be updated in the file.
[in]dataPointer to the data to be updated in the file.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_update_fap()

ifx_status_t nbt_update_fap ( nbt_cmd_t * self,
const nbt_file_access_policy_t * fap_policy )

Updates file access conditions in FAP file, if FAP file is update always (not password protected).

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]fap_policyPointer to nbt_file_access_policy_t handler to store FAP file access conditions for I2C and NGC interface.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_update_fap_bytes()

ifx_status_t nbt_update_fap_bytes ( nbt_cmd_t * self,
const ifx_blob_t * policy_bytes )

Updates file access conditions in FAP file from policy bytes, if FAP file is update always (not password protected).

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]policy_bytesPointer to ifx_blob_t handler to store access condition for I2C and NFC read/write operation along with FileID.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_update_fap_bytes_with_password()

ifx_status_t nbt_update_fap_bytes_with_password ( nbt_cmd_t * self,
const ifx_blob_t * policy_bytes,
const ifx_blob_t * master_password )

Updates file access conditions in FAP file from policy bytes. When FAP file is password protected (optional). If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]policy_bytesPointer to ifx_blob_t handler to store access condition for I2C and NFC read/write operation along with FileID.
[in]master_passwordPointer to ifx_blob_t handler to store FAP file write write password(4 bytes), if FAP file write operation is password protected(optional).
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_update_fap_with_password()

ifx_status_t nbt_update_fap_with_password ( nbt_cmd_t * self,
const nbt_file_access_policy_t * fap_policy,
const ifx_blob_t * master_password )

Updates file access conditions in FAP file. when FAP file is password protected(optional). If FAP file is not password protected, then no need to authenticate with the master password, pass the master password as NULL.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]fap_policyPointer to nbt_file_access_policy_t handler to store fap file access conditions for I2C and NFC interface
[in]master_passwordPointer to ifx_blob_t handler to store FAP file master master password(4 bytes), if FAP file is password protected(optional)
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails