This file implements optiga comms abstraction layer for IFX I2C Protocol. More...
#include "optiga_comms.h"
#include "optiga_lib_logger.h"
#include "ifx_i2c.h"
#include "pal_os_event.h"
Functions | |
optiga_lib_status_t | optiga_comms_open (optiga_comms_t *p_ctx) |
Opens the communication channel with OPTIGA. More... | |
optiga_lib_status_t | optiga_comms_reset (optiga_comms_t *p_ctx, uint8_t reset_type) |
Resets the OPTIGA. More... | |
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... | |
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.
Copyright (c) 2019 Infineon Technologies AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
\endcopyright
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_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 |
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_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 |
OPTIGA_COMMS_SUCCESS | |
OPTIGA_COMMS_ERROR | |
OPTIGA_COMMS_ERROR_STACK_MEMORY | |
OPTIGA_COMMS_ERROR_HANDSHAKE | |
OPTIGA_COMMS_ERROR_SESSION |