intermediate: channel config 1st tests

This commit is contained in:
wellenvogel 2021-12-29 20:19:07 +01:00
parent 01dae66459
commit 298b6c1640
3 changed files with 14 additions and 10 deletions

View File

@ -24,6 +24,8 @@ void GwChannelConfig::begin(
this->writeFilter=writeFilter.isEmpty()?
NULL:
new GwNmeaFilter(writeFilter);
this->seaSmartOut=seaSmartOut;
this->toN2k=toN2k;
}
void GwChannelConfig::updateCounter(const char *msg, bool out)
{
@ -94,9 +96,9 @@ String GwChannelConfig::toString(){
rt+=enabled?"[ena]":"[dis]";
rt+=NMEAin?"in,":"";
rt+=NMEAout?"out,":"";
if (readFilter) rt+="RF:"+ readFilter->toString();
if (writeFilter) rt+="WF:"+ writeFilter->toString();
rt+=","+ toN2k?"n2k":"";
rt+=","+ seaSmartOut?"SM":"";
rt+=String("RF:") + (readFilter?readFilter->toString():"[]");
rt+=String("WF:") + (writeFilter?writeFilter->toString():"[]");
rt+=String(",")+ (toN2k?"n2k":"");
rt+=String(",")+ (seaSmartOut?"SM":"");
return rt;
}

View File

@ -136,7 +136,7 @@ GwCounter<unsigned long> countNMEA2KOut("count2Kout");
GwChannelConfig usbChannel(&logger,"USB");
GwChannelConfig actisenseChannel(&logger,"USB");
GwChannelConfig tcpChannel(&logger,"TCPServer");
GwChannelConfig serialChannel(&logger,"TCPClient");
GwChannelConfig serialChannel(&logger,"SER");
GwChannelConfig tclChannel(&logger,"TCPClient");
GwChannelConfig * channelFromSource(int source){
@ -205,7 +205,7 @@ GwSerial *usbSerial = new GwSerial(NULL, 0, USB_CHANNEL_ID);
GwSerial *serial1=NULL;
void sendBufferToChannels(const char * buffer, int sourceId){
if (sourceId < MIN_TCP_CHANNEL_ID && tcpChannel.canSendOut(buffer)){
if (tcpChannel.canSendOut(buffer)){
socketServer.sendToClients(buffer,sourceId);
}
if (sourceId != USB_CHANNEL_ID && usbChannel.canSendOut(buffer)){

View File

@ -306,12 +306,14 @@ function updateMsgDetails(key, details) {
let counters={
count2Kin: 'NMEA2000 in',
count2Kout: 'NMEA2000 out',
countTCPin: 'TCP in',
countTCPout: 'TCP out',
countTCPServerin: 'TCPserver in',
countTCPServerout: 'TCPserver out',
countTCPclientin: 'TCPclient in',
countTCPclientout: 'TCPclient out',
countUSBin: 'USB in',
countUSBout: 'USB out',
countSerialIn: 'Serial in',
countSerialOut: 'Serial out'
countSERIn: 'Serial in',
countSEROut: 'Serial out'
}
function showOverlay(text, isHtml) {
let el = document.getElementById('overlayContent');