mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-21 12:28:55 +02:00
Add Diag::SNIFFER so config verbosity of sniffer output
This commit is contained in:
parent
e6a829d8ef
commit
e45febc785
@ -168,7 +168,8 @@ void loop()
|
|||||||
DCCPacket p = dccSniffer->fetchPacket();
|
DCCPacket p = dccSniffer->fetchPacket();
|
||||||
if (p.len() != 0) {
|
if (p.len() != 0) {
|
||||||
if (DCCDecoder::parse(p)) {
|
if (DCCDecoder::parse(p)) {
|
||||||
p.print();
|
if (Diag::SNIFFER)
|
||||||
|
p.print();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,10 @@ bool DCCDecoder::parse(DCCPacket &p) {
|
|||||||
for (byte n = 0; n < p.len(); n++)
|
for (byte n = 0; n < p.len(); n++)
|
||||||
checksum ^= d[n];
|
checksum ^= d[n];
|
||||||
if (checksum) { // Result should be zero, if not it's an error!
|
if (checksum) { // Result should be zero, if not it's an error!
|
||||||
DIAG(F("Checksum error:"));
|
if (Diag::SNIFFER) {
|
||||||
p.print();
|
DIAG(F("Checksum error:"));
|
||||||
|
p.print();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,6 +1277,10 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
|
|||||||
Diag::LCN = onOff;
|
Diag::LCN = onOff;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case "SNIFFER"_hk: // <D SNIFFER ON/OFF>
|
||||||
|
Diag::SNIFFER = onOff;
|
||||||
|
return true;
|
||||||
|
|
||||||
case "WEBSOCKET"_hk: // <D WEBSOCKET ON/OFF>
|
case "WEBSOCKET"_hk: // <D WEBSOCKET ON/OFF>
|
||||||
Diag::WEBSOCKET = onOff;
|
Diag::WEBSOCKET = onOff;
|
||||||
return true;
|
return true;
|
||||||
|
@ -29,6 +29,7 @@ bool Diag::ETHERNET=false;
|
|||||||
bool Diag::LCN=false;
|
bool Diag::LCN=false;
|
||||||
bool Diag::RAILCOM=false;
|
bool Diag::RAILCOM=false;
|
||||||
bool Diag::WEBSOCKET=false;
|
bool Diag::WEBSOCKET=false;
|
||||||
|
bool Diag::SNIFFER=false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class Diag {
|
|||||||
static bool LCN;
|
static bool LCN;
|
||||||
static bool RAILCOM;
|
static bool RAILCOM;
|
||||||
static bool WEBSOCKET;
|
static bool WEBSOCKET;
|
||||||
|
static bool SNIFFER;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StringFormatter
|
class StringFormatter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user