mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-10-30 10:12:41 +01:00
handle receiving and distributing on NMEA messages
This commit is contained in:
1 parent
edb8d6e863
commit
1be2b1a667
8 files changed
+111
-63
No files matched your search
+10
-5
@@ -7,19 +7,24 @@ class SerialWriter;
|
||||
class GwSerial{
|
||||
private:
|
||||
GwBuffer *buffer;
|
||||
GwBuffer *readBuffer;
|
||||
GwBuffer *readBuffer=NULL;
|
||||
GwLog *logger;
|
||||
SerialWriter *writer;
|
||||
uart_port_t num;
|
||||
bool initialized=false;
|
||||
bool allowRead=true;
|
||||
GwBuffer::WriteStatus write();
|
||||
int id=-1;
|
||||
int overflows=0;
|
||||
size_t enqueue(const uint8_t *data, size_t len);
|
||||
public:
|
||||
static const int bufferSize=200;
|
||||
GwSerial(GwLog *logger,uart_port_t num);
|
||||
GwSerial(GwLog *logger,uart_port_t num,int id,bool allowRead=true);
|
||||
~GwSerial();
|
||||
int setup(int baud,int rxpin,int txpin);
|
||||
bool isInitialized();
|
||||
size_t enqueue(const uint8_t *data, size_t len);
|
||||
GwBuffer::WriteStatus write();
|
||||
const char *read();
|
||||
void sendToClients(const char *buf,int sourceId);
|
||||
void loop(bool handleRead=true);
|
||||
bool readMessages(GwBufferWriter *writer);
|
||||
};
|
||||
#endif
|
||||
Reference in new issue
Block a user