CryptoAuthLib v3.7.6
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
calib_command.c File Reference

Microchip CryptoAuthentication device command builder - this is the main object that builds the command byte strings for the given device. It does not execute the command. The basic flow is to call a command method to build the command you want given the parameters and then send that byte string through the device interface. More...

#include "cryptoauthlib.h"

Functions

ATCA_STATUS atInfo (ATCADeviceType device_type, ATCAPacket *packet)
 ATCACommand Info method.
 
ATCA_STATUS atPause (ATCADeviceType device_type, ATCAPacket *packet)
 ATCACommand Pause method.
 
void atCRC (size_t length, const uint8_t *data, uint8_t *crc_le)
 Calculates CRC over the given raw data and returns the CRC in little-endian byte order.
 
void atCalcCrc (ATCAPacket *packet)
 This function calculates CRC and adds it to the correct offset in the packet data.
 
ATCA_STATUS atCheckCrc (const uint8_t *response)
 This function checks the consistency of a response.
 
bool atIsSHAFamily (ATCADeviceType device_type)
 determines if a given device type is a SHA device or a superset of a SHA device
 
bool atIsECCFamily (ATCADeviceType device_type)
 determines if a given device type is an ECC device or a superset of a ECC device
 
ATCA_STATUS isATCAError (uint8_t *data)
 checks for basic error frame in data
 

Detailed Description

Microchip CryptoAuthentication device command builder - this is the main object that builds the command byte strings for the given device. It does not execute the command. The basic flow is to call a command method to build the command you want given the parameters and then send that byte string through the device interface.

The primary goal of the command builder is to wrap the given parameters with the correct packet size and CRC. The caller should first fill in the parameters required in the ATCAPacket parameter given to the command. The command builder will deal with the mechanics of creating a valid packet using the parameter information.

Function Documentation

◆ atCalcCrc()

void atCalcCrc ( ATCAPacket packet)

This function calculates CRC and adds it to the correct offset in the packet data.

Parameters
[in]packetPacket to calculate CRC data for

◆ atCheckCrc()

ATCA_STATUS atCheckCrc ( const uint8_t *  response)

This function checks the consistency of a response.

Parameters
[in]responsepointer to response
Returns
ATCA_SUCCESS on success, otherwise ATCA_RX_CRC_ERROR

◆ atCRC()

void atCRC ( size_t  length,
const uint8_t *  data,
uint8_t *  crc_le 
)

Calculates CRC over the given raw data and returns the CRC in little-endian byte order.

Parameters
[in]lengthSize of data not including the CRC byte positions
[in]dataPointer to the data over which to compute the CRC
[out]crc_lePointer to the place where the two-bytes of CRC will be returned in little-endian byte order.

◆ atInfo()

ATCA_STATUS atInfo ( ATCADeviceType  device_type,
ATCAPacket packet 
)

ATCACommand Info method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atIsECCFamily()

bool atIsECCFamily ( ATCADeviceType  device_type)

determines if a given device type is an ECC device or a superset of a ECC device

Parameters
[in]device_typeType of device to check for family type
Returns
boolean indicating whether the given device is an ECC family device.

◆ atIsSHAFamily()

bool atIsSHAFamily ( ATCADeviceType  device_type)

determines if a given device type is a SHA device or a superset of a SHA device

Parameters
[in]device_typeType of device to check for family type
Returns
boolean indicating whether the given device is a SHA family device.

◆ atPause()

ATCA_STATUS atPause ( ATCADeviceType  device_type,
ATCAPacket packet 
)

ATCACommand Pause method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ isATCAError()

ATCA_STATUS isATCAError ( uint8_t *  data)

checks for basic error frame in data

Parameters
[in]datapointer to received data - expected to be in the form of a CA device response frame
Returns
ATCA_SUCCESS on success, otherwise an error code.