From 102abd142f9c82a1fbc592cea2357f6bb9d7db9d Mon Sep 17 00:00:00 2001 From: Nikita Romanenko Date: Wed, 13 Dec 2017 19:12:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20webSocket=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/main.cpp | 25 ++----------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index ab6078a..8b38ea3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .vscode/c_cpp_properties.json lib lib/readme.txt +docs diff --git a/src/main.cpp b/src/main.cpp index b0df99c..20c461c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,6 +59,7 @@ int lowFreqFilter(int inputValue, int lastFilteredValue, int alpha) { return (lastFilteredValue + alpha * (inputValue - lastFilteredValue)+100); } +// TODO: необходимо перекомпоновать функцию updateAccelerometer() void updateAccelerometer() { if ((millis() - accelerometer.lastUpdate) > (1000 / graphAcc.graphUpdateRate)) @@ -117,24 +118,6 @@ void sendAccelerometerData() { } } -//** WEBSOCKET TEST **// -void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length) -{ - switch (type) - { - case WStype_DISCONNECTED: - Serial.printf("[%u] Disconnected!\n", num); - break; - case WStype_CONNECTED: - { - IPAddress ip = webSocket.remoteIP(num); - Serial.println("Client connected!"); - Serial.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); - } - break; - } -} -//** WEBSOCKET TEST END**// void setup(void) { @@ -157,12 +140,8 @@ void setup(void) server.begin(); Serial.println("HTTP server started"); - - //** WEBSOCKET TEST **// - + webSocket.begin(); - webSocket.onEvent(webSocketEvent); - //** WEBSOCKET TEST END**// } void loop(void)