Feature:Intregados

This commit is contained in:
semarnat committed 2026-05-22 16:54:55 -06:00
1 parent c1d1f8c8f2
commit aa6f246490
5 files changed
+8 -6

No files matched your search

-1
View File
@@ -3,5 +3,4 @@
#include "Arduino.h"
#include <WebSocketsServer.h>
extern volatile bool websocket_connected;
void webSocketEvent( uint8_t num, WStype_t type, uint8_t * payload, size_t length );
+3
View File
@@ -4,6 +4,9 @@
#include "Network.h"
#include <WiFi.h>
extern volatile bool websocket_connected;
class wifi_conf {
private:
const char* _ssid;
-5
View File
@@ -1,17 +1,12 @@
#include "WebSocketHandler.h"
extern volatile bool websocket_connected;
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_CONNECTED:
websocket_connected = true;
Serial.printf("[%u] Cliente conectado\n", num);
break;
case WStype_DISCONNECTED:
websocket_connected = false;
Serial.printf("[%u] Cliente desconectado\n", num);
break;
+4
View File
@@ -1,10 +1,13 @@
#include "WiFiConf.h"
extern volatile bool websocket_connected;
void wifi_conf::handler_WiFi(arduino_event_id_t event, arduino_event_info_t info) {
switch(event){
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
websocket_connected = true;
Serial.printf("Wi-Fi conectado\n");
break;
@@ -13,6 +16,7 @@ void wifi_conf::handler_WiFi(arduino_event_id_t event, arduino_event_info_t info
break;
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
websocket_connected = false;
Serial.printf("WiFi: Desconectado\n");
Serial.printf("DEBUG: Reconectando...\n");
+1
View File
@@ -71,6 +71,7 @@ void ADCTask(void *parameter){
vTaskDelay(pdMS_TO_TICKS(100));
continue;
}
const uint32_t count = adc1_3.read(samples_buffer);
if (count > 0) {
if (xRingbufferSend(bufferHandle, samples_buffer, count * sizeof(uint16_t), pdMS_TO_TICKS(1000)) != pdTRUE) {