Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFiServer - remove method status() #256

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
28 changes: 0 additions & 28 deletions src/utility/server_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions src/utility/server_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utility/wifi_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down