/*
 * api_constants.h
 *
 *  Created on: Jul 2, 2010
 *      Author: zumbruch
 */

#ifndef API_CONSTANTS_H_
#define API_CONSTANTS_H__

#ifdef API_CONSTANTS_H_
#include "can.h"
#include "api_define.h"
#include "api_global.h"
#include "api_constants.h"

extern const char *general_error[] PROGMEM;
enum ge_index
{
   GENERAL_ERROR_init_for_timer0_failed = 0,
   GENERAL_ERROR_init_for_timer0A_failed,
   GENERAL_ERROR_family_code_not_found,
   GENERAL_ERROR_all_message_were_read,
   GENERAL_ERROR_no_device_is_connected_to_the_bus,
   GENERAL_ERROR_undefined_bus,
   GENERAL_ERROR_channel_undefined,
   GENERAL_ERROR_value_has_invalid_type,
   GENERAL_ERROR_adress_has_invalid_type,
   GENERAL_ERROR_undefined_family_code,
   GENERAL_ERROR_invalid_argument,
   GENERAL_ERROR_MAXIMUM_INDEX
};

extern const char *serial_error[] PROGMEM;
enum se_index
{
   SERIAL_ERROR_no_valid_command_name = 0,
   SERIAL_ERROR_ID_is_too_long,
   SERIAL_ERROR_mask_is_too_long,
   SERIAL_ERROR_rtr_is_too_long,
   SERIAL_ERROR_length_is_too_long,
   SERIAL_ERROR_data_0_is_too_long,
   SERIAL_ERROR_data_1_is_too_long,
   SERIAL_ERROR_data_2_is_too_long,
   SERIAL_ERROR_data_3_is_too_long,
   SERIAL_ERROR_data_4_is_too_long,
   SERIAL_ERROR_data_5_is_too_long,
   SERIAL_ERROR_data_6_is_too_long,
   SERIAL_ERROR_data_7_is_too_long,
   SERIAL_ERROR_command_is_too_long,
   SERIAL_ERROR_argument_has_invalid_type,
   SERIAL_ERROR_ID_has_invalid_type,
   SERIAL_ERROR_mask_has_invalid_type,
   SERIAL_ERROR_rtr_has_invalid_type,
   SERIAL_ERROR_length_has_invalid_type,
   SERIAL_ERROR_data_0_has_invalid_type,
   SERIAL_ERROR_data_1_has_invalid_type,
   SERIAL_ERROR_data_2_has_invalid_type,
   SERIAL_ERROR_data_3_has_invalid_type,
   SERIAL_ERROR_data_4_has_invalid_type,
   SERIAL_ERROR_data_5_has_invalid_type,
   SERIAL_ERROR_data_6_has_invalid_type,
   SERIAL_ERROR_data_7_has_invalid_type,
   SERIAL_ERROR_undefined_error_type,
   SERIAL_ERROR_first_value_is_too_long,
   SERIAL_ERROR_second_value_is_too_long,
   SERIAL_ERROR_arguments_have_invalid_type,
   SERIAL_ERROR_arguments_exceed_boundaries,
   SERIAL_ERROR_too_many_arguments,
   SERIAL_ERROR_MAXIMUM_INDEX

};

extern const char *can_error[] PROGMEM;
enum ce_index
{
   CAN_ERROR_Can_Bus_is_off = 0,
   CAN_ERROR_Can_Bus_is_passive,
   CAN_ERROR_Can_Bus_is_on,
   CAN_ERROR_Bit_Error,
   CAN_ERROR_Stuff_Error,
   CAN_ERROR_CRC_Error,
   CAN_ERROR_Form_Error,
   CAN_ERROR_Acknowdlegment_Error,
   CAN_ERROR_CAN_was_not_successfully_initialized,
   CAN_ERROR_timeout_for_CAN_communication,
   CAN_ERROR_MAXIMUM_INDEX
};

extern const char *mob_error[] PROGMEM;
enum me_index
{
   MOB_ERROR_all_mailboxes_already_in_use = 0,
   MOB_ERROR_message_ID_not_found,
   MOB_ERROR_this_message_already_exists,
   MOB_ERROR_MAXIMUM_INDEX
};

extern const char* responseKeywords[] PROGMEM;
/* those are the corresponding command key numbers to commandKeywords, beware of the same order*/
enum responseKeyNumber
{
      responseKeyNumber_RECV = 0,
               responseKeyNumber_MAXIMUM_INDEX
};

extern const char* commandKeywords[] PROGMEM;
/* those are the corresponding command key numbers to commandKeywords, beware of the same order*/
enum cmdKeyNumber
{
               commandKeyNumber_SEND = 0,
               commandKeyNumber_SUBS,
               commandKeyNumber_USUB,
               commandKeyNumber_STAT,
               commandKeyNumber_RGWR,
               commandKeyNumber_RGRE,
               commandKeyNumber_RADC,
               commandKeyNumber_OWAD,
               commandKeyNumber_OWDS,
               commandKeyNumber_OWON,
               commandKeyNumber_OWLS,
               commandKeyNumber_OWSS,
               commandKeyNumber_RSET,
               commandKeyNumber_PING,
               commandKeyNumber_OWTP,
               commandKeyNumber_OWSP,
               commandKeyNumber_ADSP,
               commandKeyNumber_RLSL,
               commandKeyNumber_RLSH,
               commandKeyNumber_RLSI,
               commandKeyNumber_RLSO,
               commandKeyNumber_DBGL,
               commandKeyNumber_DBGM,
               commandKeyNumber_JTAG,
               commandKeyNumber_HELP,
               commandKeyNumber_OWTR,
               commandKeyNumber_OWRP,
               commandKeyNumber_ADRP,
               commandKeyNumber_DEBG,
               commandKeyNumber_PARA,
               commandKeyNumber_SHOW,
               commandKeyNumber_OWMR,
               commandKeyNumber_OWPC,
               commandKeyNumber_OWRb,
               commandKeyNumber_OWRB,
               commandKeyNumber_OWSC,
               commandKeyNumber_OWSB,
               commandKeyNumber_OWSA,
               commandKeyNumber_WDOG,
               commandKeyNumber_EXIT,
               commandKeyNumber_CMD0,
               commandKeyNumber_CMD1,
               commandKeyNumber_CMD2,
               commandKeyNumber_CMD3,
               commandKeyNumber_CMD4,
               commandKeyNumber_CMD5,
               commandKeyNumber_CMD6,
               commandKeyNumber_CMD7,
               commandKeyNumber_CMD8,
               commandKeyNumber_CMD9,
               commandKeyNumber_MAXIMUM_NUMBER
};

extern const char* commandShortDescriptions[] PROGMEM;
extern const char* commandImplementations[] PROGMEM;

extern const char *errorTypes[] PROGMEM;
/* those are the corresponding ERRx numbers to errorTypes, beware of the same order*/
enum ERRs
{
   ERRG = 0,
   ERRA,
   ERRC,
   ERRM,
   ERRU,
   ERR_MAXIMUM_NUMBER
};

extern const char *debugLevelNames[] PROGMEM;
extern const char *debugSystemNames[] PROGMEM;

#endif /* API_CONSTANTS_H_ */
#endif /* API_CONSTANTS_H_ */
