emlabcpp
modern opinionated embedded C++ library
error.h
Go to the documentation of this file.
1 
24 #pragma once
25 
26 #include "../experimental/string_buffer.h"
27 
28 #include <algorithm>
29 #include <array>
30 
31 namespace emlabcpp::protocol
32 {
33 
34 static constexpr std::size_t mark_size = 16;
35 
37 
39 {
41  std::size_t offset;
42 };
43 
44 static constexpr auto SIZE_ERR = mark( "EMCPPSIZE" );
46 static constexpr auto LOWSIZE_ERR = mark( "EMCPPLOWSIZE" );
48 static constexpr auto BIGSIZE_ERR = mark( "EMCPPBIGSIZE" );
50 static constexpr auto BOUNDS_ERR = mark( "EMCPPBOUNDS" );
52 static constexpr auto UNDEFVAR_ERR = mark( "EMCPPUNDEFVAR" );
54 static constexpr auto BADVAL_ERR = mark( "EMCPPBADVAL" );
56 static constexpr auto GROUP_ERR = mark( "EMCPPGRPMTCH" );
58 static constexpr auto CHECKSUM_ERR = mark( "EMCPPCHECKSM" );
59 
60 } // namespace emlabcpp::protocol
MIT License.
Definition: multiplexer.h:33
static constexpr auto LOWSIZE_ERR
not enough bytes left in the message for the item
Definition: error.h:46
static constexpr auto GROUP_ERR
no item of group matched the content of message
Definition: error.h:56
static constexpr auto BIGSIZE_ERR
too much bytes left in the message for the item
Definition: error.h:48
static constexpr auto CHECKSUM_ERR
wrong checksum in the protocol
Definition: error.h:58
static constexpr std::size_t mark_size
Definition: error.h:34
mark error_mark
Definition: error.h:40
static constexpr auto SIZE_ERR
Definition: error.h:44
std::size_t offset
Definition: error.h:41
static constexpr auto BOUNDS_ERR
value in the message is outside of the range of bounded type
Definition: error.h:50
string_buffer< mark_size > mark
Definition: error.h:36
static constexpr auto UNDEFVAR_ERR
variant id is outside of the range for defined variant
Definition: error.h:52
static constexpr auto BADVAL_ERR
parsed value is not correct, such as constant
Definition: error.h:54
Definition: error.h:39