From 7c5113fe2dbe86fceec21b2846652d26de866234 Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 27 Dec 2016 14:16:12 +0100 Subject: [PATCH 1/3] fix #154 - _fingerprint not declared in this scope fix #154 - _fingerprint not declared in this scope --- src/WebSocketsClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WebSocketsClient.cpp b/src/WebSocketsClient.cpp index 3a0a039..d398aad 100644 --- a/src/WebSocketsClient.cpp +++ b/src/WebSocketsClient.cpp @@ -40,8 +40,10 @@ WebSocketsClient::~WebSocketsClient() { void WebSocketsClient::begin(const char *host, uint16_t port, const char * url) { _host = host; _port = port; +#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) _fingerprint = ""; - +#endif + _client.num = 0; _client.status = WSC_NOT_CONNECTED; _client.tcp = NULL; From 3f5c7e1c46ef3487c1fc4ae3018925ba5f4d0ea9 Mon Sep 17 00:00:00 2001 From: Links Date: Sat, 19 May 2018 19:26:12 +0200 Subject: [PATCH 2/3] add travis build test --- .travis.yml | 39 ++++++++++++++ .../WebSocketClientAVR/WebSocketClientAVR.ino | 0 .../WebSocketClient/WebSocketClient.ino | 0 .../WebSocketClientSSL/WebSocketClientSSL.ino | 0 .../WebSocketServer/WebSocketServer.ino | 0 .../WebSocketServer_LEDcontrol.ino | 0 travis/common.sh | 53 +++++++++++++++++++ 7 files changed, 92 insertions(+) create mode 100644 .travis.yml rename examples/{ => avr}/WebSocketClientAVR/WebSocketClientAVR.ino (100%) rename examples/{ => esp8266}/WebSocketClient/WebSocketClient.ino (100%) rename examples/{ => esp8266}/WebSocketClientSSL/WebSocketClientSSL.ino (100%) rename examples/{ => esp8266}/WebSocketServer/WebSocketServer.ino (100%) rename examples/{ => esp8266}/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino (100%) create mode 100644 travis/common.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1bada79 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,39 @@ +sudo: false +language: bash +os: + - linux +env: + matrix: + - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80" IDE_VERSION=1.6.5 + - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,FlashSize=1M0,FlashMode=qio,FlashFreq=80" IDE_VERSION=1.8.5 + - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,Debug=Serial1" IDE_VERSION=1.6.5 + - CPU="avr" BOARD="arduino:avr:mega:cpu=atmega2560" IDE_VERSION=1.6.5 + +script: + - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 + - sleep 3 + - export DISPLAY=:1.0 + - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz + - tar xf arduino-$IDE_VERSION-linux64.tar.xz + - mv arduino-$IDE_VERSION $HOME/arduino_ide + - export PATH="$HOME/arduino_ide:$PATH" + - which arduino + - mkdir -p $HOME/Arduino/libraries + - cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/arduinoWebSockets + - source $TRAVIS_BUILD_DIR/travis/common.sh + - get_core $CPU + - cd $TRAVIS_BUILD_DIR + - arduino --board $BOARD --save-prefs + - arduino --get-pref sketchbook.path + - build_sketches arduino $HOME/Arduino/libraries/arduinoWebSockets/examples/$CPU $CPU + +notifications: + email: + on_success: change + on_failure: change + webhooks: + urls: + - https://webhooks.gitter.im/e/1aa78fbe15080b0c2e37 + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: false # default: false diff --git a/examples/WebSocketClientAVR/WebSocketClientAVR.ino b/examples/avr/WebSocketClientAVR/WebSocketClientAVR.ino similarity index 100% rename from examples/WebSocketClientAVR/WebSocketClientAVR.ino rename to examples/avr/WebSocketClientAVR/WebSocketClientAVR.ino diff --git a/examples/WebSocketClient/WebSocketClient.ino b/examples/esp8266/WebSocketClient/WebSocketClient.ino similarity index 100% rename from examples/WebSocketClient/WebSocketClient.ino rename to examples/esp8266/WebSocketClient/WebSocketClient.ino diff --git a/examples/WebSocketClientSSL/WebSocketClientSSL.ino b/examples/esp8266/WebSocketClientSSL/WebSocketClientSSL.ino similarity index 100% rename from examples/WebSocketClientSSL/WebSocketClientSSL.ino rename to examples/esp8266/WebSocketClientSSL/WebSocketClientSSL.ino diff --git a/examples/WebSocketServer/WebSocketServer.ino b/examples/esp8266/WebSocketServer/WebSocketServer.ino similarity index 100% rename from examples/WebSocketServer/WebSocketServer.ino rename to examples/esp8266/WebSocketServer/WebSocketServer.ino diff --git a/examples/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino b/examples/esp8266/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino similarity index 100% rename from examples/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino rename to examples/esp8266/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino diff --git a/travis/common.sh b/travis/common.sh new file mode 100644 index 0000000..be959fa --- /dev/null +++ b/travis/common.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +function build_sketches() +{ + local arduino=$1 + local srcpath=$2 + local platform=$3 + local sketches=$(find $srcpath -name *.ino) + for sketch in $sketches; do + local sketchdir=$(dirname $sketch) + if [[ -f "$sketchdir/.$platform.skip" ]]; then + echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; + continue + fi + echo -e "\n\n ------------ Building $sketch ------------ \n\n"; + $arduino --verify $sketch; + local result=$? + if [ $result -ne 0 ]; then + echo "Build failed ($sketch) build verbose..." + $arduino --verify --verbose --preserve-temp-files $sketch + result=$? + fi + if [ $result -ne 0 ]; then + echo "Build failed ($1) $sketch" + return $result + fi + done +} + + +function get_core() +{ + echo Setup core for $1 + + cd $HOME/arduino_ide/hardware + + if [ "$1" = "esp8266" ] ; then + mkdir esp8266com + cd esp8266com + git clone https://github.com/esp8266/Arduino.git esp8266 + cd esp8266/tools + python get.py + fi + + if [ "$1" = "esp32" ] ; then + mkdir espressif + cd espressif + git clone https://github.com/espressif/arduino-esp32.git esp32 + cd esp32/tools + python get.py + fi + +} From 82e3c570069e92af7e1b58afc8e9bb120b0fddf3 Mon Sep 17 00:00:00 2001 From: Niklas04 <33813894+Niklas04@users.noreply.github.com> Date: Tue, 9 Oct 2018 21:28:02 +0200 Subject: [PATCH 3/3] Update WebSocketsClient.cpp fix a issue relating to a comparison that fails due to capitalisation of the word --- src/WebSocketsClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSocketsClient.cpp b/src/WebSocketsClient.cpp index d398aad..dca8799 100644 --- a/src/WebSocketsClient.cpp +++ b/src/WebSocketsClient.cpp @@ -403,7 +403,7 @@ void WebSocketsClient::handleHeader(WSclient_t * client) { String headerValue = headerLine.substring(headerLine.indexOf(':') + 2); if(headerName.equalsIgnoreCase("Connection")) { - if(headerValue.indexOf("Upgrade") >= 0) { + if(headerValue.equalsIgnoreCase("Upgrade")) { client->cIsUpgrade = true; } } else if(headerName.equalsIgnoreCase("Upgrade")) {