Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d518b61

Browse files
author
Mikhail Gorbunov
committed
compilation warnings
esp8266/Arduino#8419 deprecated WiFiServer::available in favor to WiFiServer::accept.
1 parent 685aa22 commit d518b61

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/RemoteDebug.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,12 @@ void RemoteDebug::handle() {
430430
if (TelnetClient && TelnetClient.connected()) {
431431

432432
// Verify if the IP is same than actual conection
433-
433+
#if ESP_IDF_VERSION_MAJOR >= 3
434+
WiFiClient newClient = TelnetServer.accept();
435+
#else
434436
WiFiClient newClient; // @suppress("Abstract class cannot be instantiated")
435437
newClient = TelnetServer.available();
438+
#endif
436439
String ip = newClient.remoteIP().toString();
437440

438441
if (ip == TelnetClient.remoteIP().toString()) {
@@ -456,7 +459,11 @@ void RemoteDebug::handle() {
456459

457460
// New TCP client
458461

462+
#if ESP_IDF_VERSION_MAJOR >= 3
463+
TelnetClient = TelnetServer.accept();
464+
#else
459465
TelnetClient = TelnetServer.available();
466+
#endif
460467

461468
// Password request ? - 18/07/18
462469

@@ -1788,7 +1795,7 @@ void RemoteDebug::setNoFilter() {
17881795

17891796
// Silence
17901797

1791-
void RemoteDebug::silence(boolean activate, boolean showMessage, boolean fromBreak, uint32_t timeout) {
1798+
void RemoteDebug::silence(boolean activate, boolean showMessage, boolean /*fromBreak*/, uint32_t timeout) {
17921799

17931800
// Set silence and timeout
17941801

0 commit comments

Comments
 (0)