X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fcli.h;h=182611d4e5170c823b0b60f73c343f9418df36ee;hp=bf92b186ce3aef37b75e38d763840e482bd570bd;hb=572b35bb7409fb362441e0812cb62eab9f2411f0;hpb=17332291e15183d71d88ed868275e3cb53917180 diff --git a/test_src/cli.h b/test_src/cli.h index bf92b18..182611d 100644 --- a/test_src/cli.h +++ b/test_src/cli.h @@ -1,6 +1,6 @@ /* cli.h */ /* - This file is part of the This file is part of the AVR-Crypto-Lib. + This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -24,8 +24,35 @@ typedef void(*void_fpt)(void); +#ifdef CLI_OLD + int16_t findstring_d0(const char* str, const char* v); int16_t findstring_d0_P(const char* str, PGM_P v); int16_t execcommand_d0_P(const char* str, PGM_P v, void(*fpt[])(void) ); + +#else + +typedef char (*cli_rx_fpt)(void); +typedef void (*cli_tx_fpt)(char); + +#define CLI_BUFFER_BS 20 + +typedef struct { + PGM_P cmd_name; /* string containing the function name */ + PGM_P cmd_param_str; /* param descriptor string */ + void_fpt cmd_function; /* function pointer */ +} cmdlist_entry_t; + +extern cli_rx_fpt cli_rx; +extern cli_tx_fpt cli_tx; +extern uint8_t cli_echo; + +void echo_ctrl(char* s); +int8_t cmd_interface(PGM_VOID_P cmd_desc); + +#endif + + + #endif /*CLI_H_*/