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

Commit a2750ed

Browse files
authored
v2.7.0 to permit sending data more than 2/4/8/16K
### Releases v2.7.0 1. Fix severe limitation to permit sending larger data than 2/4/8/16K buffer 2. Add examples [EthernetWebServer_BigData](https://github.com/khoih-prog/Ethernet_Generic/tree/main/examples/EthernetWebServer_BigData) to demo how to send larger data than 2/4/8/16K buffer 3. Optimize code 4. Clean up 5. Update `Packages' Patches`
1 parent 6ac07f7 commit a2750ed

21 files changed

+702
-235
lines changed

README.md

Lines changed: 158 additions & 46 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
66
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/Ethernet_Generic.svg)](http://github.com/khoih-prog/Ethernet_Generic/issues)
77

8+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
9+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
10+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
11+
<a href="https://profile-counter.glitch.me/khoih-prog-Ethernet_Generic/count.svg" title="Ethernet_Generic Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-Ethernet_Generic/count.svg" style="height: 30px;width: 200px;"></a>
12+
813
---
914
---
1015

1116
## Table of Contents
1217

1318

1419
* [Changelog](#changelog)
20+
* [Releases v2.7.0](#releases-v270)
1521
* [Releases v2.6.2](#releases-v262)
1622
* [Releases v2.6.1](#releases-v261)
1723
* [Releases v2.6.0](#releases-v260)
@@ -32,6 +38,14 @@
3238

3339
## Changelog
3440

41+
### Releases v2.7.0
42+
43+
1. Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
44+
2. Add examples [EthernetWebServer_BigData](https://github.com/khoih-prog/Ethernet_Generic/tree/main/examples/EthernetWebServer_BigData) to demo how to send larger data than 2/4/8/16K buffer
45+
3. Optimize code
46+
4. Clean up
47+
5. Update `Packages' Patches`
48+
3549
### Releases v2.6.2
3650

3751
1. Add support to Seeeduino nRF52840-based boards such as **Seeed XIAO_NRF52840 and XIAO_NRF52840_SENSE**, etc. using Seeed `mbed` or `nRF52` core

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "Ethernet_Generic",
3-
"version": "2.6.2",
3+
"version": "2.7.0",
44
"keywords": "WebServer, Ethernet, SPI2, Teensy, SAMD, STM32, SAM DUE, nRF52, ESP32, ESP8266, rpi-pico, rp2040, W5x00, W5500, LAN, Wiznet, WIZ550io, WIZ850io, USR-ES1",
5-
"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",
5+
"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": [
77
{
88
"name": "Various",

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=Ethernet_Generic
2-
version=2.6.2
2+
version=2.7.0
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
6-
paragraph=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
6+
paragraph=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
77
category=Communication
88
url=https://github.com/khoih-prog/Ethernet_Generic
99
architectures=*

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.6.2
16+
Version: 2.7.0
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -31,6 +31,7 @@
3131
2.6.0 K Hoang 11/09/2022 Add support to AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
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
34+
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
3435
*****************************************************************************************************************************/
3536

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

src/Dhcp_Impl.h

Lines changed: 16 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.6.2
35+
Version: 2.7.0
3636
3737
Version Modified By Date Comments
3838
------- ----------- ---------- -----------
@@ -50,6 +50,7 @@
5050
2.6.0 K Hoang 11/09/2022 Add support to AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
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
53+
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
5354
*****************************************************************************************************************************/
5455

5556
// DHCP Library v0.3 - April 25, 2009
@@ -67,7 +68,7 @@
6768

6869
#include "utility/w5100.h"
6970

70-
/////////////////////////////////////////////////////////
71+
////////////////////////////////////////
7172

7273
int DhcpClass::beginWithDHCP(uint8_t *mac, unsigned long timeout, unsigned long responseTimeout)
7374
{
@@ -87,15 +88,15 @@ int DhcpClass::beginWithDHCP(uint8_t *mac, unsigned long timeout, unsigned long
8788
return request_DHCP_lease();
8889
}
8990

90-
/////////////////////////////////////////////////////////
91+
////////////////////////////////////////
9192

9293
void DhcpClass::reset_DHCP_lease()
9394
{
9495
// zero out _dhcpSubnetMask, _dhcpGatewayIp, _dhcpLocalIp, _dhcpDhcpServerIp, _dhcpDnsServerIp
9596
memset(_dhcpLocalIp, 0, 20);
9697
}
9798

98-
/////////////////////////////////////////////////////////
99+
////////////////////////////////////////
99100

100101
//return:0 on error, 1 if request is sent and response is received
101102
int DhcpClass::request_DHCP_lease()
@@ -207,13 +208,13 @@ int DhcpClass::request_DHCP_lease()
207208
return result;
208209
}
209210

210-
/////////////////////////////////////////////////////////
211+
////////////////////////////////////////
211212

212213
void DhcpClass::presend_DHCP()
213214
{
214215
}
215216

216-
/////////////////////////////////////////////////////////
217+
////////////////////////////////////////
217218

218219
void DhcpClass::send_DHCP_MESSAGE(uint8_t messageType, uint16_t secondsElapsed)
219220
{
@@ -352,7 +353,7 @@ void DhcpClass::send_DHCP_MESSAGE(uint8_t messageType, uint16_t secondsElapsed)
352353
_dhcpUdpSocket.endPacket();
353354
}
354355

355-
/////////////////////////////////////////////////////////
356+
////////////////////////////////////////
356357

357358
uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& transactionId)
358359
{
@@ -523,7 +524,7 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr
523524
return type;
524525
}
525526

526-
/////////////////////////////////////////////////////////
527+
////////////////////////////////////////
527528

528529
/*
529530
returns:
@@ -589,42 +590,42 @@ int DhcpClass::checkLease()
589590
return rc;
590591
}
591592

592-
/////////////////////////////////////////////////////////
593+
////////////////////////////////////////
593594

594595
IPAddress DhcpClass::getLocalIp()
595596
{
596597
return IPAddress(_dhcpLocalIp);
597598
}
598599

599-
/////////////////////////////////////////////////////////
600+
////////////////////////////////////////
600601

601602
IPAddress DhcpClass::getSubnetMask()
602603
{
603604
return IPAddress(_dhcpSubnetMask);
604605
}
605606

606-
/////////////////////////////////////////////////////////
607+
////////////////////////////////////////
607608

608609
IPAddress DhcpClass::getGatewayIp()
609610
{
610611
return IPAddress(_dhcpGatewayIp);
611612
}
612613

613-
/////////////////////////////////////////////////////////
614+
////////////////////////////////////////
614615

615616
IPAddress DhcpClass::getDhcpServerIp()
616617
{
617618
return IPAddress(_dhcpDhcpServerIp);
618619
}
619620

620-
/////////////////////////////////////////////////////////
621+
////////////////////////////////////////
621622

622623
IPAddress DhcpClass::getDnsServerIp()
623624
{
624625
return IPAddress(_dhcpDnsServerIp);
625626
}
626627

627-
/////////////////////////////////////////////////////////
628+
////////////////////////////////////////
628629

629630
void DhcpClass::printByte(char * buf, uint8_t n )
630631
{
@@ -640,6 +641,6 @@ void DhcpClass::printByte(char * buf, uint8_t n )
640641
} while (n);
641642
}
642643

643-
/////////////////////////////////////////////////////////
644+
////////////////////////////////////////
644645

645646
#endif // ETHERNET_GENERIC_DHCP_IMPL_H

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.6.2
16+
Version: 2.7.0
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -31,6 +31,7 @@
3131
2.6.0 K Hoang 11/09/2022 Add support to AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
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
34+
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
3435
*****************************************************************************************************************************/
3536

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

src/Dns_Impl.h

Lines changed: 12 additions & 11 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.6.2
35+
Version: 2.7.0
3636
3737
Version Modified By Date Comments
3838
------- ----------- ---------- -----------
@@ -50,6 +50,7 @@
5050
2.6.0 K Hoang 11/09/2022 Add support to AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
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
53+
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
5354
*****************************************************************************************************************************/
5455
// Arduino DNS client for WizNet5100-based Ethernet shield
5556
// (c) Copyright 2009-2010 MCQN Ltd.
@@ -67,11 +68,11 @@
6768

6869
#include "utility/w5100.h"
6970

70-
/////////////////////////////////////////////////////////
71+
////////////////////////////////////////
7172

7273
#define SOCKET_NONE 255
7374

74-
/////////////////////////////////////////////////////////
75+
////////////////////////////////////////
7576

7677
// Various flags and header field values for a DNS message
7778
#define UDP_HEADER_SIZE 8
@@ -99,12 +100,12 @@
99100
#define CLASS_IN (0x0001)
100101
#define LABEL_COMPRESSION_MASK (0xC0)
101102

102-
/////////////////////////////////////////////////////////
103+
////////////////////////////////////////
103104

104105
// Port number that DNS servers listen on
105106
#define DNS_PORT 53
106107

107-
/////////////////////////////////////////////////////////
108+
////////////////////////////////////////
108109

109110
// Possible return codes from ProcessResponse
110111
#define SUCCESS 1
@@ -113,15 +114,15 @@
113114
#define TRUNCATED -3
114115
#define INVALID_RESPONSE -4
115116

116-
/////////////////////////////////////////////////////////
117+
////////////////////////////////////////
117118

118119
void DNSClient::begin(const IPAddress& aDNSServer)
119120
{
120121
iDNSServer = aDNSServer;
121122
iRequestId = 0;
122123
}
123124

124-
/////////////////////////////////////////////////////////
125+
////////////////////////////////////////
125126

126127
int DNSClient::inet_aton(const char* address, IPAddress& result)
127128
{
@@ -171,7 +172,7 @@ int DNSClient::inet_aton(const char* address, IPAddress& result)
171172
return 1;
172173
}
173174

174-
/////////////////////////////////////////////////////////
175+
////////////////////////////////////////
175176

176177
int DNSClient::getHostByName(const char* aHostname, IPAddress& aResult, uint16_t timeout)
177178
{
@@ -235,7 +236,7 @@ int DNSClient::getHostByName(const char* aHostname, IPAddress& aResult, uint16_t
235236
return ret;
236237
}
237238

238-
/////////////////////////////////////////////////////////
239+
////////////////////////////////////////
239240

240241
uint16_t DNSClient::BuildRequest(const char* aName)
241242
{
@@ -320,7 +321,7 @@ uint16_t DNSClient::BuildRequest(const char* aName)
320321
return 1;
321322
}
322323

323-
/////////////////////////////////////////////////////////
324+
////////////////////////////////////////
324325

325326
uint16_t DNSClient::ProcessResponse(uint16_t aTimeout, IPAddress& aAddress)
326327
{
@@ -504,6 +505,6 @@ uint16_t DNSClient::ProcessResponse(uint16_t aTimeout, IPAddress& aAddress)
504505
return -10; //INVALID_RESPONSE;
505506
}
506507

507-
/////////////////////////////////////////////////////////
508+
////////////////////////////////////////
508509

509510
#endif // ETHERNET_GENERIC_DNS_IMPL_H

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.6.2
16+
Version: 2.7.0
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -31,6 +31,7 @@
3131
2.6.0 K Hoang 11/09/2022 Add support to AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
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
34+
2.7.0 K Hoang 14/11/2022 Fix severe limitation to permit sending larger data than 2/4/8/16K buffer
3435
*****************************************************************************************************************************/
3536
// This file is in the public domain. No copyright is claimed.
3637

0 commit comments

Comments
 (0)