-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprotocol.h
39 lines (26 loc) · 919 Bytes
/
protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: GPLv3-or-later */
/* Copyright (c) 2019 Project WomoLIN */
/* Author Myron Franze <myronfranze@web.de> */
#pragma once
#include "interface/ihw.h"
namespace siguni
{
class CProtocol final
{
public:
CProtocol( interface::IControlbus & attControlbus );
~CProtocol() = default;
[[nodiscard]]
bool GetKeyValue( std::string & attKey, std::string & attValue);
void SendKeyValue( std::string & attKey, std::string & attValue);
private:
interface::IControlbus & controlbus;
std::string messageBuffer;
private:
static constexpr int MESSAGE_BUFFER_MAX_SIZE { 32 };
static constexpr char STARTBYTE { '^' };
static constexpr char SEPARATOR { ';' };
static constexpr char ENDBYTE { '$' };
static constexpr char LINEBREAK { '\n' };
};
}