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

Commit 17a8d44

Browse files
committed
Add support for Arduino 3.0.0
1 parent f71e3d4 commit 17a8d44

5 files changed

+20
-3
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
1414
},
15-
"version": "1.2.3",
15+
"version": "1.2.4",
1616
"license": "LGPL-3.0",
1717
"frameworks": "arduino",
1818
"platforms": ["espressif8266", "espressif32"],

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP Async WebServer
2-
version=1.2.3
2+
version=1.2.4
33
author=Me-No-Dev
44
maintainer=Me-No-Dev
55
sentence=Async Web Server for ESP8266 and ESP31B

src/AsyncEventSource.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
*/
2020
#include "Arduino.h"
2121
#include "AsyncEventSource.h"
22+
#ifdef ESP32
23+
#if ESP_IDF_VERSION_MAJOR >= 5
24+
#include "rom/ets_sys.h"
25+
#endif
26+
#endif
2227

2328
static String generateEventMessage(const char *message, const char *event, uint32_t id, uint32_t reconnect){
2429
String ev = "";

src/AsyncWebSocket.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer)
829829

830830
IPAddress AsyncWebSocketClient::remoteIP() {
831831
if(!_client) {
832-
return IPAddress(0U);
832+
return IPAddress((uint32_t)0U);
833833
}
834834
return _client->remoteIP();
835835
}
@@ -1259,9 +1259,15 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String& key, AsyncWebSocket
12591259
(String&)key += WS_STR_UUID;
12601260
mbedtls_sha1_context ctx;
12611261
mbedtls_sha1_init(&ctx);
1262+
#if ESP_IDF_VERSION_MAJOR < 5
12621263
mbedtls_sha1_starts_ret(&ctx);
12631264
mbedtls_sha1_update_ret(&ctx, (const unsigned char*)key.c_str(), key.length());
12641265
mbedtls_sha1_finish_ret(&ctx, hash);
1266+
#else
1267+
mbedtls_sha1_starts(&ctx);
1268+
mbedtls_sha1_update(&ctx, (const unsigned char*)key.c_str(), key.length());
1269+
mbedtls_sha1_finish(&ctx, hash);
1270+
#endif
12651271
mbedtls_sha1_free(&ctx);
12661272
#endif
12671273
base64_encodestate _state;

src/WebAuthentication.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo
7171
memset(_buf, 0x00, 16);
7272
#ifdef ESP32
7373
mbedtls_md5_init(&_ctx);
74+
#if ESP_IDF_VERSION_MAJOR < 5
7475
mbedtls_md5_starts_ret(&_ctx);
7576
mbedtls_md5_update_ret(&_ctx, data, len);
7677
mbedtls_md5_finish_ret(&_ctx, _buf);
78+
#else
79+
mbedtls_md5_starts(&_ctx);
80+
mbedtls_md5_update(&_ctx, data, len);
81+
mbedtls_md5_finish(&_ctx, _buf);
82+
#endif
7783
#else
7884
MD5Init(&_ctx);
7985
MD5Update(&_ctx, data, len);

0 commit comments

Comments
 (0)