mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-16 07:23:07 +01:00
intermediate: introduce an abstract channel
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
#include "HardwareSerial.h"
|
||||
#include "GwLog.h"
|
||||
#include "GwBuffer.h"
|
||||
#include "GwChannelInterface.h"
|
||||
class GwSerialStream;
|
||||
class GwSerial{
|
||||
class GwSerial : public GwChannelInterface{
|
||||
private:
|
||||
GwBuffer *buffer;
|
||||
GwBuffer *readBuffer=NULL;
|
||||
@@ -23,11 +24,11 @@ class GwSerial{
|
||||
~GwSerial();
|
||||
int setup(int baud,int rxpin,int txpin);
|
||||
bool isInitialized();
|
||||
size_t sendToClients(const char *buf,int sourceId,bool partial=false);
|
||||
void loop(bool handleRead=true);
|
||||
bool readMessages(GwMessageFetcher *writer);
|
||||
virtual size_t sendToClients(const char *buf,int sourceId,bool partial=false);
|
||||
virtual void loop(bool handleRead=true,bool handleWrite=true);
|
||||
virtual void readMessages(GwMessageFetcher *writer);
|
||||
void flush();
|
||||
Stream *getStream(bool partialWrites);
|
||||
virtual Stream *getStream(bool partialWrites);
|
||||
friend GwSerialStream;
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user