mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-10-30 10:12:41 +01:00
use nonblocking write for serial
This commit is contained in:
1 parent
8c02b21277
commit
60eabb05ab
5 files changed
+161
-25
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#ifndef _GWSERIAL_H
|
||||
#define _GWSERIAL_H
|
||||
#include "driver/uart.h"
|
||||
#include "GwLog.h"
|
||||
#include "GwBuffer.h"
|
||||
class SerialWriter;
|
||||
class GwSerial{
|
||||
private:
|
||||
GwBuffer *buffer;
|
||||
GwLog *logger;
|
||||
SerialWriter *writer;
|
||||
uart_port_t num;
|
||||
bool initialized=false;
|
||||
public:
|
||||
static const int bufferSize=200;
|
||||
GwSerial(GwLog *logger,uart_port_t num);
|
||||
~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();
|
||||
};
|
||||
#endif
|
||||
Reference in new issue
Block a user