hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
nbt-parse-response.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2024-2026 Infineon Technologies AG
2// SPDX-License-Identifier: MIT
3
8#ifndef NBT_PARSE_RESPONSE_H
9#define NBT_PARSE_RESPONSE_H
10
11#include "infineon/ifx-apdu.h"
12#include "infineon/ifx-utils.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/* Function identifier */
20
24#define NBT_GET_DATA_RESP_PARSER UINT8_C(0x01)
25
29#define NBT_GET_DATA_MEMORY_RESP_HEADER_LEN UINT8_C(0x05)
30
34#define NBT_LENGTH_TLV UINT8_C(0x04)
35
39#define NBT_GET_DATA_DEFAULT_RESP_TAG UINT8_C(0x6F)
40
44#define NBT_TAG_DEFAULT_GET_DATA UINT8_C(0xDF)
45
49#define NBT_TAG_APPLET_VERSION UINT8_C(0x3A)
50
54#define NBT_TAG_AVAILABLE_MEMORY UINT8_C(0x3B)
55
59#define NBT_LEN_FILE_CONTROL_INFO UINT8_C(0x07)
60
64#define NBT_LEN_APPLET_VERSION UINT8_C(0x04)
65
69#define NBT_LEN_AVAILABLE_MEMORY_INFO UINT8_C(0x0F)
70
74#define NBT_LEN_AVAILABLE_MEMORY UINT8_C(0x0C)
75
79#define NBT_GET_DATA_TLV_LEN_VALUE UINT8_C(0x02)
80
84#define NBT_GET_DATA_TAG_AVAILABLE_NVM_MEMORY UINT8_C(0xC6)
85
89#define NBT_GET_DATA_TAG_AVAILABLE_TRANSIENT_COR UINT8_C(0xC7)
90
94#define NBT_GET_DATA_TAG_AVAILABLE_TRANSIENT_COD UINT8_C(0xC8)
95
99typedef struct
100{
105
110
116
120typedef struct
121{
126
131
137
152 nbt_applet_version_t *applet_version);
153
167 const ifx_apdu_response_t *response,
168 nbt_available_memory_t *available_memory);
169
170#ifdef __cplusplus
171}
172
173#endif /* __cplusplus */
174#endif /* NBT_PARSE_RESPONSE_H */
APDU (response) en-/decoding utility.
uint32_t ifx_status_t
Custom return code type used by all Infineon host software libraries.
Definition ifx-error.h:91
Provides utility functions and macros.
Provides the library and module identifiers code of the library.
ifx_status_t nbt_parse_available_memory(const ifx_apdu_response_t *response, nbt_available_memory_t *available_memory)
Gets the response data and returns the available memory.
ifx_status_t nbt_parse_applet_version(const ifx_apdu_response_t *response, nbt_applet_version_t *applet_version)
Gets the response data and returns the applet version.
Data storage struct for APDU response information.
Definition ifx-apdu.h:130
Structure for the applet version.
uint8_t version_minor
Stores the minor version.
uint16_t version_build_number
Stores the build number.
uint8_t version_major
Stores the major version.
Structure for the available memory.
uint16_t clear_on_deselect
Stores available transient of clear on deselect (COD) type.
uint16_t clear_on_reset
Stores available transient of clear on reset (COR) type.
uint16_t available_memory_size
Stores available persistent or NVM memory.