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

View File

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

View File

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