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

Commit ce88b0f

Browse files
authored
v1.4.0 to use Ethernet_Generic library
### Releases v1.4.0 1. Use new [Ethernet_Generic library](https://github.com/khoih-prog/Ethernet_Generic) as default for W5x00. 2. Rewrite all the examples to support new features 3. Add example [multiFileProject](examples/multiFileProject) to demo how to avoid `multiple-definitions` linker error for multiple-file project
1 parent f078993 commit ce88b0f

27 files changed

+611
-570
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.19
3030
STM32F7 Nucleo-144 NUCLEO_F767ZI, STM32 core v2.2.0
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered a crash while trying to use the Timer Interrupt.
@@ -49,3 +49,4 @@ There are usually some outstanding feature requests in the [existing issues list
4949
### Sending Pull Requests
5050

5151
Pull Requests with changes and fixes are also welcome!
52+

README.md

Lines changed: 111 additions & 208 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.4.0](#releases-v140)
1516
* [Releases v1.3.4](#releases-v134)
1617
* [Releases v1.3.3](#releases-v133)
1718
* [Releases v1.3.2](#releases-v132)
@@ -33,6 +34,12 @@
3334

3435
## Changelog
3536

37+
### Releases v1.4.0
38+
39+
1. Use new [Ethernet_Generic library](https://github.com/khoih-prog/Ethernet_Generic) as default for W5x00.
40+
2. Rewrite all the examples to support new features
41+
3. Add example [multiFileProject](examples/multiFileProject) to demo how to avoid `multiple-definitions` linker error for multiple-file project
42+
3643
### Releases v1.3.4
3744

3845
1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](https://github.com/khoih-prog/WiFiWebServer/issues/17)

library.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "EthernetWebServer_STM32",
3-
"version": "1.3.4",
3+
"version": "1.4.0",
44
"keywords": "WebServer, built-in-Ethernet, STM32F, STM32L, STM32H, STM32G, STM32WB, STM32MP1, Ethernet-shield, Nucleo-144, Nucleo-64, Nucleo-32, LAN8742A, LAN8720, ENC28J60, W5x00, W5500, W5100, Ethernet, Ethernet2, Ethernet3, EthernetLarge, EtnernetENC, UIPEthernet, HTTP-Client, WebSocket-Client, server, client, websocket",
5-
"description": "Simple Ethernet WebServer, HTTP Client and WebSocket Client library for STM32F/L/H/G/WB/MP1 boards running built-in Ethernet LAN8742A, LAN8720 or Ethernet W5x00, ENC28J60 shields",
5+
"description": "Simple Ethernet WebServer, HTTP Client and WebSocket Client library for STM32F/L/H/G/WB/MP1 boards running built-in Ethernet LAN8742A, LAN8720 or Ethernet W5x00, ENC28J60 shields. Ethernet_Generic library is used as default for W5x00",
66
"authors":
77
{
88
"name": "Khoi Hoang",
@@ -40,10 +40,15 @@
4040
"owner": "khoih-prog",
4141
"name": "Functional-Vlpp",
4242
"version": "^1.0.2"
43+
},
44+
{
45+
"owner": "khoih-prog",
46+
"name": "Ethernet_Generic",
47+
"version": "^2.0.0"
4348
}
4449
],
4550
"frameworks": "arduino",
4651
"platforms": "ststm32",
4752
"examples": "examples/*/*/*.ino",
48-
"headers": ["EthernetWebServer_STM32.h", "EthernetHttpClient_STM32.h"]
53+
"headers": ["EthernetWebServer_STM32.h", "EthernetWebServer_STM32.hpp", "EthernetHttpClient_STM32.h"]
4954
}

library.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name=EthernetWebServer_STM32
2-
version=1.3.4
2+
version=1.4.0
33
author=Khoi Hoang
44
license=MIT
55
maintainer=Khoi Hoang <khoih.prog@gmail.com>
66
sentence=EthernetWebServer_STM32 is a simple Ethernet WebServer, HTTP Client and WebSocket Client library for STM32F/L/H/G/WB/MP1 boards using built-in Ethernet LAN8742A, LAN8720, Ethernet W5x00 or ENC28J60 shields
7-
paragraph=The library supports HTTP GET and POST requests, provides argument parsing, handles one client at a time. It now provides HTTP Client and WebSocket Client. It supports Arduino STM32F/L/H/G/WB/MP1 series with 32+ Kbytes of Flash, using built-in Ethernet (Nucleo-144: F429ZI, F767ZI, Discovery: STM32F746G-DISCOVERY), or LAN8720, ENC28J60, W5x00 Ethernet shields.
7+
paragraph=The library supports HTTP GET and POST requests, provides argument parsing, handles one client at a time. It now provides HTTP Client and WebSocket Client. It supports Arduino STM32F/L/H/G/WB/MP1 series with 32+ Kbytes of Flash, using built-in Ethernet (Nucleo-144: F429ZI, F767ZI, Discovery: STM32F746G-DISCOVERY), or LAN8720, ENC28J60, W5x00 Ethernet shields. Ethernet_Generic library is used as default for W5x00
88
category=Communication
99
url=https://github.com/khoih-prog/EthernetWebServer_STM32
1010
architectures=stm32
11-
depends=STM32duino LwIP,STM32duino STM32Ethernet,Functional-Vlpp
12-
includes=EthernetWebServer_STM32.h,EthernetHttpClient_STM32.h
11+
depends=STM32duino LwIP, STM32duino STM32Ethernet, Functional-Vlpp, Ethernet_Generic
12+
includes=EthernetWebServer_STM32.h, EthernetWebServer_STM32.hpp, EthernetHttpClient_STM32.h

platformio/platformio.ini

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,27 @@ lib_compat_mode = strict
3131

3232
lib_deps =
3333
; PlatformIO 4.x
34-
STM32duino LwIP@~2.1.2
35-
STM32duino STM32Ethernet@~1.2.0
36-
Functional-Vlpp@~1.0.2
37-
UIPEthernet@~2.0.9
38-
Ethernet@~2.0.0
39-
EthernetLarge@~2.0.0
40-
Ethernet2@~1.0.4
41-
Ethernet3@~1.5.5
34+
; STM32duino LwIP@~2.1.2
35+
; STM32duino STM32Ethernet@~1.2.0
36+
; Functional-Vlpp@~1.0.2
37+
; UIPEthernet@~2.0.9
38+
; Ethernet_Generic>=2.0.0
39+
; Ethernet@~2.0.0
40+
; EthernetLarge@~2.0.0
41+
; Ethernet2@~1.0.4
42+
; Ethernet3@~1.5.5
4243
EthernetENC@~2.0.2
4344
; PlatformIO 5.x
44-
; stm32duino/STM32duino LwIP@~2.1.2
45-
; stm32duino/STM32duino STM32Ethernet@~1.2.0
46-
; khoih-prog/Functional-Vlpp@~1.0.2
47-
; UIPEthernet/UIPEthernet@~2.0.9
45+
stm32duino/STM32duino LwIP@~2.1.2
46+
stm32duino/STM32duino STM32Ethernet@~1.2.0
47+
khoih-prog/Functional-Vlpp@~1.0.2
48+
khoih-prog/Ethernet_Generic@~2.0.0
49+
UIPEthernet/UIPEthernet@~2.0.9
4850
; PaulStoffregen/Ethernet@~2.0.0
4951
; PaulStoffregen/EthernetLarge@~2.0.0
5052
; adafruit/Ethernet2@~1.0.4
5153
; sstaub/Ethernet3@~1.5.5
52-
; jandrassy/EthernetENC@~2.0.2
54+
jandrassy/EthernetENC@~2.0.2
5355

5456
build_flags =
5557
; set your build_flags

src/EthernetHttpClient_STM32.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************************************************************
2-
EthernetHttpClient.h - Dead simple HTTP WebClient.
2+
EthernetHttpClient_STM32.h - Dead simple HTTP WebClient.
33
For STM32 with built-in Ethernet LAN8742A (Nucleo-144, DISCOVERY, etc) or W5x00/ENC28J60 shield/module
44
55
EthernetWebServer_STM32 is a library for the STM32 running Ethernet WebServer
@@ -12,7 +12,7 @@
1212
@file Esp8266WebServer.h
1313
@author Ivan Grokhotkov
1414
15-
Version: 1.3.4
15+
Version: 1.4.0
1616
1717
Version Modified By Date Comments
1818
------- ----------- ---------- -----------
@@ -23,6 +23,7 @@
2323
1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64
2424
1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning
2525
1.3.4 K Hoang 02/03/2022 Fix decoding error bug
26+
1.4.0 K Hoang 04/04/2022 Use Ethernet_Generic library as default for W5x00 Ethernet.
2627
*************************************************************************************************************************************/
2728

2829
// Library to simplify HTTP fetching on Arduino
@@ -31,10 +32,15 @@
3132

3233
#pragma once
3334

35+
#ifndef ETHERNET_HTTP_CLIENT_STM32_H
36+
#define ETHERNET_HTTP_CLIENT_STM32_H
37+
3438
#include <Arduino.h>
3539

3640
#include "detail/Debug_STM32.h"
3741
#include "Ethernet_HTTPClient/Ethernet_HttpClient.h"
3842
#include "Ethernet_HTTPClient/Ethernet_WebSocketClient.h"
3943
#include "Ethernet_HTTPClient/Ethernet_URLEncoder.h"
4044

45+
#endif // ETHERNET_HTTP_CLIENT_STM32_H
46+

src/EthernetWebServer_STM32-impl.h

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************************************************************
2-
EthernetWebServer-impl.h - Dead simple web-server.
2+
EthernetWebServer_STM32-impl.h - Dead simple web-server.
33
For STM32 with built-in Ethernet LAN8742A (Nucleo-144, DISCOVERY, etc) or W5x00/ENC28J60 shield/module
44
55
EthernetWebServer_STM32 is a library for the STM32 running Ethernet WebServer
@@ -12,7 +12,7 @@
1212
@file Esp8266WebServer.h
1313
@author Ivan Grokhotkov
1414
15-
Version: 1.3.4
15+
Version: 1.4.0
1616
1717
Version Modified By Date Comments
1818
------- ----------- ---------- -----------
@@ -23,13 +23,17 @@
2323
1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64
2424
1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning
2525
1.3.4 K Hoang 02/03/2022 Fix decoding error bug
26+
1.4.0 K Hoang 04/04/2022 Use Ethernet_Generic library as default for W5x00 Ethernet.
2627
*************************************************************************************************************************************/
2728

2829
#pragma once
2930

31+
#ifndef ETHERNET_WEBSERVER_STM32_IMPL_H
32+
#define ETHERNET_WEBSERVER_STM32_IMPL_H
33+
3034
#include <Arduino.h>
3135
#include <libb64/cencode.h>
32-
#include "EthernetWebServer_STM32.h"
36+
#include "EthernetWebServer_STM32.hpp"
3337
#include "detail/RequestHandlersImpl_STM32.h"
3438
#include "detail/Debug_STM32.h"
3539
#include "detail/mimetable.h"
@@ -38,6 +42,30 @@ const char * AUTHORIZATION_HEADER = "Authorization";
3842

3943
// New to use EWString
4044

45+
/////////////////////////////////////////////////////////////////////////
46+
47+
EWString fromString(const String& str)
48+
{
49+
return str.c_str();
50+
}
51+
52+
EWString fromString(const String&& str)
53+
{
54+
return str.c_str();
55+
}
56+
57+
String fromEWString(const EWString& str)
58+
{
59+
return str.c_str();
60+
}
61+
62+
String fromEWString(const EWString&& str)
63+
{
64+
return str.c_str();
65+
}
66+
67+
/////////////////////////////////////////////////////////////////////////
68+
4169
EthernetWebServer::EthernetWebServer(int port)
4270
: _server(port)
4371
, _currentMethod(HTTP_ANY)
@@ -931,3 +959,4 @@ String EthernetWebServer::_responseCodeToString(int code)
931959
}
932960
}
933961

962+
#endif // ETHERNET_WEBSERVER_STM32_IMPL_H

0 commit comments

Comments
 (0)