1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

intermediate: restructure buffer handling

This commit is contained in:
wellenvogel
2021-12-01 22:55:37 +01:00
parent d8950c4eb4
commit 9dcb98bb51
7 changed files with 119 additions and 54 deletions

View File

@@ -3,14 +3,12 @@
#include "HardwareSerial.h"
#include "GwLog.h"
#include "GwBuffer.h"
class SerialWriter;
class GwSerialStream;
class GwSerial{
private:
GwBuffer *buffer;
GwBuffer *readBuffer=NULL;
GwLog *logger;
SerialWriter *writer;
int num;
bool initialized=false;
bool allowRead=true;
@@ -27,7 +25,7 @@ class GwSerial{
bool isInitialized();
size_t sendToClients(const char *buf,int sourceId,bool partial=false);
void loop(bool handleRead=true);
bool readMessages(GwBufferWriter *writer);
bool readMessages(GwMessageFetcher *writer);
void flush();
Stream *getStream(bool partialWrites);
friend GwSerialStream;