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

Commit 191bdeb

Browse files
mathieucarbouOttoWintermoritzj29mhightower83jesserockz
authored
* Create fork for esphome * Correct ssl recv (#1) Co-authored-by: M Hightower <27247790+mhightower83@users.noreply.github.com> * Remove _tx_unsent_len (#3) * Bump version to v1.2.3 * Remove Arduino IDE support * Update library.json * Update README.md * Delete .travis.yml * Fix Github Action (#2) * Preparation for IPv6 support (#1) * Bump version to 2.0.0 * Fixing CI * Add back library.properties * Prepare move to https://github.com/ESP32Async --------- Co-authored-by: Otto Winter <otto@otto-winter.com> Co-authored-by: moritzj29 <18733473+moritzj29@users.noreply.github.com> Co-authored-by: M Hightower <27247790+mhightower83@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: Jimmy Hedman <jimmy.hedman@gmail.com>
1 parent 1547686 commit 191bdeb

File tree

12 files changed

+192
-165
lines changed

12 files changed

+192
-165
lines changed

.github/scripts/on-push.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ ! -z "$TRAVIS_BUILD_DIR" ]; then
77
export GITHUB_REPOSITORY="$TRAVIS_REPO_SLUG"
88
elif [ -z "$GITHUB_WORKSPACE" ]; then
99
export GITHUB_WORKSPACE="$PWD"
10-
export GITHUB_REPOSITORY="me-no-dev/ESPAsyncTCP"
10+
export GITHUB_REPOSITORY="ESP32Async/ESPAsyncTCP"
1111
fi
1212

1313
CHUNK_INDEX=$1
@@ -34,7 +34,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then
3434
build_sketches "$FQBN" "$GITHUB_WORKSPACE/examples"
3535
if [ ! "$OS_IS_WINDOWS" == "1" ]; then
3636
echo "Installing ESPAsyncWebServer ..."
37-
git clone https://github.com/me-no-dev/ESPAsyncWebServer "$ARDUINO_USR_PATH/libraries/ESPAsyncWebServer" > /dev/null 2>&1
37+
git clone https://github.com/ESP32Async/ESPAsyncWebServer "$ARDUINO_USR_PATH/libraries/ESPAsyncWebServer" > /dev/null 2>&1
3838

3939
echo "Installing ArduinoJson ..."
4040
git clone https://github.com/bblanchon/ArduinoJson "$ARDUINO_USR_PATH/libraries/ArduinoJson" > /dev/null 2>&1
@@ -53,8 +53,8 @@ else
5353

5454
if [[ "$OSTYPE" != "cygwin" ]] && [[ "$OSTYPE" != "msys" ]] && [[ "$OSTYPE" != "win32" ]]; then
5555
echo "Installing ESPAsyncWebServer ..."
56-
python -m platformio lib -g install https://github.com/me-no-dev/ESPAsyncWebServer.git > /dev/null 2>&1
57-
git clone https://github.com/me-no-dev/ESPAsyncWebServer "$HOME/ESPAsyncWebServer" > /dev/null 2>&1
56+
python -m platformio lib -g install https://github.com/ESP32Async/ESPAsyncWebServer.git > /dev/null 2>&1
57+
git clone https://github.com/ESP32Async/ESPAsyncWebServer "$HOME/ESPAsyncWebServer" > /dev/null 2>&1
5858

5959
echo "Installing ArduinoJson ..."
6060
python -m platformio lib -g install https://github.com/bblanchon/ArduinoJson.git > /dev/null 2>&1

