CryptoAuthLib v3.7.8
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
ascii_kit_host.h File Reference

KIT protocol intepreter. More...

#include "cryptoauthlib.h"

Data Structures

struct  _ascii_kit_host_context
 
struct  _kit_host_map_entry
 

Macros

#define KIT_LAYER_DELIMITER   ':'
 
#define KIT_DATA_BEGIN_DELIMITER   '('
 
#define KIT_DATA_END_DELIMITER   ')'
 
#define KIT_MESSAGE_DELIMITER   '\n'
 
#define KIT_MESSAGE_SIZE_MAX   (2500)
 The Kit Protocol maximum message size.
 
#define KIT_SECTION_NAME_SIZE_MAX   KIT_MESSAGE_SIZE_MAX
 
#define KIT_VERSION_SIZE_MAX   (32)
 
#define KIT_FIRMWARE_SIZE_MAX   (32)
 

Typedefs

typedef struct _ascii_kit_host_context ascii_kit_host_context_t
 
typedef struct _kit_host_map_entry kit_host_map_entry_t
 

Functions

ATCA_STATUS kit_host_init_phy (atca_hal_kit_phy_t *phy, ATCAIface iface)
 Initializes a phy structure with a cryptoauthlib hal adapter.
 
ATCA_STATUS kit_host_init (ascii_kit_host_context_t *ctx, ATCAIfaceCfg *iface[], const size_t iface_count, const atca_hal_kit_phy_t *phy, const uint32_t flags)
 Initializes the kit protocol parser context.
 
size_t kit_host_format_response (uint8_t *response, size_t rlen, ATCA_STATUS status, uint8_t *data, size_t dlen)
 Format the status and data into the kit protocol response format.
 
ATCA_STATUS kit_host_process_cmd (ascii_kit_host_context_t *ctx, const kit_host_map_entry_t *cmd_list, int argc, char *argv[], uint8_t *response, size_t *rlen)
 Iterate through a command list to match the given command and then will execute it.
 
ATCA_STATUS kit_host_process_line (ascii_kit_host_context_t *ctx, uint8_t *input_line, size_t ilen, uint8_t *response, size_t *rlen)
 Parse a line as a kit protocol command. The kit protocol is printable ascii and each line ends with a newline character.
 
void kit_host_task (ascii_kit_host_context_t *ctx)
 Non returning kit protocol runner using the configured physical interface that was provided when the context was initialized.
 

Detailed Description

KIT protocol intepreter.

Macro Definition Documentation

◆ KIT_MESSAGE_SIZE_MAX

#define KIT_MESSAGE_SIZE_MAX   (2500)

The Kit Protocol maximum message size.

Note
Send: <target>:<command>(optional hex bytes to send)
Receive: <status hex byte>(optional hex bytes of response)

Typedef Documentation

◆ kit_host_map_entry_t

Used to create command tables for the kit host parser

Function Documentation

◆ kit_host_init()

ATCA_STATUS kit_host_init ( ascii_kit_host_context_t ctx,
ATCAIfaceCfg iface[],
const size_t  iface_count,
const atca_hal_kit_phy_t phy,
const uint32_t  flags 
)

Initializes the kit protocol parser context.

Returns
ATCA_SUCCESS on success, otherwise an error code
Parameters
ctxKit protocol parser context
ifaceList of device configurations which will be used
iface_countNumber of configurations provided
phyKit protocol physical adapter
flagsOption Flags

◆ kit_host_init_phy()

ATCA_STATUS kit_host_init_phy ( atca_hal_kit_phy_t phy,
ATCAIface  iface 
)

Initializes a phy structure with a cryptoauthlib hal adapter.

Returns
ATCA_SUCCESS on success, otherwise an error code