8000 Merge remote-tracking branch 'remotes/me-no-dev/async' into async · houcy/arduinoWebSockets@632ee13 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 632ee13

Browse files
committed
Merge remote-tracking branch 'remotes/me-no-dev/async' into async
2 parents 629f524 + 512e3f6 commit 632ee13

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/WebSockets.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
#define WEBSOCKETS_MAX_HEADER_SIZE (14)
5454

5555
// select Network type based
56-
#ifdef ESP8266
57-
#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266
58-
//#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266_ASYNC
56+
#if defined(ESP8266) || defined(ESP31B)
57+
//#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266
58+
#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266_ASYNC
5959
#else
6060
#define WEBSOCKETS_NETWORK_TYPE NETWORK_W5100
6161
#endif
@@ -66,23 +66,31 @@
6666
// No SSL/WSS support for client in Async mode
6767
// TLS lib need a sync interface!
6868

69-
#ifndef ESP8266
69+
#if !defined(ESP8266) && !defined(ESP31B)
7070
#error "network type ESP8266 ASYNC only possible on the ESP mcu!"
7171
#endif
7272

73+
#ifdef ESP8266
7374
#include <ESP8266WiFi.h>
75+
#else
76+
#include <ESP31BWiFi.h>
77+
#endif
7478
#include <ESPAsyncTCP.h>
7579
#include <ESPAsyncTCPbuffer.h>
7680
#define WEBSOCKETS_NETWORK_CLASS AsyncTCPbuffer
7781
#define WEBSOCKETS_NETWORK_SERVER_CLASS AsyncServer
7882

7983
#elif (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266)
8084

81-
#ifndef ESP8266
85+
#if !defined(ESP8266) && !defined(ESP31B)
8286
#error "network type ESP8266 only possible on the ESP mcu!"
8387
#endif
8488

89+
#ifdef ESP8266
8590
#include <ESP8266WiFi.h>
91+
#else
92+
#include <ESP31BWiFi.h>
93+
#endif
8694
#define WEBSOCKETS_NETWORK_CLASS WiFiClient
8795
#define WEBSOCKETS_NETWORK_SERVER_CLASS WiFiServer
8896

0 commit comments

Comments
 (0)
0