mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-10-30 10:12:41 +01:00
intermediate: introduce an abstract channel
This commit is contained in:
1 parent
0acb988f31
commit
47fb805ee6
9 files changed
+351
-259
No files matched your search
@@ -96,7 +96,7 @@ size_t GwSerial::sendToClients(const char *buf,int sourceId,bool partial){
|
||||
}
|
||||
return enqueued;
|
||||
}
|
||||
void GwSerial::loop(bool handleRead){
|
||||
void GwSerial::loop(bool handleRead,bool handleWrite){
|
||||
write();
|
||||
if (! isInitialized()) return;
|
||||
if (! handleRead) return;
|
||||
@@ -116,10 +116,10 @@ void GwSerial::loop(bool handleRead){
|
||||
serial->readBytes(buffer,available);
|
||||
}
|
||||
}
|
||||
bool GwSerial::readMessages(GwMessageFetcher *writer){
|
||||
if (! isInitialized()) return false;
|
||||
if (! allowRead) return false;
|
||||
return writer->handleBuffer(readBuffer);
|
||||
void GwSerial::readMessages(GwMessageFetcher *writer){
|
||||
if (! isInitialized()) return;
|
||||
if (! allowRead) return;
|
||||
writer->handleBuffer(readBuffer);
|
||||
}
|
||||
|
||||
void GwSerial::flush(){
|
||||
|
||||
Reference in new issue
Block a user