1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

#12: multiple capabilities in user task, user init function, cleanup message handling in main, clearer api

This commit is contained in:
wellenvogel
2021-12-01 20:03:33 +01:00
parent 16cf7655f0
commit c105eef969
9 changed files with 215 additions and 126 deletions

View File

@@ -17,10 +17,7 @@ NMEA0183DataToN2K::NMEA0183DataToN2K(GwLog *logger, GwBoatData *boatData,N2kSend
LOG_DEBUG(GwLog::LOG,"NMEA0183DataToN2K created %p",this);
}
bool NMEA0183DataToN2K::parseAndSend(const char *buffer, int sourceId) {
LOG_DEBUG(GwLog::DEBUG,"NMEA0183DataToN2K[%d] parsing %s",sourceId,buffer)
return false;
}
class SNMEA0183Msg : public tNMEA0183Msg{
public:
@@ -821,6 +818,7 @@ private:
}
public:
virtual bool parseAndSend(const char *buffer, int sourceId)
{
LOG_DEBUG(GwLog::DEBUG + 1, "NMEA0183DataToN2K[%d] parsing %s", sourceId, buffer)
@@ -843,7 +841,6 @@ public:
}
return rt;
}
virtual unsigned long *handledPgns()
{
return converters.handledPgns();

View File

@@ -13,7 +13,7 @@ class NMEA0183DataToN2K{
N2kSender sender;
public:
NMEA0183DataToN2K(GwLog *logger,GwBoatData *boatData,N2kSender callback);
virtual bool parseAndSend(const char *buffer, int sourceId);
virtual bool parseAndSend(const char *buffer, int sourceId)=0;
virtual unsigned long *handledPgns()=0;
virtual int numConverters()=0;
virtual String handledKeys()=0;