mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-17 01:02:05 +02:00
more ESP32 stuff
This commit is contained in:
@ -14,22 +14,20 @@
|
||||
#elif defined(ESP32)
|
||||
#include <WiFi.h>
|
||||
#include <WiFiMulti.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
WiFiMulti WiFiMulti;
|
||||
|
||||
HardwareSerial Serial1(2);
|
||||
#endif
|
||||
|
||||
#include <WebSocketsClient.h>
|
||||
|
||||
#include <Hash.h>
|
||||
|
||||
WebSocketsClient webSocket;
|
||||
|
||||
#define USE_SERIAL Serial1
|
||||
|
||||
#ifndef ESP8266
|
||||
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
|
||||
#endif
|
||||
|
||||
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
|
||||
|
||||
switch(type) {
|
||||
@ -103,7 +101,6 @@ void loop() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef ESP8266
|
||||
void hexdump(const void *mem, uint32_t len, uint8_t cols) {
|
||||
const uint8_t* src = (const uint8_t*) mem;
|
||||
|
@ -48,7 +48,7 @@
|
||||
#define NODEBUG_WEBSOCKETS
|
||||
#endif
|
||||
|
||||
#ifdef ESP8266
|
||||
#if defined(ESP8266) || defined(ESP32)
|
||||
#define WEBSOCKETS_MAX_DATA_SIZE (15*1024)
|
||||
#define WEBSOCKETS_USE_BIG_MEM
|
||||
#define GET_FREE_HEAP ESP.getFreeHeap()
|
||||
@ -78,7 +78,7 @@
|
||||
// max size of the WS Message Header
|
||||
#define WEBSOCKETS_MAX_HEADER_SIZE (14)
|
||||
|
||||
#if !defined(WEBSOCKETS_NETWORK_TYPE)
|
||||
#if !defined(WEBSOCKETS_NETWORK_TYPE)
|
||||
// select Network type based
|
||||
#if defined(ESP8266) || defined(ESP31B)
|
||||
#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266
|
||||
@ -97,7 +97,7 @@
|
||||
// No SSL/WSS support for client in Async mode
|
||||
// TLS lib need a sync interface!
|
||||
|
||||
#if !defined(ESP8266) && !defined(ESP31B)
|
||||
#if !defined(ESP8266) && !defined(ESP31B) && !defined(ESP32)
|
||||
#error "network type ESP8266 ASYNC only possible on the ESP mcu!"
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user