/**************************************************************************//**
* @file
* @brief         Header file for the command module.
* @details       
******************************************************************************
* @author        M. Eng. CCR (Technikreferent des Durstigen Donnerstags)
* @version       1.0
* @date          Q1 2016
******************************************************************************
* @bug
* @warning
******************************************************************************
* @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_H_
#define COMMAND_H_

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

/**************************************************************************//**
* @brief
*    Return values of commands given to the BierAlyzer.
*****************************************************************************/
typedef enum{
    COMMAND_ERROR_TIMEOUT,  /**< If a timeout occurred, before the BierAlyzer properly responsed to the command. */
    COMMAND_ERROR_CANCELED, /**< If the command was cancelled due to user input (i.e. when user deleting was aborted). */
    COMMAND_SUCCESS,        /**< If the command was sucessfully executed. */
    COMMAND_ERROR           /**< If an error occurred (i.e. due to wrong parameters) and the command was not executed. */
}
command_error_t;

#define COMMAND_TIMEOUT 300  /**< Millisecond timeout for BierAlyzer to respond. */

command_error_t requestAllUsers(void);
command_error_t requestSingleUser(unsigned char hexId);
command_error_t requestAllEvents(void);
command_error_t requestSingleEvent(unsigned char eventId);
command_error_t requestSettings(void);
command_error_t requestPing(void);
command_error_t deleteSingleUser(unsigned char hexId);
command_error_t deleteSingleEvent(unsigned char eventId);
command_error_t registerUser(unsigned char hexId, char *name, char *rfidId);
command_error_t registerEvent(unsigned char eventId, char *description, char *date);
command_error_t setEventID(unsigned char eventId);
command_error_t clockSync(void);

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

#endif /* COMMAND_H_ */