hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
ifx-apdu-protocol.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 IFX_APDU_PROTOCOL_H
9#define IFX_APDU_PROTOCOL_H
10
11#include "infineon/ifx-apdu.h"
12#include "infineon/ifx-logger.h"
14
49#ifdef IFX_APDU_PROTOCOL_LOG_ENABLE
50#define IFX_APDU_PROTOCOL_LOG(logger_object, source_information, logger_level, \
51 formatter, ...) \
52 ifx_logger_log(logger_object, source_information, logger_level, formatter, \
53 ##__VA_ARGS__)
54#define IFX_APDU_PROTOCOL_LOG_BYTES(logger_object, source_information, \
55 logger_level, delimeter_1, data, data_len, \
56 delimeter_2) \
57 ifx_logger_log_bytes(logger_object, source_information, logger_level, \
58 delimeter_1, data, data_len, delimeter_2)
59#else
60#define IFX_APDU_PROTOCOL_LOG(logger_object, source_information, logger_level, \
61 formatter, ...)
62
63#define IFX_APDU_PROTOCOL_LOG_BYTES(logger_object, source_information, \
64 logger_level, delimeter_1, data, data_len, \
65 delimeter_2)
66
67#endif
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
76#define LIB_APDU_PROTOCOL UINT8_C(0x28)
77
81#define IFX_APDU_PROTOCOL_LOG_TAG "APDU-PROTOCOL"
82
87#define IFX_SW_ERROR UINT8_C(0xB0)
88
105 const ifx_apdu_t *apdu,
106 ifx_apdu_response_t *response);
107
133ifx_status_t ifx_apdu_protocol_log(const ifx_logger_t *logger,
134 const char *source, ifx_log_level level,
135 const char *msg, const ifx_apdu_t *apdu);
136
162 const ifx_logger_t *logger, const char *source, ifx_log_level level,
163 const char *msg, const ifx_apdu_response_t *response);
164
165#ifdef __cplusplus
166}
167
168#endif
169#endif // IFX_APDU_PROTOCOL_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
Generic logging API.
ifx_log_level
Log level for filtering messages to actually be logged.
Definition ifx-logger.h:58
Generic protocol API (ISO/OSI stack).
Data storage struct for APDU response information.
Definition ifx-apdu.h:130
Data storage for APDU fields.
Definition ifx-apdu.h:89
ifx_status_t ifx_apdu_protocol_log_response(const ifx_logger_t *logger, const char *source, ifx_log_level level, const char *msg, const ifx_apdu_response_t *response)
Extension of ifx_logger_log() for logging APDU response objects.
ifx_status_t ifx_apdu_protocol_log(const ifx_logger_t *logger, const char *source, ifx_log_level level, const char *msg, const ifx_apdu_t *apdu)
Extension of ifx_logger_log() for logging APDU objects.
ifx_status_t ifx_apdu_protocol_transceive(ifx_protocol_t *self, const ifx_apdu_t *apdu, ifx_apdu_response_t *response)
Sends APDU to secure element reads back APDU response.