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

correctly send out seasmart only if NMEA out is not enabled on channel

This commit is contained in:
wellenvogel
2022-01-12 18:55:08 +01:00
parent ff1c6432af
commit 74064fb664
3 changed files with 24 additions and 12 deletions

View File

@@ -128,9 +128,11 @@ void GwChannel::updateCounter(const char *msg, bool out)
}
}
bool GwChannel::canSendOut(const char *buffer){
bool GwChannel::canSendOut(const char *buffer, bool isSeasmart){
if (! enabled || ! impl) return false;
if (! NMEAout || readActisense) return false;
if (readActisense) return false;
if (! isSeasmart && ! NMEAout) return false;
if (isSeasmart && ! seaSmartOut) return false;
if (writeFilter && ! writeFilter->canPass(buffer)) return false;
return true;
}
@@ -177,9 +179,9 @@ void GwChannel::readMessages(GwChannel::NMEA0183Handler handler){
receiver->setHandler(handler);
impl->readMessages(receiver);
}
void GwChannel::sendToClients(const char *buffer, int sourceId){
void GwChannel::sendToClients(const char *buffer, int sourceId, bool isSeasmart){
if (! impl) return;
if (canSendOut(buffer)){
if (canSendOut(buffer,isSeasmart)){
if(impl->sendToClients(buffer,sourceId)){
updateCounter(buffer,true);
}