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

intermediate: use the arduino hwserial as idf does not receive data

This commit is contained in:
andreas
2021-11-03 17:11:40 +01:00
parent 9174f7d086
commit bec155fb4d
3 changed files with 33 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
#ifndef _GWSERIAL_H
#define _GWSERIAL_H
#include "driver/uart.h"
#include "HardwareSerial.h"
#include "GwLog.h"
#include "GwBuffer.h"
class SerialWriter;
@@ -10,16 +10,17 @@ class GwSerial{
GwBuffer *readBuffer=NULL;
GwLog *logger;
SerialWriter *writer;
uart_port_t num;
int 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);
HardwareSerial *serial;
public:
static const int bufferSize=200;
GwSerial(GwLog *logger,uart_port_t num,int id,bool allowRead=true);
GwSerial(GwLog *logger,int num,int id,bool allowRead=true);
~GwSerial();
int setup(int baud,int rxpin,int txpin);
bool isInitialized();