/**************************************************************************//**
* @file
* @brief         Header file for the command parser module.
* @details
******************************************************************************
* @author        M. Eng. CCR (Technikreferent des Durstigen Donnerstags)
* @version       1.0
* @date          Q1 2016
******************************************************************************
* @bug
* @warning       Because of the lazyness of the author there are a lot of magic numbers
******************************************************************************
* @copyright     <b>CC-Software</b> - http://www.cc-software.de
*                Open Source Software for http://www.durstiger-donnerstag.de
* @section       License
*                This code is open source. Feel free to use it for non-commercial purposes.
*                However consider:
*                - always mention the origin (CC-Software and Durstiger Donnerstag)
*                - if you altered code, additionally mark it as altered by you
*                - the author doesn't guarantee functionality and is not liable for
*                  any accidents or other occurrences due to the usage of this code
*******************************************************************************/

#ifndef COMMAND_PARSER_H_
#define COMMAND_PARSER_H_

#include "DDProtocol.h"

/***************************************************************************//**
* @addtogroup AlcoLyzer Console
* @{
******************************************************************************/

/**************************************************************************//**
* @brief
*    Valid commands of the AlcoLyzer Console.
*****************************************************************************/
typedef enum
{
    COMMAND_PARSER_CMD_GET  = 1,
    COMMAND_PARSER_CMD_SET  = 2,
    COMMAND_PARSER_CMD_DEL  = 3,
    COMMAND_PARSER_CMD_PING = 4,
    COMMAND_PARSER_CMD_HELP = 5,
    COMMAND_PARSER_CMD_QUIT = 6
}
command_parser_cmd_t;


void                 CommandParse(char *user_input);
command_parser_cmd_t CommandParseCommand(char *input);
ddp_packet_content_t CommandParseContent(char *input);
char                 CommandParseDecodeNumber(char *ascii_input, char base, char *binary_output, char termination);
char                 CommandParseDecodeString(char *ascii_input, char *zero_terminated_output, char termination, int fill_with_space_until);
void                 CommandParserPrintHelp(void);

/** @} (end group AlcoLyzer Console) */

#endif /* COMMAND_PARSER_H_ */