.github/workflows/push.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
name: ESP Async TCP CI
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches:
6-
- master
7-
- release/*
86
pull_request:
97

108
jobs:
119

12-
build-arduino:
13-
name: Arduino on ${{ matrix.os }}
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: [ubuntu-latest, windows-latest, macOS-latest]
18-
steps:
19-
- uses: actions/checkout@v1
20-
- name: Build Tests
21-
run: bash ./.github/scripts/on-push.sh 0 1
22-
2310
build-pio:
2411
name: PlatformIO on ${{ matrix.os }}
2512
runs-on: ${{ matrix.os }}
2613
strategy:
2714
matrix:
2815
os: [ubuntu-latest, windows-latest, macOS-latest]
2916
steps:
30-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v3
18+
- uses: actions/cache@v3
19+
with:
20+
path: |
21+
~/.cache/pip
22+
~/.platformio/.cache
23+
key: ${{ runner.os }}-pio
24+
- uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.11'
27+
- name: Install PlatformIO Core
28+
run: pip install --upgrade platformio
3129
- name: Build Tests
3230
run: bash ./.github/scripts/on-push.sh 1 1

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.ESP32Async.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# ESPAsyncTCP
2+
3+
Discord Server: [https://discord.gg/X7zpGdyUcY](https://discord.gg/X7zpGdyUcY)
4+
5+
### Async TCP Library for ESP8266 Arduino
6+
7+
For ESP32 look [https://github.com/ESP32Async/AsyncTCP](https://github.com/ESP32Async/AsyncTCP)
8+
9+
This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP8266 MCUs.
10+
11+
This library is the base for [https://github.com/ESP32Async/ESPAsyncWebServer](https://github.com/ESP32Async/ESPAsyncWebServer)
12+
13+
## AsyncClient and AsyncServer
14+
The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.
15+
16+
## AsyncPrinter
17+
This class can be used to send data like any other ```Print``` interface (```Serial``` for example).
18+
The object then can be used outside of the Async callbacks (the loop) and receive asynchronously data using ```onData```. The object can be checked if the underlying ```AsyncClient```is connected, or hook to the ```onDisconnect``` callback.
19+
20+
## AsyncTCPbuffer
21+
This class is really similar to the ```AsyncPrinter```, but it differs in the fact that it can buffer some of the incoming data.
22+
23+
## SyncClient
24+
It is exactly what it sounds like. This is a standard, blocking TCP Client, similar to the one included in ```ESP8266WiFi```
25+
26+
## Libraries and projects that use AsyncTCP
27+
- [ESP Async Web Server](https://github.com/ESP32Async/ESPAsyncWebServer)
28+
- [Async MQTT client](https://github.com/marvinroger/async-mqtt-client)
29+
- [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets)
30+
- [ESP8266 Smart Home](https://github.com/baruch/esp8266_smart_home)
31+
- [KBox Firmware](https://github.com/sarfata/kbox-firmware)

README.md

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
1-
# ESPAsyncTCP
2-
[![Build Status](https://travis-ci.org/me-no-dev/ESPAsyncTCP.svg?branch=master)](https://travis-ci.org/me-no-dev/ESPAsyncTCP) ![](https://github.com/me-no-dev/ESPAsyncTCP/workflows/ESP%20Async%20TCP%20CI/badge.svg)
1+
![https://avatars.githubusercontent.com/u/195753706?s=96&v=4](https://avatars.githubusercontent.com/u/195753706?s=96&v=4)
32

4-
### Async TCP Library for ESP8266 Arduino
3+
# Project moved to [ESP32Async](https://github.com/organizations/ESP32Async) organization at [https://github.com/ESP32Async/ESPAsyncTCP](https://github.com/ESP32Async/ESPAsyncTCP)
54

6-
For ESP32 look [HERE](https://github.com/me-no-dev/AsyncTCP)
5+
Discord Server: [https://discord.gg/X7zpGdyUcY](https://discord.gg/X7zpGdyUcY)
76

8-
[![Join the chat at https://gitter.im/me-no-dev/ESPAsyncWebServer](https://badges.gitter.im/me-no-dev/ESPAsyncWebServer.svg)](https://gitter.im/me-no-dev/ESPAsyncWebServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7+
Please see the new links:
98

10-
This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP8266 MCUs.
11-
12-
This library is the base for [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)
13-
14-
## AsyncClient and AsyncServer
15-
The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.
16-
17-
## AsyncPrinter
18-
This class can be used to send data like any other ```Print``` interface (```Serial``` for example).
19-
The object then can be used outside of the Async callbacks (the loop) and receive asynchronously data using ```onData```. The object can be checked if the underlying ```AsyncClient```is connected, or hook to the ```onDisconnect``` callback.
20-
21-
## AsyncTCPbuffer
22-
This class is really similar to the ```AsyncPrinter```, but it differs in the fact that it can buffer some of the incoming data.
23-
24-
## SyncClient
25-
It is exactly what it sounds like. This is a standard, blocking TCP Client, similar to the one included in ```ESP8266WiFi```
26-
27-
## Libraries and projects that use AsyncTCP
28-
- [ESP Async Web Server](https://github.com/me-no-dev/ESPAsyncWebServer)
29-
- [Async MQTT client](https://github.com/marvinroger/async-mqtt-client)
30-
- [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets)
31-
- [ESP8266 Smart Home](https://github.com/baruch/esp8266_smart_home)
32-
- [KBox Firmware](https://github.com/sarfata/kbox-firmware)
9+
- `ESP32Async/ESPAsyncWebServer @ 3.6.0` (ESP32, ESP8266, RP2040)
10+
- `ESP32Async/AsyncTCP @ 3.3.2` (ESP32)
11+
- `ESP32Async/ESPAsyncTCP @ 2.0.0` (ESP8266)
12+
- `https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip` (AsyncTCP alternative for ESP32)
13+
- `khoih-prog/AsyncTCP_RP2040W @ 1.2.0` (RP2040)

library.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44
"keywords":"async,tcp",
55
"authors":
66
{
7-
"name": "Hristo Gochkov",
7+
"name": "ESP32Async",
88
"maintainer": true
99
},
1010
"repository":
1111
{
1212
"type": "git",
13-
"url": "https://github.com/me-no-dev/ESPAsyncTCP.git"
13+
"url": "https://github.com/ESP32Async/ESPAsyncTCP.git"
1414
},
15-
"version": "1.2.2",
15+
"version": "2.0.0",
1616
"license": "LGPL-3.0",
1717
"frameworks": "arduino",
18-
"platforms": "espressif8266",
19-
"build": {
20-
"libCompatMode": 2
21-
}
18+
"platforms": "espressif8266"
2219
}

library.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=ESP AsyncTCP
2-
version=1.2.2
3-
author=Me-No-Dev
4-
maintainer=Me-No-Dev
2+
version=2.0.0
3+
author=ESP32Async
4+
maintainer=ESP32Async
55
sentence=Async TCP Library for ESP8266 and ESP31B
66
paragraph=Async TCP Library for ESP8266 and ESP31B
77
category=Other
8-
url=https://github.com/me-no-dev/ESPAsyncTCP
8+
url=https://github.com/ESP32Async/ESPAsyncTCP
99
architectures=*

src/DebugPrintMacros.h

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,34 @@ inline struct _DEBUG_TIME_STAMP debugTimeStamp(void) {
2727
}
2828
#endif
2929

30+
#if defined(DEBUG_ESP_PORT) && !defined(DEBUG_ESP_PORT_PRINTF)
31+
32+
#ifdef __cplusplus
33+
#define DEBUG_ESP_PORT_PRINTF(format, ...) DEBUG_ESP_PORT.printf((format), ##__VA_ARGS__)
34+
#define DEBUG_ESP_PORT_PRINTF_F(format, ...) DEBUG_ESP_PORT.printf_P(PSTR(format), ##__VA_ARGS__)
35+
#define DEBUG_ESP_PORT_FLUSH DEBUG_ESP_PORT.flush
36+
#else
37+
// Handle debug printing from .c without CPP Stream, Print, ... classes
38+
// Cannot handle flash strings in this setting
39+
#define DEBUG_ESP_PORT_PRINTF ets_uart_printf
40+
#define DEBUG_ESP_PORT_PRINTF_F ets_uart_printf
41+
#define DEBUG_ESP_PORT_FLUSH (void)0
42+
#endif
43+
44+
#endif
45+
3046
#if defined(DEBUG_ESP_PORT) && !defined(DEBUG_GENERIC)
3147
#define DEBUG_GENERIC( module, format, ... ) \
3248
do { \
3349
struct _DEBUG_TIME_STAMP st = debugTimeStamp(); \
34-
DEBUG_ESP_PORT.printf( DEBUG_TIME_STAMP_FMT module " " format, st.whole, st.dec, ##__VA_ARGS__ ); \
50+
DEBUG_ESP_PORT_PRINTF( (DEBUG_TIME_STAMP_FMT module " " format), st.whole, st.dec, ##__VA_ARGS__ ); \
3551
} while(false)
3652
#endif
37-
#if defined(DEBUG_ESP_PORT) && !defined(DEBUG_GENERIC_P)
38-
#define DEBUG_GENERIC_P( module, format, ... ) \
53+
#if defined(DEBUG_ESP_PORT) && !defined(DEBUG_GENERIC_F)
54+
#define DEBUG_GENERIC_F( module, format, ... ) \
3955
do { \
4056
struct _DEBUG_TIME_STAMP st = debugTimeStamp(); \
41-
DEBUG_ESP_PORT.printf_P(PSTR( DEBUG_TIME_STAMP_FMT module " " format ), st.whole, st.dec, ##__VA_ARGS__ ); \
57+
DEBUG_ESP_PORT_PRINTF_F( (DEBUG_TIME_STAMP_FMT module " " format), st.whole, st.dec, ##__VA_ARGS__ ); \
4258
} while(false)
4359
#endif
4460

@@ -47,16 +63,16 @@ inline struct _DEBUG_TIME_STAMP debugTimeStamp(void) {
4763
do { \
4864
if ( !(a) ) { \
4965
DEBUG_GENERIC( module, "%s:%s:%u: ASSERT("#a") failed!\n", __FILE__, __func__, __LINE__); \
50-
DEBUG_ESP_PORT.flush(); \
66+
DEBUG_ESP_PORT_FLUSH(); \
5167
} \
5268
} while(false)
5369
#endif
54-
#if defined(DEBUG_GENERIC_P) && !defined(ASSERT_GENERIC_P)
55-
#define ASSERT_GENERIC_P( a, module ) \
70+
#if defined(DEBUG_GENERIC_F) && !defined(ASSERT_GENERIC_F)
71+
#define ASSERT_GENERIC_F( a, module ) \
5672
do { \
5773
if ( !(a) ) { \
58-
DEBUG_GENERIC_P( module, "%s:%s:%u: ASSERT("#a") failed!\n", __FILE__, __func__, __LINE__); \
59-
DEBUG_ESP_PORT.flush(); \
74+
DEBUG_GENERIC_F( module, "%s:%s:%u: ASSERT("#a") failed!\n", __FILE__, __func__, __LINE__); \
75+
DEBUG_ESP_PORT_FLUSH(); \
6076
} \
6177
} while(false)
6278
#endif
@@ -65,32 +81,32 @@ inline struct _DEBUG_TIME_STAMP debugTimeStamp(void) {
6581
#define DEBUG_GENERIC(...) do { (void)0;} while(false)
6682
#endif
6783

68-
#ifndef DEBUG_GENERIC_P
69-
#define DEBUG_GENERIC_P(...) do { (void)0;} while(false)
84+
#ifndef DEBUG_GENERIC_F
85+
#define DEBUG_GENERIC_F(...) do { (void)0;} while(false)
7086
#endif
7187

7288
#ifndef ASSERT_GENERIC
7389
#define ASSERT_GENERIC(...) do { (void)0;} while(false)
7490
#endif
7591

76-
#ifndef ASSERT_GENERIC_P
77-
#define ASSERT_GENERIC_P(...) do { (void)0;} while(false)
92+
#ifndef ASSERT_GENERIC_F
93+
#define ASSERT_GENERIC_F(...) do { (void)0;} while(false)
7894
#endif
7995

8096
#ifndef DEBUG_ESP_PRINTF
81-
#define DEBUG_ESP_PRINTF( format, ...) DEBUG_GENERIC_P("[%s]", format, &_FILENAME_[1], ##__VA_ARGS__)
97+
#define DEBUG_ESP_PRINTF( format, ...) DEBUG_GENERIC_F("[%s]", format, &_FILENAME_[1], ##__VA_ARGS__)
8298
#endif
8399

84100
#if defined(DEBUG_ESP_ASYNC_TCP) && !defined(ASYNC_TCP_DEBUG)
85-
#define ASYNC_TCP_DEBUG( format, ...) DEBUG_GENERIC_P("[ASYNC_TCP]", format, ##__VA_ARGS__)
101+
#define ASYNC_TCP_DEBUG( format, ...) DEBUG_GENERIC_F("[ASYNC_TCP]", format, ##__VA_ARGS__)
86102
#endif
87103

88104
#ifndef ASYNC_TCP_ASSERT
89-
#define ASYNC_TCP_ASSERT( a ) ASSERT_GENERIC_P( (a), "[ASYNC_TCP]")
105+
#define ASYNC_TCP_ASSERT( a ) ASSERT_GENERIC_F( (a), "[ASYNC_TCP]")
90106
#endif
91107

92108
#if defined(DEBUG_ESP_TCP_SSL) && !defined(TCP_SSL_DEBUG)
93-
#define TCP_SSL_DEBUG( format, ...) DEBUG_GENERIC_P("[TCP_SSL]", format, ##__VA_ARGS__)
109+
#define TCP_SSL_DEBUG( format, ...) DEBUG_GENERIC_F("[TCP_SSL]", format, ##__VA_ARGS__)
94110
#endif
95111

96112
#endif //_DEBUG_PRINT_MACROS_H

0 commit comments

Comments
 (0)