diff --git a/include/model_car_exceptions.h b/include/model_car_exceptions.h deleted file mode 100644 index af42da1db55ee982206dd79951c1a37248bdc9c9..0000000000000000000000000000000000000000 --- a/include/model_car_exceptions.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef MODEL_CAR_EXCEPTIONS -#define MODEL_CAR_EXCEPTIONS - -#include "exceptions.h" -#include <stdint.h> - -/** - * \brief CModel_Car_Drivers_Base exception class - * - * This class implements the exceptions for the CModel_Car_Drivers_Base class. - * - * Similarly to other exception classes, it appends a class identifer - * string ("[CModel_Car_Drivers_Base] - ") to the error message in order to identify the - * class that generated the exception. - * - * The base class can be used to catch any exception thrown by the application - * or also, this class can be used in order to catch only exceptions generated - * by CModel_Car_Drivers_Base objects. - * - */ -class CModelCarException : public CException -{ - public: - /** - * \brief Constructor - * - * The constructor calls the base class constructor to add the general - * exception identifier and then adds the class identifier string - * "[CModel_Car_Drivers_Base class]" and the supplied error message. - * - * - * \verbatim - * [Exception caught] - <where> - * [CModel_Car_Drivers_Base class] - <error message> - * \endverbatim - * - * \param where a null terminated string with the information about the name - * of the function, the source code filename and the line where - * the exception was generated. This string must be generated - * by the _HERE_ macro. - * - * \param error_msg a null terminated string that contains the error message. - * This string may have any valid character and there is no - * limit on its length. - * - * - */ - CModelCarException(const std::string& where, const std::string& error_msg); - - /** - * \brief Constructor - * - * The constructor calls the base class constructor to add the general - * exception identifier and then adds the class identifier string - * "[CModel_Car_Drivers_Base class]", the supplied error message and the hexadecimal message received. - * - * - * \verbatim - * [Exception caught] - <where> - * [CModel_Car_Drivers_Base class] - <error message> - * [Serial message] - <serial_msg> - * \endverbatim - * - * \param where a null terminated string with the information about the name - * of the function, the source code filename and the line where - * the exception was generated. This string must be generated - * by the _HERE_ macro. - * - * \param error_msg a null terminated string that contains the error message. - * This string may have any valid character and there is no - * limit on its length. - * - * \param serial_msg Pointer to the message received by Serial port. - * - * \param msg_length Serial message length. - * - */ - CModelCarException(const std::string& where, const std::string& error_msg, const uint8_t *serial_msg, uint8_t msg_length); -}; - -#endif diff --git a/src/model_car_exceptions.cpp b/src/model_car_exceptions.cpp deleted file mode 100644 index 9f38a1cede852bcfa4e59d8313fdf8dcc71c6d15..0000000000000000000000000000000000000000 --- a/src/model_car_exceptions.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "model_car_exceptions.h" -#include <string.h> -#include <stdio.h> -#include <iomanip> - -const std::string model_car_driver_base_exception_msg="[CModel_Car_Drivers_Base class] - "; - -CModelCarException::CModelCarException(const std::string& where, const std::string& error_msg):CException(where, model_car_driver_base_exception_msg) -{ - this->error_msg+=error_msg; -} - -CModelCarException::CModelCarException(const std::string& where, const std::string& error_msg, const uint8_t *serial_msg, uint8_t msg_length):CException(where, model_car_driver_base_exception_msg) -{ - this->error_msg += error_msg; - std::ostringstream ss; - for (uint8_t i = 0; i < msg_length; i++) - ss << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)serial_msg[i]; - std::string msg_string(ss.str()); - this->error_msg += "\n[Serial message] - "; - this->error_msg += msg_string; -}