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

intermediate, untested: move channel handling out of main

This commit is contained in:
wellenvogel
2022-01-02 14:43:37 +01:00
parent 47fb805ee6
commit d21e497864
10 changed files with 381 additions and 302 deletions

View File

@@ -26,6 +26,7 @@ class GwChannel{
GwCounter<String> *countOut=NULL;
GwChannelInterface *impl;
int sourceId=0;
int maxSourceId=-1;
GwChannelMessageReceiver *receiver=NULL;
tActisenseReader *actisenseReader=NULL;
Stream *channelStream=NULL;
@@ -34,7 +35,8 @@ class GwChannel{
GwChannel(
GwLog *logger,
String name,
int sourceId);
int sourceId,
int maxSourceId=-1);
void begin(
bool enabled,
bool nmeaOut,
@@ -48,7 +50,7 @@ class GwChannel{
);
void setImpl(GwChannelInterface *impl);
bool isOwnSource(int id);
void enable(bool enabled){
this->enabled=enabled;
}
@@ -70,6 +72,6 @@ class GwChannel{
void sendToClients(const char *buffer, int sourceId);
typedef std::function<void(const tN2kMsg &msg, int sourceId)> N2kHandler ;
void parseActisense(N2kHandler handler);
void sendActisense(const tN2kMsg &msg);
void sendActisense(const tN2kMsg &msg, int sourceId);
};