|
10 | 10 | #define UNIT_SIZE 8 |
11 | 11 | #define SOURCE_SIZE 15 |
12 | 12 | #define REGEX_SIZE 160 |
| 13 | +#define MESSAGE_SIZE 255 |
13 | 14 |
|
14 | 15 | #define PAYLOAD_REGEX_0_100 "(^[0-9]{1,2}|100$)" |
15 | 16 | #define PAYLOAD_REGEX_2_DIGIT "(^[0-9]{1,2}$)" |
@@ -109,6 +110,17 @@ typedef struct _not_supported_tags_t { |
109 | 110 |
|
110 | 111 | std::vector<not_supported_tags_t> NotSupportedTags; |
111 | 112 |
|
| 113 | +typedef struct _message_cache_t { |
| 114 | + int type; |
| 115 | + uint32_t container; |
| 116 | + uint32_t tag; |
| 117 | + char message[MESSAGE_SIZE]; |
| 118 | + int error; |
| 119 | + uint32_t count; |
| 120 | +} message_cache_t; |
| 121 | + |
| 122 | +std::vector<message_cache_t> MessageCache; |
| 123 | + |
112 | 124 | typedef struct _date_t { |
113 | 125 | int day; |
114 | 126 | int month; |
@@ -503,6 +515,8 @@ rec_cache_t rec_cache[] = { |
503 | 515 | { 0, 0, "set/limit/discharge/durable", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true }, |
504 | 516 | { 0, 0, "set/limit/discharge/by_home_power", PAYLOAD_REGEX_5_DIGIT, "", "", "", "", UNIT_W, RSCP::eTypeUInt32, -1, false, true }, |
505 | 517 | { 0, 0, "set/log", "^true|on|1$", "true", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, |
| 518 | + { 0, 0, "set/log/cache", "^true|on|1$", "true", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, |
| 519 | + { 0, 0, "set/log/errors", "^true|on|1$", "true", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, |
506 | 520 | { 0, 0, "set/health", "^true|on|1$", "true", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, |
507 | 521 | { 0, 0, "set/force", "[a-zA-z0-9/_.*]*", "", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, |
508 | 522 | { 0, 0, "set/interval", "^[1-9]|[1-9][0-9]|[1-2][0-9][0-9]|300$", "", "", "", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true }, |
|
0 commit comments