1
0
forked from fsfw/fsfw

improvements and fixes

This commit is contained in:
2020-06-04 19:50:56 +02:00
parent 3a573c1b4c
commit 7014833c1c
2 changed files with 15 additions and 9 deletions

View File

@ -20,6 +20,8 @@ class ServiceInterfaceBuffer:
public std::streambuf {
friend class ServiceInterfaceStream;
public:
static constexpr uint8_t MAX_PREAMBLE_SIZE = 40;
ServiceInterfaceBuffer(std::string setMessage, bool addCrToPreamble,
bool buffered, bool errStream, uint16_t port);
@ -41,14 +43,17 @@ private:
std::string preamble;
// For EOF detection
typedef std::char_traits<char> Traits;
//! This is useful for some terminal programs which do not have
//! implicit carriage return with newline characters.
bool addCrToPreamble;
//! Specifies whether the stream operates in buffered or unbuffered mode.
bool buffered;
//! This specifies to print to stderr and work in unbuffered mode.
bool errStream;
bool buffered;
// Work in buffer mode. It is also possible to work without buffer.
//! Needed for buffered mode.
static size_t const BUF_SIZE = 128;
char buf[BUF_SIZE];