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