diff --git a/libraries/WiFiS3/src/Modem.cpp b/libraries/WiFiS3/src/Modem.cpp index c1dba332..7aa34391 100644 --- a/libraries/WiFiS3/src/Modem.cpp +++ b/libraries/WiFiS3/src/Modem.cpp @@ -75,6 +75,9 @@ bool ModemClass::passthrough(const uint8_t *data, size_t size) { /* -------------------------------------------------------------------------- */ void ModemClass::write_nowait(const string &cmd, string &str, const char * fmt, ...) { /* -------------------------------------------------------------------------- */ + (void)cmd; + (void)str; + va_list va; va_start (va, fmt); vsnprintf((char *)tx_buff, MAX_BUFF_SIZE, fmt, va); @@ -318,6 +321,7 @@ ModemClass::ParseResult ModemClass::buf_read(const string &prompt, string &data_ if(c == '\n') { state = at_parse_state_t::Res; } + /* fall through */ /* * break is volountary not present, to cover for cases where the response status is in the diff --git a/libraries/WiFiS3/src/WiFi.cpp b/libraries/WiFiS3/src/WiFi.cpp index 17d78fef..7e73b94f 100644 --- a/libraries/WiFiS3/src/WiFi.cpp +++ b/libraries/WiFiS3/src/WiFi.cpp @@ -25,7 +25,6 @@ const char* CWifi::firmwareVersion() { /* -------------------------------------------------------------------------- */ uint32_t CWifi::firmwareVersionU32() { /* -------------------------------------------------------------------------- */ - uint8_t ret[4]; string res = ""; modem.begin(); if(modem.write(string(PROMPT(_FWVERSION_U32)), res, CMD_READ(_FWVERSION_U32))) { diff --git a/libraries/WiFiS3/src/WiFiClient.cpp b/libraries/WiFiS3/src/WiFiClient.cpp index 143f92da..9e6d0926 100644 --- a/libraries/WiFiS3/src/WiFiClient.cpp +++ b/libraries/WiFiS3/src/WiFiClient.cpp @@ -128,7 +128,7 @@ int WiFiClient::_read() { if(modem.write(string(PROMPT(_CLIENTRECEIVE)),res, "%s%d,%d\r\n" , CMD_WRITE(_CLIENTRECEIVE), _sock, size)) { if(res.size() > 0) { - for(int i = 0, rv = 0; i < size && i < res.size(); i++) { + for(uint32_t i = 0, rv = 0; i < size && i < res.size(); i++) { rx_buffer->store((uint8_t)res[i]); rv++; } @@ -168,7 +168,7 @@ int WiFiClient::read(uint8_t *buf, size_t size) { int rv = 0; bool go_on = true; if(_sock >= 0 && rx_buffer != nullptr) { - for(int i = 0; i < size && go_on; i++) { + for(size_t i = 0; i < size && go_on; i++) { bool is_read = false; *(buf+i) = rx_buffer->read(&is_read); if(is_read) { diff --git a/libraries/WiFiS3/src/WiFiClient.h b/libraries/WiFiS3/src/WiFiClient.h index 81f5afae..63b019c3 100644 --- a/libraries/WiFiS3/src/WiFiClient.h +++ b/libraries/WiFiS3/src/WiFiClient.h @@ -70,14 +70,13 @@ class WiFiClient : public Client { protected: int _sock; + bool destroy_at_distructor; int _connectionTimeout = 0; void getSocket(); static constexpr uint32_t RX_BUFFER_DIM = 1024; std::shared_ptr> rx_buffer; int _read(); void read_if_needed(size_t s); - bool destroy_at_distructor; - }; diff --git a/libraries/WiFiS3/src/WiFiFileSystem.cpp b/libraries/WiFiS3/src/WiFiFileSystem.cpp index 938f2d8b..8dc7fa8b 100644 --- a/libraries/WiFiS3/src/WiFiFileSystem.cpp +++ b/libraries/WiFiS3/src/WiFiFileSystem.cpp @@ -20,6 +20,7 @@ size_t WiFiFileSystem::writefile(const char* name, const char* data, size_t size if(modem.passthrough((uint8_t *)data, size)) { return size; } + return 0; } /* -------------------------------------------------------------------------- */ diff --git a/libraries/WiFiS3/src/WiFiSSLClient.cpp b/libraries/WiFiS3/src/WiFiSSLClient.cpp index 91b6951e..bfe7c488 100644 --- a/libraries/WiFiS3/src/WiFiSSLClient.cpp +++ b/libraries/WiFiS3/src/WiFiSSLClient.cpp @@ -148,7 +148,7 @@ int WiFiSSLClient::_read() { modem.read_using_size(); if(modem.write(string(PROMPT(_SSLCLIENTRECEIVE)),res, "%s%d,%d\r\n" , CMD_WRITE(_SSLCLIENTRECEIVE), _sock, size)) { if(res.size() > 0) { - for(int i = 0, rv = 0; i < size && i < res.size(); i++) { + for(uint32_t i = 0, rv = 0; i < size && i < res.size(); i++) { rx_buffer->store((uint8_t)res[i]); rv++; } @@ -185,7 +185,7 @@ int WiFiSSLClient::read(uint8_t *buf, size_t size) { read_if_needed(size); int rv = 0; bool go_on = true; - for(int i = 0; i < size && go_on; i++) { + for(size_t i = 0; i < size && go_on; i++) { bool is_read = false; *(buf+i) = rx_buffer->read(&is_read); if(is_read) { diff --git a/libraries/WiFiS3/src/WiFiUdp.cpp b/libraries/WiFiS3/src/WiFiUdp.cpp index 5337c836..f229485c 100644 --- a/libraries/WiFiS3/src/WiFiUdp.cpp +++ b/libraries/WiFiS3/src/WiFiUdp.cpp @@ -181,7 +181,7 @@ int WiFiUDP::_read() { modem.read_using_size(); if(modem.write(string(PROMPT(_UDPREAD)),res, "%s%d,%d\r\n" , CMD_WRITE(_UDPREAD), _sock, size)) { if(res.size() > 0) { - for(int i = 0, rv = 0; i < size && i < res.size(); i++) { + for(uint32_t i = 0, rv = 0; i < size && i < res.size(); i++) { rx_buffer.store((uint8_t)res[i]); rv++; } @@ -218,7 +218,7 @@ int WiFiUDP::read(unsigned char* buf, size_t size) { read_if_needed(size); int rv = 0; bool go_on = true; - for(int i = 0; i < size && go_on; i++) { + for(size_t i = 0; i < size && go_on; i++) { bool is_read = false; *(buf+i) = rx_buffer.read(&is_read); if(is_read) {