Adding Code for freeRTOS
This commit is contained in:
@ -6,6 +6,46 @@
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
class ServiceInterfaceBuffer: public std::basic_streambuf<char,
|
||||
std::char_traits<char> > {
|
||||
friend class ServiceInterfaceStream;
|
||||
public:
|
||||
ServiceInterfaceBuffer(std::string set_message, uint16_t port);
|
||||
protected:
|
||||
bool isActive;
|
||||
// This is called when buffer becomes full. If
|
||||
// buffer is not used, then this is called every
|
||||
// time when characters are put to stream.
|
||||
virtual int overflow(int c = Traits::eof());
|
||||
|
||||
// This function is called when stream is flushed,
|
||||
// for example when std::endl is put to stream.
|
||||
virtual int sync(void);
|
||||
|
||||
private:
|
||||
// For additional message information
|
||||
std::string log_message;
|
||||
// For EOF detection
|
||||
typedef std::char_traits<char> Traits;
|
||||
|
||||
// Work in buffer mode. It is also possible to work without buffer.
|
||||
static size_t const BUF_SIZE = 128;
|
||||
char buf[BUF_SIZE];
|
||||
|
||||
// In this function, the characters are parsed.
|
||||
void putChars(char const* begin, char const* end);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef UT699
|
||||
class ServiceInterfaceBuffer: public std::basic_streambuf<char,
|
||||
std::char_traits<char> > {
|
||||
|
Reference in New Issue
Block a user