semf
error.h
Go to the documentation of this file.
1
10#ifndef SEMF_UTILS_CORE_ERROR_H_
11#define SEMF_UTILS_CORE_ERROR_H_
12
13#include <cstdint>
14
15namespace semf
16{
21class Error
22{
23public:
27 enum ClassID : uint32_t
28 {
73
75
84
89
92
97
100
105
112
116
128
137
141
144
150
154
160
164
171
175
183
189
190 SectionHardwareEnd = 0x0FFFFFFF,
191
192 SectionUserBegin = 0x10000000,
193 SectionUserEnd = 0xFFFFFFFF
194 };
200 Error(uint32_t classId, uint8_t errorCode);
201 virtual ~Error() = default;
202
207 bool isHardwareError() const;
212 uint32_t classId() const;
217 uint8_t errorCode() const;
218
219private:
221 uint32_t m_classId;
223 uint8_t m_errorCode;
224};
225} // namespace semf
226#endif // SEMF_UTILS_CORE_ERROR_H_
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
Definition: error.h:22
ClassID
Semf class IDs.
Definition: error.h:28
@ SpiMasterHardware
Definition: error.h:62
@ NetX90AnalogIn
Definition: error.h:81
@ NetX90I2cMaster
Definition: error.h:125
@ EepromEmulation
Definition: error.h:34
@ Stm32AnalogInDma
Definition: error.h:78
@ Stm32Pwm
Definition: error.h:146
@ Stm32G0UsbVcp
Definition: error.h:187
@ SectionUsbVcpBegin
Definition: error.h:184
@ MicrochipSst26vf016b
Definition: error.h:54
@ Esp32I2cMaster
Definition: error.h:124
@ SectionTimerBegin
Definition: error.h:165
@ FlashTester
Definition: error.h:40
@ Esp32AnalogIn
Definition: error.h:80
@ SectionAnalogoutEnd
Definition: error.h:88
@ BoschBme280
Definition: error.h:32
@ CanHardware
Definition: error.h:33
@ SectionPwmEnd
Definition: error.h:149
@ Stm32SpiSlave
Definition: error.h:162
@ MicrochipMcp3426
Definition: error.h:55
@ UartHardware
Definition: error.h:72
@ Esp32Uart
Definition: error.h:178
@ Stm32F1I2cSlave
Definition: error.h:130
@ SectionSpiMasterEnd
Definition: error.h:159
@ Stm32I2cMaster
Definition: error.h:122
@ SectionCanEnd
Definition: error.h:96
@ Logger
Definition: error.h:52
@ SectionExternalInterruptEnd
Definition: error.h:104
@ Stm32F1I2cMaster
Definition: error.h:118
@ NetX90Pwm
Definition: error.h:148
@ AnalogDevicesAd5686
Definition: error.h:29
@ I2cEeprom
Definition: error.h:46
@ FirmwareUpdater
Definition: error.h:37
@ I2cSlaveHardware
Definition: error.h:50
@ Stm32Can
Definition: error.h:94
@ SectionPowerBegin
Definition: error.h:142
@ Stm32I2cSlave
Definition: error.h:134
@ SoftI2cMaster
Definition: error.h:61
@ Stm32AnalogOutDma
Definition: error.h:87
@ SectionCanBegin
Definition: error.h:93
@ ExternalInterruptHardware
Definition: error.h:35
@ SectionI2cMasterEnd
Definition: error.h:127
@ SectionUsbVcpEnd
Definition: error.h:188
@ Stm32L0I2cMaster
Definition: error.h:123
@ SectionAnaloginBegin
Definition: error.h:76
@ SectionI2cSlaveBegin
Definition: error.h:129
@ VirtualI2cMasterHardware
Definition: error.h:126
@ SectionBootloaderEnd
Definition: error.h:91
@ SectionUartEnd
Definition: error.h:182
@ SectionAnaloginEnd
Definition: error.h:83
@ OnSemiLc709204F
Definition: error.h:56
@ NetX90AnalogInDma
Definition: error.h:82
@ Stm32AnalogOut
Definition: error.h:86
@ SectionCriticalSectionBegin
Definition: error.h:98
@ Esp32Timer
Definition: error.h:167
@ SectionHardwareBegin
Definition: error.h:74
@ SectionSpiSlaveEnd
Definition: error.h:163
@ VirtualUart
Definition: error.h:181
@ LoggerEntry
Definition: error.h:53
@ SectionPowerEnd
Definition: error.h:143
@ Stm32ExternalInterrupt
Definition: error.h:102
@ HammingCode
Definition: error.h:45
@ SectionHardwareEnd
Definition: error.h:190
@ I2cSlaveRegisterDevice
Definition: error.h:51
@ FlashTesterRandom
Definition: error.h:41
@ SectionGpioBegin
Definition: error.h:113
@ Stm32Uart
Definition: error.h:177
@ TiDrv425
Definition: error.h:71
@ SectionBootloaderBegin
Definition: error.h:90
@ SpiNorFlash
Definition: error.h:63
@ SpiSlaveHardware
Definition: error.h:65
@ Stm32AnalogIn
Definition: error.h:77
@ I2cMasterHardware
Definition: error.h:47
@ SectionUserEnd
Definition: error.h:193
@ NetX90ExternalInterrupt
Definition: error.h:103
@ SectionI2cSlaveEnd
Definition: error.h:136
@ Esp32Can
Definition: error.h:95
@ SectionFlashEnd
Definition: error.h:111
@ StmLsm6Dso32I2c
Definition: error.h:67
@ SectionI2cMasterBegin
Definition: error.h:117
@ SpiSlaveDevice
Definition: error.h:64
@ Stm32F7I2cSlave
Definition: error.h:133
@ Esp32SpiFlash
Definition: error.h:109
@ Stm32F4I2cSlave
Definition: error.h:132
@ SectionSpiMasterBegin
Definition: error.h:155
@ I2cScanner
Definition: error.h:48
@ SectionRtcEnd
Definition: error.h:153
@ Stm32F4I2cMaster
Definition: error.h:120
@ ArrowControl
Definition: error.h:31
@ Stm32Rtc
Definition: error.h:152
@ QtUart
Definition: error.h:179
@ NetX90Uart
Definition: error.h:180
@ SectionUserBegin
Definition: error.h:192
@ SpiSlaveRegisterDevice
Definition: error.h:66
@ FlashTesterReader
Definition: error.h:42
@ Secded
Definition: error.h:60
@ SectionGpioEnd
Definition: error.h:115
@ SectionCriticalSectionEnd
Definition: error.h:99
@ Stm32F7UsbVcp
Definition: error.h:186
@ AnalogDevicesLtc1867
Definition: error.h:30
@ Stm32OutputCompare
Definition: error.h:173
@ SectionOutputCompareBegin
Definition: error.h:172
@ Stm32InputCapture
Definition: error.h:139
@ NetX90Timer
Definition: error.h:169
@ Stm32Timer
Definition: error.h:166
@ PniRm3100i2c
Definition: error.h:57
@ Stm32F4UsbVcp
Definition: error.h:185
@ SectionTimerEnd
Definition: error.h:170
@ Esp32LedControlPwm
Definition: error.h:147
@ Stm32L0I2cSlave
Definition: error.h:135
@ SectionOutputCompareEnd
Definition: error.h:174
@ FirmwareHeader
Definition: error.h:36
@ SectionSpiSlaveBegin
Definition: error.h:161
@ NetX90SpiMaster
Definition: error.h:157
@ SectionInputCaptureBegin
Definition: error.h:138
@ Stm32F3I2cMaster
Definition: error.h:119
@ VirtualFlash
Definition: error.h:110
@ Processor
Definition: error.h:59
@ FlashTesterWriter
Definition: error.h:43
@ SectionUartBegin
Definition: error.h:176
@ Tabulator
Definition: error.h:69
@ Stm32F3I2cSlave
Definition: error.h:131
@ Stm32Flash
Definition: error.h:108
@ FlashVerifier
Definition: error.h:44
@ QtFlash
Definition: error.h:107
@ SectionInputCaptureEnd
Definition: error.h:140
@ SectionRtcBegin
Definition: error.h:151
@ Stm32SpiMaster
Definition: error.h:156
@ TiAds1115
Definition: error.h:70
@ FlashLogger
Definition: error.h:39
@ SectionPwmBegin
Definition: error.h:145
@ SectionExternalInterruptBegin
Definition: error.h:101
@ SectionAnalogoutBegin
Definition: error.h:85
@ I2cSlaveDevice
Definition: error.h:49
@ FimrwareVerifier
Definition: error.h:38
@ Stm32F7I2cMaster
Definition: error.h:121
@ VirtualSpiMasterHardware
Definition: error.h:158
@ SectionFlashBegin
Definition: error.h:106
@ Stm32AnalogInInjected
Definition: error.h:79
@ Printer
Definition: error.h:58
@ NetX90Gpio
Definition: error.h:114
@ StreamProtocol
Definition: error.h:68
@ Esp32TimerPeripheral
Definition: error.h:168
uint8_t errorCode() const
Returns the error code from the error.
Definition: error.cpp:30
virtual ~Error()=default
uint32_t classId() const
Returns the class id from the error.
Definition: error.cpp:25
bool isHardwareError() const
Checks if the error got submitted by a class from the semf-HAL.
Definition: error.cpp:20
Error(uint32_t classId, uint8_t errorCode)
Constructor.
Definition: error.cpp:14