Skip to content

Commit 1acf838

Browse files
committed
switches for debug output
1 parent 7597e7d commit 1acf838

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ default_envs = esp32-development-board
1515
[common]
1616
framework = arduino
1717
lib_deps =
18-
ArduinoJson@6.17.2
19-
WebSockets@2.2.0
18+
bblanchon/ArduinoJson@6.17.2
19+
links2004/WebSockets@2.2.0
2020
build_flags =
2121
-D USE_FACADE=true
2222
monitor_speed = 115200

src/ArduinoOcpp/Core/OcppSocket.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,32 @@ void OcppClientSocket::setReceiveTXTcallback(ReceiveTXTcallback &callback) {
2727
wsock->onEvent([callback](WStype_t type, uint8_t * payload, size_t length) {
2828
switch (type) {
2929
case WStype_DISCONNECTED:
30-
Serial.print(F("[OcppClientSocket] Disconnected!\n"));
30+
if (DEBUG_OUT) Serial.print(F("[OcppClientSocket] Disconnected!\n"));
3131
break;
3232
case WStype_CONNECTED:
33-
Serial.printf("[OcppClientSocket] Connected to url: %s\n", payload);
33+
if (DEBUG_OUT) Serial.printf("[OcppClientSocket] Connected to url: %s\n", payload);
3434
break;
3535
case WStype_TEXT:
3636
if (DEBUG_OUT || TRAFFIC_OUT) Serial.printf("[OcppClientSocket] get text: %s\n", payload);
3737

3838
if (!callback((const char *) payload, length)) { //forward message to OcppEngine
39-
Serial.print(F("[OcppClientSocket] Processing WebSocket input event failed!\n"));
39+
if (DEBUG_OUT) Serial.print(F("[OcppClientSocket] Processing WebSocket input event failed!\n"));
4040
}
4141
break;
4242
case WStype_BIN:
43-
Serial.print(F("[OcppClientSocket] Incoming binary data stream not supported"));
43+
if (DEBUG_OUT) Serial.print(F("[OcppClientSocket] Incoming binary data stream not supported"));
4444
break;
4545
case WStype_PING:
4646
// pong will be send automatically
47-
Serial.print(F("[OcppClientSocket] get ping\n"));
47+
if (DEBUG_OUT || TRAFFIC_OUT) Serial.print(F("[OcppClientSocket] get ping\n"));
4848
break;
4949
case WStype_PONG:
5050
// answer to a ping we send
51-
Serial.print(F("[OcppClientSocket] get pong\n"));
51+
if (DEBUG_OUT || TRAFFIC_OUT) Serial.print(F("[OcppClientSocket] get pong\n"));
5252
break;
5353
case WStype_FRAGMENT_TEXT_START: //fragments are not supported
5454
default:
55-
Serial.print(F("[OcppClientSocket] Unsupported WebSocket event type\n"));
55+
if (DEBUG_OUT) Serial.print(F("[OcppClientSocket] Unsupported WebSocket event type\n"));
5656
break;
5757
}
5858
});

0 commit comments

Comments
 (0)