BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/ErrorService/ErrorService.h Source File
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
ErrorService.h
Go to the documentation of this file.
1
24#ifndef ERROR_SERVICE_H
25#define ERROR_SERVICE_H
26#ifdef ARDUINO
27 #include <Arduino.h> // include Arduino-Library for platformIO-build
28#else
29 #include <mockArduino.h>
30 #include <cstring>
31 using namespace arduinoMocking;
32#endif
33
34#include "Service.h"
35#include "Error.h"
36
38#define STACKSIZE 2
39
41#define SERVICEID 0x65
42
68class ErrorService: public Service<Error, STACKSIZE>
69{
70public:
78 ErrorService(uint8_t instance_id);
79
88 ErrorService(uint8_t instance_id, uint8_t service_id);
89
95 void raiseError(errorCodes code);
96
104 void stackProcessing() override;
105
106private:
114 void printError(Error* error);
115
116};
117
118#endif // ERROR_SERVICE_H
errorCodes
Enumeration for various error codes.
Definition Error.h:47
Represents an error with it's error-content (error-code and an error-message), and provides methods f...
Definition Error.h:176
Service class for handling Errors.
Definition ErrorService.h:69
void raiseError(errorCodes code)
Adds an Error-object for the local Instance-Id to the Error-services rec-stack.
Definition ErrorService.cpp:80
ErrorService(uint8_t instance_id)
Constructor for ErrorService with default Service ID "m".
Definition ErrorService.cpp:26
void stackProcessing() override
Processes all errors from the receive stack.
Definition ErrorService.cpp:40
Service-Template to derive a Service class by defining the Content (derived Class of "Content") to ha...
Definition Service.h:115
Provides mock implementations of Arduino framework functions and classes for native builds.
Definition mockArduino.cpp:28