Files
WomoLIN/Software/WomoLin/womolin/include/protocol.h
2019-12-16 18:48:54 +01:00

32 lines
695 B
C++

#pragma once
#include "ihal.h"
namespace womolin::lib::protocol
{
using namespace womolin::lib::interface::hal;
class LibProtocol final
{
public:
LibProtocol( ILibSerial & serial );
~LibProtocol() = default;
bool getKeyValue( std::string & key, std::string & value);
void sendKeyValue( std::string & key, std::string & value);
private:
ILibSerial & serial;
std::string messageBuffer;
private:
static constexpr char STARTBYTE { '^' };
static constexpr char SEPARATOR { ';' };
static constexpr char ENDBYTE { '$' };
static constexpr char LINEBREAK { '\n' };
};
}