BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/ErrorService/ErrorState.h Source File
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
ErrorState.h
Go to the documentation of this file.
1
24#ifndef ERRORSTATE_H
25#define ERRORSTATE_H
26
27#ifdef ARDUINO
28 #include <Arduino.h> // include Arduino-Library for platformIO-build
29#else
30 #include <iostream> // include iostream for local testing
31 #include <cstring>
32 #include <cstdio>
33 #include <mockArduino.h>
34 using namespace arduinoMocking;
35#endif
36
37#include <Error.h>
38
50 public:
56 ErrorState();
57
63
69 void raiseError(errorCodes code);
70
77
82 void clearErrorState();
83
84 private:
86 errorCodes errorState;
87};
88
89#endif // ERRORSTATE_H
errorCodes
Enumeration for various error codes.
Definition Error.h:47
A class to manage and track error states using error codes.
Definition ErrorState.h:49
~ErrorState()
Destroy the ErrorState object.
Definition ErrorState.cpp:30
void clearErrorState()
sets the current error-state to "no Error"
Definition ErrorState.cpp:43
ErrorState()
Default constructor for ErrorState.
Definition ErrorState.cpp:27
errorCodes getErrorState()
Get the currently active error-code.
Definition ErrorState.cpp:38
void raiseError(errorCodes code)
raises a new error by setting the given error-code as errorState
Definition ErrorState.cpp:33
Provides mock implementations of Arduino framework functions and classes for native builds.
Definition mockArduino.cpp:28