Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 198b027

Browse files
authored
v2.7.1 to auto-detect and set MAX_SIZE
### Releases v2.7.1 1. Auto-detect `W5x00` and settings (`ETHERNET_LARGE_BUFFERS`, `MAX_SOCK_NUM`) to set `MAX_SIZE` to send. Check ['ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope #16](#16)
1 parent a2750ed commit 198b027

21 files changed

+117
-101
lines changed

README.md

Lines changed: 64 additions & 51 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
* [Changelog](#changelog)
20+
* [Releases v2.7.1](#releases-v271)
2021
* [Releases v2.7.0](#releases-v270)
2122
* [Releases v2.6.2](#releases-v262)
2223
* [Releases v2.6.1](#releases-v261)
@@ -38,6 +39,11 @@
3839

3940
## Changelog
4041

42+
### Releases v2.7.1
43+
44+
1. Auto-detect `W5x00` and settings (`ETHERNET_LARGE_BUFFERS`, `MAX_SOCK_NUM`) to set `MAX_SIZE` to send. Check ['ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope #16](https://github.com/khoih-prog/Ethernet_Generic/issues/16)
45+
46+
4147
### Releases v2.7.0
4248

4349
1. Fix severe limitation to permit sending larger data than 2/4/8/16K buffer

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ethernet_Generic",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"keywords": "WebServer, Ethernet, SPI2, Teensy, SAMD, STM32, SAM DUE, nRF52, ESP32, ESP8266, rpi-pico, rp2040, W5x00, W5500, LAN, Wiznet, WIZ550io, WIZ850io, USR-ES1",
55
"description": "Simple Ethernet library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, W5100S. With this library, you can use the Arduino Ethernet (shield or board) to connect to Internet. The library provides both Client and server functionalities. The library permits you to connect to a local network also with DHCP and to resolve DNS. The h-only library now supporting SPI1/SPI2, EthernetLarge, Ethernet2 and Ethernet3 features by simply changing definitions in the sketch. RASPBERRY_PI_PICO using arduino-pico core now can use SPI1. Now STM32, Arduino_mbed boards can use any custom hardware / software SPI and with fix of severe limitation to permit sending much larger data than total 2/4/8/16K buffer",
66
"authors": [

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Ethernet_Generic
2-
version=2.7.0
2+
version=2.7.1
33
author=Various (see AUTHORS file for details)
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=Simple Ethernet library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, W5100S

src/Dhcp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/EthernetWebServer
1515
16-
Version: 2.7.0
16+
Version: 2.7.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
3333
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
3434
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
35+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
3536
*****************************************************************************************************************************/
3637

3738
// DHCP Library v0.3 - April 25, 2009

src/Dhcp_Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3333
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3434
35-
Version: 2.7.0
35+
Version: 2.7.1
3636
3737
Version Modified By Date Comments
3838
------- ----------- ---------- -----------
@@ -51,6 +51,7 @@
5151
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
5252
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
5353
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
54+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
5455
*****************************************************************************************************************************/
5556

5657
// DHCP Library v0.3 - April 25, 2009

src/Dns.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/EthernetWebServer
1515
16-
Version: 2.7.0
16+
Version: 2.7.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
3333
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
3434
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
35+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
3536
*****************************************************************************************************************************/
3637

3738
// Arduino DNS client for WizNet5100-based Ethernet shield

src/Dns_Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3333
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3434
35-
Version: 2.7.0
35+
Version: 2.7.1
3636
3737
Version Modified By Date Comments
3838
------- ----------- ---------- -----------
@@ -51,6 +51,7 @@
5151
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
5252
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
5353
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
54+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
5455
*****************************************************************************************************************************/
5556
// Arduino DNS client for WizNet5100-based Ethernet shield
5657
// (c) Copyright 2009-2010 MCQN Ltd.

src/EthernetClient.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/EthernetWebServer
1515
16-
Version: 2.7.0
16+
Version: 2.7.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
3333
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
3434
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
35+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
3536
*****************************************************************************************************************************/
3637
// This file is in the public domain. No copyright is claimed.
3738

src/EthernetClient_Impl.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3333
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3434
35-
Version: 2.7.0
35+
Version: 2.7.1
3636
3737
Version Modified By Date Comments
3838
------- ----------- ---------- -----------
@@ -51,6 +51,7 @@
5151
2.6.1 K Hoang 23/09/2022 Fix bug for W5200
5252
2.6.2 K Hoang 26/10/2022 Add support to Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE using `mbed` or `nRF52` core
5353
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
54+
2.7.1 K Hoang 15/11/2022 Auto-detect W5x00 and settings to set MAX_SIZE to send
5455
*****************************************************************************************************************************/
5556

5657
#pragma once
@@ -172,19 +173,6 @@ size_t EthernetClient::write(uint8_t b)
172173

173174
#define ETHERNET_CLIENT_MAX_WRITE_RETRY 100
174175

175-
// Don't use larger size or hang, max is 16K for 1 socket
176-
#ifdef ETHERNET_LARGE_BUFFERS
177-
#if MAX_SOCK_NUM <= 1
178-
#define ETHERNET_CLIENT_SEND_MAX_SIZE 16384
179-
#elif MAX_SOCK_NUM <= 2
180-
#define ETHERNET_CLIENT_SEND_MAX_SIZE 8192
181-
#elif MAX_SOCK_NUM <= 4
182-
#define ETHERNET_CLIENT_SEND_MAX_SIZE 4096
183-
#else
184-
#define ETHERNET_CLIENT_SEND_MAX_SIZE 2048
185-
#endif
186-
#endif
187-
188176
////////////////////////////////////////
189177

190178
size_t EthernetClient::write(const uint8_t *buf, size_t size)
@@ -195,7 +183,10 @@ size_t EthernetClient::write(const uint8_t *buf, size_t size)
195183
size_t totalBytesSent = 0;
196184
size_t bytesRemaining = size;
197185

198-
ETG_LOGINFO1("EthernetClient::write: To write, size = ", size);
186+
uint16_t ETHERNET_CLIENT_SEND_MAX_SIZE = W5100.SSIZE;
187+
188+
ETG_LOGINFO1("EthernetClient::write: chip = ", W5100.getChip());
189+
ETG_LOGINFO3("EthernetClient::write: size = ", size, ", MAX_SIZE =", ETHERNET_CLIENT_SEND_MAX_SIZE);
199190

200191
if (_sockindex >= MAX_SOCK_NUM)
201192
return 0;

0 commit comments

Comments
 (0)