From e831111ffa3691b9407c8c44c0a35da54e460698 Mon Sep 17 00:00:00 2001 From: Juraj Andrassy Date: Sun, 1 Oct 2023 19:57:29 +0200 Subject: [PATCH] WiFiServer - remove method status() it never worked. fw always returns 0. other Arduino WiFi libraries don't have it or return 0 too. --- src/WiFiServer.cpp | 9 --------- src/WiFiServer.h | 1 - src/utility/server_drv.cpp | 28 ---------------------------- src/utility/server_drv.h | 2 -- src/utility/wifi_spi.h | 2 +- 5 files changed, 1 insertion(+), 41 deletions(-) diff --git a/src/WiFiServer.cpp b/src/WiFiServer.cpp index 3756a1c..2d6123a 100644 --- a/src/WiFiServer.cpp +++ b/src/WiFiServer.cpp @@ -80,15 +80,6 @@ WiFiClient WiFiServer::available(byte* status) return WiFiClient(255); } -uint8_t WiFiServer::status() { - if (_sock == NO_SOCKET_AVAIL) { - return CLOSED; - } else { - return ServerDrv::getServerState(_sock); - } -} - - size_t WiFiServer::write(uint8_t b) { return write(&b, 1); diff --git a/src/WiFiServer.h b/src/WiFiServer.h index b01fa5e..f0d571d 100644 --- a/src/WiFiServer.h +++ b/src/WiFiServer.h @@ -41,7 +41,6 @@ class WiFiServer : public Server { void begin(); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); - uint8_t status(); using Print::write; }; diff --git a/src/utility/server_drv.cpp b/src/utility/server_drv.cpp index d24a2b5..b867133 100644 --- a/src/utility/server_drv.cpp +++ b/src/utility/server_drv.cpp @@ -170,34 +170,6 @@ void ServerDrv::stopClient(uint8_t sock) SpiDrv::spiSlaveDeselect(); } - -uint8_t ServerDrv::getServerState(uint8_t sock) -{ - WAIT_FOR_SLAVE_SELECT(); - // Send Command - SpiDrv::sendCmd(GET_STATE_TCP_CMD, PARAM_NUMS_1); - SpiDrv::sendParam(&sock, sizeof(sock), LAST_PARAM); - - // pad to multiple of 4 - SpiDrv::readChar(); - SpiDrv::readChar(); - - SpiDrv::spiSlaveDeselect(); - //Wait the reply elaboration - SpiDrv::waitForSlaveReady(); - SpiDrv::spiSlaveSelect(); - - // Wait for reply - uint8_t _data = 0; - uint8_t _dataLen = 0; - if (!SpiDrv::waitResponseCmd(GET_STATE_TCP_CMD, PARAM_NUMS_1, &_data, &_dataLen)) - { - WARN("error waitResponse"); - } - SpiDrv::spiSlaveDeselect(); - return _data; -} - uint8_t ServerDrv::getClientState(uint8_t sock) { WAIT_FOR_SLAVE_SELECT(); diff --git a/src/utility/server_drv.h b/src/utility/server_drv.h index 2cfe0a1..f902ff0 100644 --- a/src/utility/server_drv.h +++ b/src/utility/server_drv.h @@ -41,8 +41,6 @@ class ServerDrv static void stopClient(uint8_t sock); - static uint8_t getServerState(uint8_t sock); - static uint8_t getClientState(uint8_t sock); static bool getData(uint8_t sock, uint8_t *data, uint8_t peek = 0); diff --git a/src/utility/wifi_spi.h b/src/utility/wifi_spi.h index a11f145..b07bc72 100644 --- a/src/utility/wifi_spi.h +++ b/src/utility/wifi_spi.h @@ -67,7 +67,7 @@ enum { GET_CURR_ENCT_CMD = 0x26, SCAN_NETWORKS = 0x27, START_SERVER_TCP_CMD= 0x28, - GET_STATE_TCP_CMD = 0x29, +// GET_STATE_TCP_CMD = 0x29, DATA_SENT_TCP_CMD = 0x2A, AVAIL_DATA_TCP_CMD = 0x2B, GET_DATA_TCP_CMD = 0x2C,