more ESP32 stuff

This commit is contained in:
Links
2018-02-06 21:36:44 +01:00
parent d340c89b09
commit f62aa6478d
2 changed files with 5 additions and 8 deletions

View File

@ -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;

View File

@ -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()
@ -78,7 +78,7 @@
// max size of the WS Message Header // max size of the WS Message Header
#define WEBSOCKETS_MAX_HEADER_SIZE (14) #define WEBSOCKETS_MAX_HEADER_SIZE (14)
#if !defined(WEBSOCKETS_NETWORK_TYPE) #if !defined(WEBSOCKETS_NETWORK_TYPE)
// select Network type based // select Network type based
#if defined(ESP8266) || defined(ESP31B) #if defined(ESP8266) || defined(ESP31B)
#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266 #define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266
@ -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