OPTIGA™ Trust M
Host Library Documentation
|
This file implements Optiga comms abstraction layer for IFX I2C Protocol. More...
#include "optiga/common/optiga_lib_types.h"
#include "optiga/common/optiga_lib_return_codes.h"
#include "optiga/common/optiga_lib_common.h"
Go to the source code of this file.
Data Structures | |
struct | optiga_comms |
Optiga comms structure. More... | |
#define | OPTIGA_COMMS_DATA_OFFSET (0x00) |
#define | OPTIGA_COMMS_PRL_OVERHEAD (0x00) |
typedef struct optiga_comms | optiga_comms_t |
Optiga comms structure. More... | |
optiga_comms_t | optiga_comms |
optiga communication structure More... | |
optiga_comms_t * | optiga_comms_create (callback_handler_t callback, void *context) |
Provides the singleton OPTIGA instance. More... | |
void | optiga_comms_destroy (optiga_comms_t *optiga_comms) |
Deinitializes the OPTIGA comms instance. More... | |
optiga_lib_status_t | optiga_comms_set_callback_context (optiga_comms_t *p_optiga_comms, void *context) |
Sets the callers context to OPTIGA comms instance. More... | |
optiga_lib_status_t | optiga_comms_set_callback_handler (optiga_comms_t *p_optiga_comms, callback_handler_t handler) |
Sets the callback handler to OPTIGA comms instance. More... | |
LIBRARY_EXPORTS optiga_lib_status_t | optiga_comms_open (optiga_comms_t *p_ctx) |
Opens the communication channel with OPTIGA. More... | |
LIBRARY_EXPORTS optiga_lib_status_t | optiga_comms_reset (optiga_comms_t *p_ctx, uint8_t reset_type) |
Resets the OPTIGA. More... | |
LIBRARY_EXPORTS optiga_lib_status_t | optiga_comms_transceive (optiga_comms_t *p_ctx, const uint8_t *p_tx_data, uint16_t tx_data_length, uint8_t *p_rx_data, uint16_t *p_rx_data_len) |
Sends and receives the APDU. More... | |
LIBRARY_EXPORTS optiga_lib_status_t | optiga_comms_close (optiga_comms_t *p_ctx) |
Closes the communication channel with OPTIGA. More... | |
This file implements Optiga comms abstraction layer for IFX I2C Protocol.
Definition in file optiga_comms.h.
#define OPTIGA_COMMS_DATA_OFFSET (0x00) |
Definition at line 56 of file optiga_comms.h.
#define OPTIGA_COMMS_PRL_OVERHEAD (0x00) |
Definition at line 57 of file optiga_comms.h.
typedef struct optiga_comms optiga_comms_t |
Optiga comms structure.
LIBRARY_EXPORTS optiga_lib_status_t optiga_comms_close | ( | optiga_comms_t * | p_ctx | ) |
Closes the communication channel with OPTIGA.
Closes the communication with OPTIGA.
[in,out] | p_ctx | Valid instance of optiga_comms_t created using optiga_comms_create |
OPTIGA_COMMS_SUCCESS | |
OPTIGA_COMMS_ERROR |
optiga_comms_t* optiga_comms_create | ( | callback_handler_t | callback, |
void * | context | ||
) |
Provides the singleton OPTIGA instance.
Creates an instance of optiga_comms_t.
[in] | callback | Pointer to callback function, must not be NULL |
[in] | context | Pointer to upper layer context. |
optiga_comms_t | * On successful instance creation |
NULL | Memory allocation failure |
void optiga_comms_destroy | ( | optiga_comms_t * | optiga_comms | ) |
Deinitializes the OPTIGA comms instance.
Destroys the instance of optiga_comms_t.
[in] | optiga_comms | Valid instance of optiga_comms_t created using optiga_comms_create |
LIBRARY_EXPORTS optiga_lib_status_t optiga_comms_open | ( | optiga_comms_t * | p_ctx | ) |
Opens the communication channel with OPTIGA.
Initializes the communication with OPTIGA
[in,out] | p_ctx | Valid instance of optiga_comms_t created using optiga_comms_create |
OPTIGA_COMMS_SUCCESS | |
OPTIGA_COMMS_ERROR |
LIBRARY_EXPORTS optiga_lib_status_t optiga_comms_reset | ( | optiga_comms_t * | p_ctx, |
uint8_t | reset_type | ||
) |
Resets the OPTIGA.
Resets the communication channel with OPTIGA.
[in,out] | p_ctx | Valid instance of optiga_comms_t created using optiga_comms_create |
[in,out] | reset_type | Type of reset
|
OPTIGA_COMMS_SUCCESS | |
OPTIGA_COMMS_ERROR |
optiga_lib_status_t optiga_comms_set_callback_context | ( | optiga_comms_t * | p_optiga_comms, |
void * | context | ||
) |
Sets the callers context to OPTIGA comms instance.
Sets the callers context to optiga_comms_t.
[in] | p_optiga_comms | Valid instance of optiga_comms_t created using optiga_comms_create |
[in] | context | Pointer to callers context |
optiga_lib_status_t optiga_comms_set_callback_handler | ( | optiga_comms_t * | p_optiga_comms, |
callback_handler_t | handler | ||
) |
Sets the callback handler to OPTIGA comms instance.
Sets the callback handler to optiga_comms_t instance.
[in] | p_optiga_comms | Valid instance of optiga_comms_t created using optiga_comms_create |
[in] | handler | Pointer to callback handler |
LIBRARY_EXPORTS optiga_lib_status_t optiga_comms_transceive | ( | optiga_comms_t * | p_ctx, |
const uint8_t * | p_tx_data, | ||
uint16_t | tx_data_length, | ||
uint8_t * | p_rx_data, | ||
uint16_t * | p_rx_data_len | ||
) |
Sends and receives the APDU.
Sends a command to OPTIGA and receives a response.
[in,out] | p_ctx | Valid instance of optiga_comms_t created using optiga_comms_create |
[in] | p_tx_data | Pointer to the transmit data buffer |
[in] | tx_data_length | Length of the transmit data buffer |
[in,out] | p_rx_data | Pointer to the receive data buffer |
[in,out] | p_rx_data_len | Pointer to the length of the receive data buffer |
|
extern |
optiga communication structure