Browse Source

Убрал события webSocket на сервере.

master
Nikita Romanenko 6 years ago
parent
commit
102abd142f
  1. 1
      .gitignore
  2. 25
      src/main.cpp

1
.gitignore

@ -3,3 +3,4 @@
.vscode/c_cpp_properties.json
lib
lib/readme.txt
docs

25
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)

Loading…
Cancel
Save