phyphox BLE
Plot your Arduino's data in the phyphox app and control the board from the phone
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1// Configuration errors. A setter that receives something the format cannot express records the
2// first error per element; the generated experiment then shows every error as a red info
3// element (the one channel a user without a serial monitor has), and PhyphoxBLE::printErrors()
4// lists them for those with one. Codes keep the 1.x numbering the README documents.
5#ifndef PHYPHOX_BLE_CORE_ERRORS_H
6#define PHYPHOX_BLE_CORE_ERRORS_H
7
8#include <stdint.h>
9
10namespace phyphox {
11
24
28 const char* origin = nullptr;
29 bool set() const { return code != ERR_NONE; }
30 void record(ErrorCode c, const char* from) { if (!set()) { code = c; origin = from; } }
31};
32
33const char* errorText(ErrorCode code);
34
35} // namespace phyphox
36
37#endif
Definition ChannelStore.h:11
const char * errorText(ErrorCode code)
short English description for the info element
ErrorCode
Definition Errors.h:12
@ ERR_02_ABOVE_LIMIT
a number exceeds its upper limit (channel, rate, count)
Definition Errors.h:15
@ ERR_03_NOT_HEX_COLOR
a colour is not six hexadecimal digits
Definition Errors.h:16
@ ERR_06_CAPACITY
the experiment block could not be allocated, or an inline addMap/addOption limit was hit
Definition Errors.h:20
@ ERR_07_CHANNEL_CONFLICT
a button shares an input channel with another element
Definition Errors.h:21
@ ERR_05_INVALID_LAYOUT
a layout is not auto, extend or fixed
Definition Errors.h:18
@ ERR_08_NULL_STRING
a null pointer was passed where a string is required
Definition Errors.h:22
@ ERR_NONE
Definition Errors.h:13
@ ERR_01_TOO_LONG
a string exceeds PHYPHOX_BLE_MAX_STRING_LENGTH
Definition Errors.h:14
@ ERR_04_INVALID_VALUE
a style, component, sensor type or option is not one the format has
Definition Errors.h:17
The first error recorded on an element, with the setter it came from.
Definition Errors.h:26
const char * origin
setter name, e.g. "setColor"
Definition Errors.h:28
ErrorCode code
Definition Errors.h:27
void record(ErrorCode c, const char *from)
Definition Errors.h:30
bool set() const
Definition Errors.h:29