├── examples ├── WSClient_Python │ ├── WSClient.sh │ └── WSClient.py ├── Generic │ ├── Ethernet │ │ └── STM32 │ │ │ └── LAN8720 │ │ │ ├── STM32-Ethernet-Client_LAN8720 │ │ │ └── hal_conf_extra.h │ │ │ ├── STM32-Ethernet-Client_SINRIC_LAN8720 │ │ │ └── hal_conf_extra.h │ │ │ ├── STM32-Ethernet-Minimal-Client_LAN8720 │ │ │ └── hal_conf_extra.h │ │ │ └── STM32-Ethernet-RepeatingClient_LAN8720 │ │ │ └── hal_conf_extra.h │ ├── RP2040W │ │ ├── RP2040W-Client │ │ │ └── defines.h │ │ ├── RP2040W-Server │ │ │ └── defines.h │ │ ├── RP2040W-Client_SINRIC │ │ │ └── defines.h │ │ ├── RP2040W-Minimal-Client │ │ │ └── defines.h │ │ ├── RP2040W-RepeatingClient │ │ │ └── defines.h │ │ ├── RP2040W_ServerAllFunctionsDemo │ │ │ └── defines.h │ │ └── RP2040W-AdvancedWebServer │ │ │ └── defines.h │ ├── Portenta_H7 │ │ └── WiFi │ │ │ ├── Portenta_H7-Server │ │ │ └── defines.h │ │ │ ├── Portenta_H7-AdvancedWebServer │ │ │ └── defines.h │ │ │ ├── Portenta_H7_ServerAllFunctionsDemo │ │ │ └── defines.h │ │ │ ├── Portenta_H7-Client │ │ │ └── defines.h │ │ │ ├── Portenta_H7-RepeatingClient │ │ │ └── defines.h │ │ │ ├── Portenta_H7-Minimal-Client │ │ │ └── defines.h │ │ │ └── Portenta_H7-Client_SINRIC │ │ │ └── defines.h │ └── WiFiNINA │ │ └── RP2040 │ │ ├── RP2040-Server │ │ └── defines.h │ │ ├── RP2040-AdvancedWebServer │ │ └── defines.h │ │ ├── RP2040_ServerAllFunctionsDemo │ │ └── defines.h │ │ ├── RP2040-Client │ │ └── defines.h │ │ └── RP2040-RepeatingClient │ │ └── defines.h ├── ESP8266 │ ├── Esp8266-AdvancedWebServer │ │ └── defines.h │ ├── Esp8266-Server │ │ └── defines.h │ ├── Esp8266-RepeatingClient │ │ └── defines.h │ ├── Minimal-Esp8266-Client │ │ └── defines.h │ ├── Esp8266-Client │ │ └── defines.h │ ├── Secured-Esp8266-Client │ │ └── defines.h │ ├── ESP8266-Client_SINRIC │ │ └── defines.h │ ├── InSecured-Esp8266-Client │ │ └── defines.h │ └── SecuredTwoWay-Esp8266-Client │ │ └── defines.h ├── ESP32 │ ├── Esp32-AdvancedWebServer │ │ └── defines.h │ ├── Esp32-RepeatingClient │ │ └── defines.h │ ├── Minimal-Esp32-Client │ │ └── defines.h │ ├── Esp32-Client │ │ └── defines.h │ ├── Esp32-Server │ │ └── defines.h │ └── ESP32-Client_SINRIC │ │ └── defines.h └── WT32_ETH01 │ ├── WT32_ETH01_AdvancedWebServer │ └── defines.h │ ├── WT32_ETH01_Server │ └── defines.h │ ├── WT32_ETH01_MinimalClient │ └── defines.h │ ├── WT32_ETH01_RepeatingClient │ └── defines.h │ ├── WT32_ETH01_Client │ └── defines.h │ └── WT32_ETH01_Client_SINRIC │ └── defines.h ├── pics ├── W5100.jpg ├── W5500.jpg ├── W5500_1.jpg ├── ENC28J60.jpg ├── ICSP_connector.jpg ├── STM32F407VET6.png ├── ESP32_C3_Support.png ├── Portenta_Vision.jpg ├── Web_WS_Server_STM32.png ├── Web_WS_Server_ESP32-S2.png ├── Web_WS_Server_RP2040.png ├── Web_WS_Server_RP2040W.png ├── Web_WS_Server_WT32_ETH01.png ├── Web_WS_Server_Nano_33_IoT.png ├── Web_WS_Server_Portenta_H7.png └── SocketAndHttp_Teensy41_Server_QNEthernet.png ├── utils ├── restyle.sh └── astyle_library.conf ├── .codespellrc ├── .github ├── workflows │ ├── auto-github-actions.yml │ ├── report-size-deltas.yml │ ├── spell-check.yml │ └── check-arduino.yml ├── dependabot.yml ├── ISSUE_TEMPLATE │ └── feature_request.md └── stale.yml ├── .gitignore ├── Packages_Patches ├── arduino │ └── hardware │ │ └── mbed_portenta │ │ ├── 2.4.1 │ │ └── portenta_post_install.sh │ │ ├── 2.5.2 │ │ └── portenta_post_install.sh │ │ ├── 2.6.1 │ │ └── portenta_post_install.sh │ │ ├── 2.7.2 │ │ └── portenta_post_install.sh │ │ ├── 2.8.0 │ │ └── portenta_post_install.sh │ │ ├── 3.0.0 │ │ └── portenta_post_install.sh │ │ ├── 3.0.1 │ │ └── portenta_post_install.sh │ │ ├── 3.1.1 │ │ └── portenta_post_install.sh │ │ ├── 3.3.0 │ │ └── portenta_post_install.sh │ │ └── 3.4.1 │ │ └── portenta_post_install.sh ├── adafruit │ └── hardware │ │ └── nrf52 │ │ ├── 0.19.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ ├── 0.20.1 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ └── pins_arduino.h │ │ ├── 0.20.5 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ └── pins_arduino.h │ │ ├── 0.21.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ └── pins_arduino.h │ │ ├── 0.22.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ ├── 0.22.1 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ ├── 0.23.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ ├── 0.24.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ ├── 1.0.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ ├── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── sparkfun_nrf52840_mini │ │ │ └── variant.cpp │ │ ├── 1.1.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ ├── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── sparkfun_nrf52840_mini │ │ │ └── variant.cpp │ │ ├── 1.2.0 │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ ├── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ └── variant.cpp │ │ │ └── sparkfun_nrf52840_mini │ │ │ └── variant.cpp │ │ └── 1.3.0 │ │ └── variants │ │ ├── NINA_B112_ublox │ │ ├── pins_arduino.h │ │ └── variant.cpp │ │ ├── NINA_B302_ublox │ │ ├── pins_arduino.h │ │ └── variant.cpp │ │ └── sparkfun_nrf52840_mini │ │ └── variant.cpp └── Seeeduino │ └── hardware │ └── rp2040 │ └── 1.9.3 │ └── variants │ └── rpipico │ └── pins_arduino.h ├── LibraryPatches └── esp32 │ └── cores │ └── esp32 │ └── Server.h ├── library.properties ├── src └── Tiny_Websockets_Generic │ ├── network │ ├── windows │ │ ├── win_tcp_server.hpp │ │ └── win_tcp_client.hpp │ ├── linux │ │ ├── linux_tcp_server.hpp │ │ └── linux_tcp_client.hpp │ ├── tcp_socket.hpp │ ├── tcp_server.hpp │ └── tcp_client.hpp │ └── internals │ └── wscrypto │ └── crypto.hpp └── CONTRIBUTING.md /examples/WSClient_Python/WSClient.sh: -------------------------------------------------------------------------------- 1 | python3.8 WSClient.py 2 | -------------------------------------------------------------------------------- /pics/W5100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/W5100.jpg -------------------------------------------------------------------------------- /pics/W5500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/W5500.jpg -------------------------------------------------------------------------------- /pics/W5500_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/W5500_1.jpg -------------------------------------------------------------------------------- /pics/ENC28J60.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/ENC28J60.jpg -------------------------------------------------------------------------------- /pics/ICSP_connector.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/ICSP_connector.jpg -------------------------------------------------------------------------------- /pics/STM32F407VET6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/STM32F407VET6.png -------------------------------------------------------------------------------- /pics/ESP32_C3_Support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/ESP32_C3_Support.png -------------------------------------------------------------------------------- /pics/Portenta_Vision.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Portenta_Vision.jpg -------------------------------------------------------------------------------- /pics/Web_WS_Server_STM32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_STM32.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_ESP32-S2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_ESP32-S2.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_RP2040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_RP2040.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_RP2040W.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_RP2040W.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_WT32_ETH01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_WT32_ETH01.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_Nano_33_IoT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_Nano_33_IoT.png -------------------------------------------------------------------------------- /pics/Web_WS_Server_Portenta_H7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/Web_WS_Server_Portenta_H7.png -------------------------------------------------------------------------------- /pics/SocketAndHttp_Teensy41_Server_QNEthernet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WebSockets2_Generic/HEAD/pics/SocketAndHttp_Teensy41_Server_QNEthernet.png -------------------------------------------------------------------------------- /utils/restyle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for dir in . ; do 4 | find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.ino" \) -exec astyle --suffix=none --options=./utils/astyle_library.conf \{\} \; 5 | done 6 | 7 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | # See: https://github.com/codespell-project/codespell#using-a-config-file 2 | [codespell] 3 | # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: 4 | ignore-words-list = , 5 | check-filenames = 6 | check-hidden = 7 | skip = ./.git,./src,./examples,./Packages_Patches,./LibraryPatches 8 | -------------------------------------------------------------------------------- /.github/workflows/auto-github-actions.yml: -------------------------------------------------------------------------------- 1 | name: auto-github-actions 2 | on: [push] 3 | jobs: 4 | check-bats-version: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v3 8 | - uses: actions/setup-node@v3 9 | with: 10 | node-version: '14' 11 | - run: npm install -g bats 12 | - run: bats -v 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /.github/workflows/report-size-deltas.yml: -------------------------------------------------------------------------------- 1 | name: Report Size Deltas 2 | 3 | on: 4 | schedule: 5 | - cron: '*/5 * * * *' 6 | 7 | jobs: 8 | report: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Comment size deltas reports to PRs 13 | uses: arduino/report-size-deltas@v1 14 | with: 15 | # The name of the workflow artifact created by the "Compile Examples" workflow 16 | sketches-reports-source: sketches-reports 17 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file 2 | version: 2 3 | 4 | updates: 5 | # Configure check for outdated GitHub Actions actions in workflows. 6 | # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot 7 | - package-ecosystem: github-actions 8 | directory: / # Check the repository's workflows under /.github/workflows/ 9 | schedule: 10 | interval: daily 11 | -------------------------------------------------------------------------------- /.github/workflows/spell-check.yml: -------------------------------------------------------------------------------- 1 | name: Spell Check 2 | 3 | on: 4 | pull_request: 5 | push: 6 | schedule: 7 | # run every Tuesday at 3 AM UTC 8 | - cron: "0 3 * * 2" 9 | workflow_dispatch: 10 | repository_dispatch: 11 | 12 | jobs: 13 | spellcheck: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v3 19 | 20 | # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md 21 | - name: Spell check 22 | uses: codespell-project/actions-codespell@master 23 | -------------------------------------------------------------------------------- /examples/WSClient_Python/WSClient.py: -------------------------------------------------------------------------------- 1 | # Run by $ python3.8 WSClient.py 2 | # From websocket-client package. Install by $ pip3 install websocket-client 3 | import websocket 4 | import time 5 | 6 | ws = websocket.WebSocket() 7 | # For AsyncWebSockets 8 | #ws.connect("ws://192.168.2.118/ws") 9 | # For WebSockets2_Generic 10 | #ws.connect("ws://192.168.2.118:8080") 11 | 12 | while True: 13 | # For WebSockets2_Generic. Change according to your WS Server 14 | ws.connect("ws://192.168.2.118:8080") 15 | ws.send("Hello, Server") 16 | result = ws.recv() 17 | print(result) 18 | time.sleep(10) 19 | 20 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.4.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.5.2/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.7.2/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.8.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.0.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.0.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.1.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.3.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/check-arduino.yml: -------------------------------------------------------------------------------- 1 | name: Check Arduino 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | pull_request: 7 | schedule: 8 | # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. 9 | - cron: "0 8 * * TUE" 10 | workflow_dispatch: 11 | repository_dispatch: 12 | 13 | jobs: 14 | lint: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v3 20 | 21 | - name: Arduino Lint 22 | uses: arduino/arduino-lint-action@v1 23 | with: 24 | compliance: specification 25 | library-manager: update 26 | # Always use this setting for official repositories. Remove for 3rd party projects. 27 | official: true 28 | project-type: library 29 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-stale - https://github.com/probot/stale 2 | 3 | daysUntilStale: 60 4 | daysUntilClose: 14 5 | limitPerRun: 30 6 | staleLabel: stale 7 | exemptLabels: 8 | - pinned 9 | - security 10 | - "to be implemented" 11 | - "for reference" 12 | - "move to PR" 13 | - "enhancement" 14 | 15 | only: issues 16 | onlyLabels: [] 17 | exemptProjects: false 18 | exemptMilestones: false 19 | exemptAssignees: false 20 | 21 | markComment: > 22 | [STALE_SET] This issue has been automatically marked as stale because it has not had 23 | recent activity. It will be closed in 14 days if no further activity occurs. Thank you 24 | for your contributions. 25 | 26 | unmarkComment: > 27 | [STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it opening the future. 28 | 29 | closeComment: > 30 | [STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. 31 | 32 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /examples/Generic/Ethernet/STM32/LAN8720/STM32-Ethernet-Client_LAN8720/hal_conf_extra.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | hal_conf_extra.h 3 | 4 | For STM32 with LAN8720 (STM32F4/F7) or built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc) 5 | 6 | AsyncWebServer_STM32 is a library for the STM32 run LAN8720 or built-in LAN8742A Ethernet WebServer 7 | 8 | Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer) 9 | Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32 10 | Licensed under MIT license 11 | *****************************************************************************************************************************/ 12 | 13 | // Note: Must replace 14 | // .arduino15/packages/STM32/hardware/stm32/1.9.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h 15 | // as described in README.md 16 | 17 | #pragma once 18 | 19 | #ifndef HAL_CONF_EXTRA_STM32_H 20 | #define HAL_CONF_EXTRA_STM32_H 21 | 22 | #define HAL_ETH_MODULE_ENABLED 23 | 24 | #define LAN8742A_PHY_ADDRESS 0x01U 25 | 26 | #endif // HAL_CONF_EXTRA_STM32_H 27 | -------------------------------------------------------------------------------- /examples/Generic/Ethernet/STM32/LAN8720/STM32-Ethernet-Client_SINRIC_LAN8720/hal_conf_extra.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | hal_conf_extra.h 3 | 4 | For STM32 with LAN8720 (STM32F4/F7) or built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc) 5 | 6 | AsyncWebServer_STM32 is a library for the STM32 run LAN8720 or built-in LAN8742A Ethernet WebServer 7 | 8 | Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer) 9 | Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32 10 | Licensed under MIT license 11 | *****************************************************************************************************************************/ 12 | 13 | // Note: Must replace 14 | // .arduino15/packages/STM32/hardware/stm32/1.9.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h 15 | // as described in README.md 16 | 17 | #pragma once 18 | 19 | #ifndef HAL_CONF_EXTRA_STM32_H 20 | #define HAL_CONF_EXTRA_STM32_H 21 | 22 | #define HAL_ETH_MODULE_ENABLED 23 | 24 | #define LAN8742A_PHY_ADDRESS 0x01U 25 | 26 | #endif // HAL_CONF_EXTRA_STM32_H 27 | -------------------------------------------------------------------------------- /examples/Generic/Ethernet/STM32/LAN8720/STM32-Ethernet-Minimal-Client_LAN8720/hal_conf_extra.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | hal_conf_extra.h 3 | 4 | For STM32 with LAN8720 (STM32F4/F7) or built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc) 5 | 6 | AsyncWebServer_STM32 is a library for the STM32 run LAN8720 or built-in LAN8742A Ethernet WebServer 7 | 8 | Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer) 9 | Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32 10 | Licensed under MIT license 11 | *****************************************************************************************************************************/ 12 | 13 | // Note: Must replace 14 | // .arduino15/packages/STM32/hardware/stm32/1.9.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h 15 | // as described in README.md 16 | 17 | #pragma once 18 | 19 | #ifndef HAL_CONF_EXTRA_STM32_H 20 | #define HAL_CONF_EXTRA_STM32_H 21 | 22 | #define HAL_ETH_MODULE_ENABLED 23 | 24 | #define LAN8742A_PHY_ADDRESS 0x01U 25 | 26 | #endif // HAL_CONF_EXTRA_STM32_H 27 | -------------------------------------------------------------------------------- /examples/Generic/Ethernet/STM32/LAN8720/STM32-Ethernet-RepeatingClient_LAN8720/hal_conf_extra.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | hal_conf_extra.h 3 | 4 | For STM32 with LAN8720 (STM32F4/F7) or built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc) 5 | 6 | AsyncWebServer_STM32 is a library for the STM32 run LAN8720 or built-in LAN8742A Ethernet WebServer 7 | 8 | Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer) 9 | Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32 10 | Licensed under MIT license 11 | *****************************************************************************************************************************/ 12 | 13 | // Note: Must replace 14 | // .arduino15/packages/STM32/hardware/stm32/1.9.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h 15 | // as described in README.md 16 | 17 | #pragma once 18 | 19 | #ifndef HAL_CONF_EXTRA_STM32_H 20 | #define HAL_CONF_EXTRA_STM32_H 21 | 22 | #define HAL_ETH_MODULE_ENABLED 23 | 24 | #define LAN8742A_PHY_ADDRESS 0x01U 25 | 26 | #endif // HAL_CONF_EXTRA_STM32_H 27 | -------------------------------------------------------------------------------- /LibraryPatches/esp32/cores/esp32/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server: public Print 26 | { 27 | public: 28 | // KH, change to fix compiler error for EthernetWebServer 29 | // error: cannot declare field 'EthernetWebServer::_server' to be of abstract type 'EthernetServer' 30 | // virtual void begin(uint16_t port=0) =0; 31 | //virtual void begin() = 0; 32 | void begin() {}; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /examples/ESP8266/Esp8266-AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | const uint16_t websockets_server_port = 8080; // Enter server port 36 | 37 | #endif //defines_h 38 | -------------------------------------------------------------------------------- /examples/ESP8266/Esp8266-Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | #define WEBSOCKETS_PORT 8080 36 | 37 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 38 | 39 | #endif //defines_h 40 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=WebSockets2_Generic 2 | version=1.13.2 3 | author=Gil Maimon , Khoi Hoang 4 | maintainer=Khoi Hoang 5 | sentence=A WebSocket Server and Client library for Arduino, based on RFC6455, for writing modern Websockets applications. 6 | paragraph=Featuring modern callbacks (supports lambdas) and a minimal interface. Contains a websockets Client and Server. Supports all features of the RFC6455 (pings, pongs, binary and text data, error codes) and WSS (Websockets over SSL). Now support ESP8266, ESP32 (including ESP32-C3; ESP32-S2 Saola, AI-Thinker ESP-12K, WT32_ETH01, etc.), nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, Teensy, RP2040-based, Portenta_H7, etc. boards, with WiFiNINA, Teensy 4.1 NativeEthernet/QNEthernet, Ethernet W5x00/ENC28J60/LAN8742A/LAN8720, ESP8266/ESP32-AT modules/shields, Portenta_H7 WiFi/Ethernet, as well as SINRIC / Alexa / Google Home. With updated SSL CA Certs, Fingerprint and InSecure mode. Now supporting ENC28J60 using either UIPEthernet or EthernetENC library, ESP32 using Ethernet and RP2-4-W using CYW43439 WiFi 7 | category=Communication 8 | url=https://github.com/khoih-prog/WebSockets2_Generic 9 | license=GPLv3 10 | architectures=* 11 | depends=WiFiNINA_Generic, WiFiWebServer, EthernetWebServer, WebServer_WT32_ETH01, EthernetWebServer_STM32, DoubleResetDetector_Generic, SinricPro_Generic, FlashStorage_SAMD, FlashStorage_STM32, Ethernet_Generic, WiFi101_Generic 12 | includes=WebSockets2_Generic.h 13 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-Client_SINRIC/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-Minimal-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W_ServerAllFunctionsDemo/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | const char* ssid = "ssid"; //Enter SSID 36 | const char* pass = "password"; //Enter Password 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /utils/astyle_library.conf: -------------------------------------------------------------------------------- 1 | # Code formatting rules for Arduino libraries, modified from for KH libraries: 2 | # 3 | # https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf 4 | # 5 | 6 | # astyle --style=allman -s2 -t2 -C -S -xW -Y -M120 -f -p -xg -H -xb -c --xC120 -xL *.h *.cpp *.ino 7 | 8 | --mode=c 9 | --lineend=linux 10 | --style=allman 11 | 12 | # -r or -R 13 | #--recursive 14 | 15 | # -c => Converts tabs into spaces 16 | convert-tabs 17 | 18 | # -s2 => 2 spaces indentation 19 | --indent=spaces=2 20 | 21 | # -t2 => tab =2 spaces 22 | #--indent=tab=2 23 | 24 | # -C 25 | --indent-classes 26 | 27 | # -S 28 | --indent-switches 29 | 30 | # -xW 31 | --indent-preproc-block 32 | 33 | # -Y => indent classes, switches (and cases), comments starting at column 1 34 | --indent-col1-comments 35 | 36 | # -M120 => maximum of 120 spaces to indent a continuation line 37 | --max-continuation-indent=120 38 | 39 | # -xC120 => max‑code‑length will break a line if the code exceeds # characters 40 | --max-code-length=120 41 | 42 | # -f => 43 | --break-blocks 44 | 45 | # -p => put a space around operators 46 | --pad-oper 47 | 48 | # -xg => Insert space padding after commas 49 | --pad-comma 50 | 51 | # -H => put a space after if/for/while 52 | pad-header 53 | 54 | # -xb => Break one line headers (e.g. if/for/while) 55 | --break-one-line-headers 56 | 57 | # -c => Converts tabs into spaces 58 | #--convert-tabs 59 | 60 | # if you like one-liners, keep them 61 | #keep-one-line-statements 62 | 63 | # -xV 64 | --attach-closing-while 65 | 66 | #unpad-paren 67 | 68 | # -xp 69 | remove-comment-prefix 70 | 71 | -------------------------------------------------------------------------------- /examples/ESP8266/Esp8266-RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 36 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 37 | 38 | #define WEBSOCKETS_PORT 8080 39 | 40 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 41 | 42 | #endif //defines_h 43 | -------------------------------------------------------------------------------- /examples/ESP8266/Minimal-Esp8266-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP8266 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 36 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 37 | 38 | #define WEBSOCKETS_PORT 8080 39 | 40 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 41 | 42 | #endif //defines_h 43 | -------------------------------------------------------------------------------- /examples/Generic/RP2040W/RP2040W-AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040W with CYW43439 WiFi. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) ) 19 | #if defined(WEBSOCKETS_USE_RP2040W) 20 | #undef WEBSOCKETS_USE_RP2040W 21 | #endif 22 | #define WEBSOCKETS_USE_RP2040W true 23 | #define USE_RP2040W_WIFI true 24 | #define USE_WIFI_NINA false 25 | #else 26 | #error This code is intended to run only on the RP2040W boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #include 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | 35 | char ssid[] = "your_ssid"; // your network SSID (name) 36 | char pass[] = "12345678"; // your network password (use for WPA, or use as key for WEP), length must be 8+ 37 | 38 | #endif //defines_h 39 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /examples/ESP8266/Esp8266-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 4 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | //const char* websockets_server_host = "192.168.2.95"; //Enter server address 36 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 37 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 38 | 39 | #define WEBSOCKETS_PORT 80 //8080 40 | 41 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 42 | 43 | #endif //defines_h 44 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/windows/win_tcp_server.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | win_tcp_server.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | *****************************************************************************************************************************/ 13 | 14 | #pragma once 15 | 16 | #ifdef _WIN32 17 | 18 | #include 19 | #include 20 | 21 | #define WIN32_LEAN_AND_MEAN 22 | 23 | #undef _WIN32_WINNT 24 | #define _WIN32_WINNT 0x501 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | namespace websockets2_generic 33 | { 34 | namespace network2_generic 35 | { 36 | class WinTcpServer : public TcpServer 37 | { 38 | public: 39 | bool listen(uint16_t port) override; 40 | TcpClient* accept() override; 41 | bool available() override; 42 | bool poll() override; 43 | void close() override; 44 | virtual ~WinTcpServer(); 45 | 46 | protected: 47 | int getSocket() const override; 48 | 49 | private: 50 | SOCKET socket; 51 | }; 52 | } // namespace network2_generic 53 | } // namespace websockets2_generic 54 | 55 | 56 | #endif // #ifdef _WIN32 57 | -------------------------------------------------------------------------------- /examples/ESP8266/Secured-Esp8266-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for Secured-ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | // Deprecated echo.websocket.org to be replaced or it won't work 36 | const char* websockets_connection_string = "wss://echo.websocket.org/"; //Enter server adress 37 | 38 | // To update SHA1 fingerprint, use Google Chrome to connect to https://www.websocket.org/echo.html 39 | // Then "View Site Information" => "Certificate Viewer" => Copy SHA1 fingerprint 40 | // KH, This SHA1 fingerprint was updated 15.04.2021, 41 | // Issued on Mar 15th 2021, expired on June 13th 2021 42 | const char echo_org_ssl_fingerprint[] PROGMEM = "34 A2 66 08 A1 4D 1E 83 1A 0E 49 3C 4A 84 45 9E 4A 0D 08 FE"; 43 | 44 | #endif //defines_h 45 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/linux/linux_tcp_server.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | linux_tcp_server.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | *****************************************************************************************************************************/ 13 | 14 | #pragma once 15 | 16 | #ifdef __linux__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #define DEFAULT_BACKLOG_SIZE 5 23 | 24 | namespace websockets2_generic 25 | { 26 | namespace network2_generic 27 | { 28 | class LinuxTcpServer : public TcpServer 29 | { 30 | public: 31 | LinuxTcpServer(size_t backlog = DEFAULT_BACKLOG_SIZE) : _num_backlog(backlog) {} 32 | bool listen(const uint16_t port) override; 33 | bool poll() override; 34 | TcpClient* accept() override; 35 | bool available() override; 36 | void close() override; 37 | virtual ~LinuxTcpServer(); 38 | 39 | protected: 40 | virtual int getSocket() const override 41 | { 42 | return _socket; 43 | } 44 | 45 | private: 46 | int _socket; 47 | size_t _num_backlog; 48 | }; 49 | } // namespace network2_generic 50 | } // namespace websockets2_generic 51 | 52 | #endif // #ifdef __linux__ 53 | -------------------------------------------------------------------------------- /examples/ESP32/Esp32-AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For nRF52 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | *****************************************************************************************************************************/ 13 | 14 | #ifndef defines_h 15 | #define defines_h 16 | 17 | #if !( defined(ESP8266) || defined(ESP32) ) 18 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 19 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 20 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 21 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 22 | #define BOARD_TYPE "ESP32-S2" 23 | #elif ( ARDUINO_ESP32C3_DEV ) 24 | #warning Using ESP32-C3 boards 25 | #define BOARD_TYPE "ESP32-C3" 26 | #else 27 | #define BOARD_TYPE "ESP32" 28 | #endif 29 | 30 | #ifndef BOARD_NAME 31 | #define BOARD_NAME BOARD_TYPE 32 | #endif 33 | 34 | #define DEBUG_WEBSOCKETS_PORT Serial 35 | // Debug Level from 0 to 4 36 | #define _WEBSOCKETS_LOGLEVEL_ 3 37 | 38 | const char* ssid = "ssid"; //Enter SSID 39 | const char* password = "password"; //Enter Password 40 | 41 | const uint16_t websockets_server_port = 8080; // Enter server port 42 | 43 | // Select the IP address according to your local network 44 | IPAddress serverIP(192, 168, 2, 95); 45 | 46 | IPAddress static_GW(192, 168, 2, 1); 47 | IPAddress static_SN(255, 255, 255, 0); 48 | 49 | #endif //defines_h 50 | -------------------------------------------------------------------------------- /examples/ESP32/Esp32-RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP32. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | *****************************************************************************************************************************/ 11 | 12 | #ifndef defines_h 13 | #define defines_h 14 | 15 | #if !( defined(ESP8266) || defined(ESP32) ) 16 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 17 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 18 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 19 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 20 | #define BOARD_TYPE "ESP32-S2" 21 | #elif ( ARDUINO_ESP32C3_DEV ) 22 | #warning Using ESP32-C3 boards 23 | #define BOARD_TYPE "ESP32-C3" 24 | #else 25 | #define BOARD_TYPE "ESP32" 26 | #endif 27 | 28 | #ifndef BOARD_NAME 29 | #define BOARD_NAME BOARD_TYPE 30 | #endif 31 | 32 | #define DEBUG_WEBSOCKETS_PORT Serial 33 | // Debug Level from 0 to 4 34 | #define _WEBSOCKETS_LOGLEVEL_ 3 35 | 36 | // Uncomment to test sending WS headers in lower-case 37 | #define WS_HEADERS_NORMAL_CASE false 38 | 39 | const char* ssid = "ssid"; //Enter SSID 40 | const char* password = "password"; //Enter Password 41 | 42 | 43 | const char* websockets_server_host = "192.168.2.127"; //Enter server address 44 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 45 | 46 | #define WEBSOCKETS_PORT 8080 47 | 48 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 49 | 50 | #endif //defines_h 51 | -------------------------------------------------------------------------------- /examples/ESP32/Minimal-Esp32-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP32. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if !( defined(ESP8266) || defined(ESP32) ) 19 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 20 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 21 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 22 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 23 | #define BOARD_TYPE "ESP32-S2" 24 | #elif ( ARDUINO_ESP32C3_DEV ) 25 | #warning Using ESP32-C3 boards 26 | #define BOARD_TYPE "ESP32-C3" 27 | #else 28 | #define BOARD_TYPE "ESP32" 29 | #endif 30 | 31 | #ifndef BOARD_NAME 32 | #define BOARD_NAME BOARD_TYPE 33 | #endif 34 | 35 | #define DEBUG_WEBSOCKETS_PORT Serial 36 | // Debug Level from 0 to 4 37 | #define _WEBSOCKETS_LOGLEVEL_ 3 38 | 39 | const char* ssid = "ssid"; //Enter SSID 40 | const char* password = "password"; //Enter Password 41 | 42 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 43 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 44 | 45 | #define WEBSOCKETS_PORT 8080 46 | 47 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 48 | 49 | #endif //defines_h 50 | -------------------------------------------------------------------------------- /examples/ESP8266/ESP8266-Client_SINRIC/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP8266, using SINRIC (https://sinric.com/) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | #define SINRIC_WEBSERVER "iot.sinric.com" 36 | #define SINRIC_WEBSERVER_PORT 80 37 | #define SINRIC_API_KEY "11111111-2222-3333-4444-555555555555" 38 | 39 | #define SINRIC_Device_ID_1 "012345678901234567890123" // Device ID, got from Sinric 40 | 41 | const char* websockets_server_host = SINRIC_WEBSERVER; //Enter server address 42 | const uint16_t websockets_server_port = SINRIC_WEBSERVER_PORT; // Enter server port 43 | 44 | #ifdef LED_BUILTIN 45 | #define LED_PIN LED_BUILTIN 46 | #else 47 | #define LED_PIN 2 48 | #endif 49 | 50 | // Reversed logic 51 | #define LED_BUILTIN_ON LOW 52 | #define LED_BUILTIN_OFF HIGH 53 | 54 | #endif //defines_h 55 | -------------------------------------------------------------------------------- /examples/ESP8266/InSecured-Esp8266-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for Secured-ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | // Deprecated echo.websocket.org to be replaced or it won't work 36 | const char* websockets_connection_string = "wss://echo.websocket.org/"; //Enter server adress 37 | 38 | #define USING_INSECURE_MODE true 39 | 40 | #if ! (USING_INSECURE_MODE) 41 | // To update SHA1 fingerprint, use Google Chrome to connect to https://www.websocket.org/echo.html 42 | // Then "View Site Information" => "Certificate Viewer" => Copy SHA1 fingerprint 43 | // KH, This SHA1 fingerprint was updated 15.04.2021, 44 | // Issued on Mar 15th 2021, expired on June 13th 2021 45 | const char echo_org_ssl_fingerprint[] PROGMEM = "34 A2 66 08 A1 4D 1E 83 1A 0E 49 3C 4A 84 45 9E 4A 0D 08 FE"; 46 | #endif 47 | 48 | #endif //defines_h 49 | -------------------------------------------------------------------------------- /examples/ESP32/Esp32-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP32-Client.ino 3 | For ESP32. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if !( defined(ESP8266) || defined(ESP32) ) 19 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 20 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 21 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 22 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 23 | #define BOARD_TYPE "ESP32-S2" 24 | #elif ( ARDUINO_ESP32C3_DEV ) 25 | #warning Using ESP32-C3 boards 26 | #define BOARD_TYPE "ESP32-C3" 27 | #else 28 | #define BOARD_TYPE "ESP32" 29 | #endif 30 | 31 | #ifndef BOARD_NAME 32 | #define BOARD_NAME BOARD_TYPE 33 | #endif 34 | 35 | #define DEBUG_WEBSOCKETS_PORT Serial 36 | // Debug Level from 0 to 4 37 | #define _WEBSOCKETS_LOGLEVEL_ 3 38 | 39 | const char* ssid = "ssid"; //Enter SSID 40 | const char* password = "password"; //Enter Password 41 | 42 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 43 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 44 | 45 | #define WEBSOCKETS_PORT 8080 46 | 47 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 48 | 49 | #endif //defines_h 50 | -------------------------------------------------------------------------------- /examples/ESP32/Esp32-Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For ESP32 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if !( defined(ESP8266) || defined(ESP32) ) 19 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 20 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 21 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 22 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 23 | #define BOARD_TYPE "ESP32-S2" 24 | #elif ( ARDUINO_ESP32C3_DEV ) 25 | #warning Using ESP32-C3 boards 26 | #define BOARD_TYPE "ESP32-C3" 27 | #else 28 | #define BOARD_TYPE "ESP32" 29 | #endif 30 | 31 | #ifndef BOARD_NAME 32 | #define BOARD_NAME BOARD_TYPE 33 | #endif 34 | 35 | #define DEBUG_WEBSOCKETS_PORT Serial 36 | // Debug Level from 0 to 4 37 | #define _WEBSOCKETS_LOGLEVEL_ 4 38 | 39 | const char* ssid = "ssid"; //Enter SSID 40 | const char* password = "password"; //Enter Password 41 | 42 | #define WEBSOCKETS_PORT 8080 43 | 44 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 45 | 46 | // Select the IP address according to your local network 47 | IPAddress serverIP(192, 168, 2, 95); 48 | 49 | IPAddress static_GW(192, 168, 2, 1); 50 | IPAddress static_SN(255, 255, 255, 0); 51 | 52 | #endif //defines_h 53 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | 58 | #define WEBSOCKETS_PORT 8080 59 | 60 | #endif //defines_h 61 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 2 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | #include 38 | 39 | const uint16_t websockets_server_port = 8080; // Enter server port 40 | 41 | // Select the IP address according to your local network 42 | IPAddress serverIP(192, 168, 2, 95); 43 | 44 | IPAddress static_GW(192, 168, 2, 1); 45 | IPAddress static_SN(255, 255, 255, 0); 46 | 47 | // Google DNS Server IP 48 | IPAddress myDNS(8, 8, 8, 8); 49 | 50 | #endif //defines_h 51 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | const uint16_t websockets_server_port = 8080; // Enter server port 58 | 59 | #endif //defines_h 60 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7_ServerAllFunctionsDemo/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | const uint16_t websockets_server_port = 8080; // Enter server port 58 | 59 | #endif //defines_h 60 | -------------------------------------------------------------------------------- /Packages_Patches/Seeeduino/hardware/rp2040/1.9.3/variants/rpipico/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Pin definitions taken from: 4 | // https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf 5 | 6 | //KH 7 | // Pin count 8 | // ---- 9 | #define PINS_COUNT (30u) 10 | #define NUM_DIGITAL_PINS (30u) 11 | #define NUM_ANALOG_INPUTS (4u) 12 | #define NUM_ANALOG_OUTPUTS (0u) 13 | ////// 14 | 15 | // LEDs 16 | #define PIN_LED (25u) 17 | #define PIN_LED_0 (16u) 18 | #define PIN_LED_1 (17u) 19 | #define PIN_LED_2 (18u) 20 | // Serial 21 | #define PIN_SERIAL1_TX (0u) 22 | #define PIN_SERIAL1_RX (1u) 23 | 24 | #define PIN_SERIAL2_TX (31u) 25 | #define PIN_SERIAL2_RX (31u) 26 | 27 | 28 | // SPI 29 | #define PIN_SPI0_MISO (4u) 30 | #define PIN_SPI0_MOSI (3u) 31 | #define PIN_SPI0_SCK (2u) 32 | #define PIN_SPI0_SS (5u) 33 | 34 | // static const int SS = PIN_SPI0_SS; // SPI Slave SS not used. Set here only for reference. 35 | // static const int MOSI = PIN_SPI0_MOSI; 36 | // static const int MISO = PIN_SPI0_MISO; 37 | // static const int SCK = PIN_SPI0_SCK; 38 | 39 | #define PIN_SPI1_MISO (12u) 40 | #define PIN_SPI1_MOSI (31u) 41 | #define PIN_SPI1_SCK (31u) 42 | #define PIN_SPI1_SS (31u) 43 | // static const int MISO_1 = PIN_SPI1_MISO; 44 | 45 | #define PIN_A0 (26u) 46 | #define PIN_A1 (27u) 47 | #define PIN_A2 (28u) 48 | #define PIN_A3 (29u) 49 | 50 | static const int A0 = PIN_A0; 51 | static const int A1 = PIN_A1; 52 | static const int A2 = PIN_A2; 53 | static const int A3 = PIN_A3; 54 | 55 | // D0 - D10 56 | #define D26 (26u) 57 | #define D1 (27u) 58 | #define D2 (28u) 59 | #define D3 (29u) 60 | #define D4 (6u) 61 | #define D5 (7u) 62 | #define D0 (0u) 63 | #define D7 (1u) 64 | #define D8 (2u) 65 | #define D9 (4u) 66 | #define D10 (3u) 67 | 68 | // static const int 0 = D0; 69 | 70 | // Wire 71 | #define PIN_WIRE0_SDA (6u) 72 | #define PIN_WIRE0_SCL (7u) 73 | 74 | #define PIN_WIRE1_SDA (26u) 75 | #define PIN_WIRE1_SCL (27u) 76 | 77 | // #define SERIAL_HOWMANY (3u) 78 | // #define SPI_HOWMANY (2u) 79 | // #define WIRE_HOWMANY (2u) 80 | 81 | // #include "../generic/common.h" 82 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/linux/linux_tcp_client.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | linux_tcp_client.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | *****************************************************************************************************************************/ 13 | 14 | #pragma once 15 | 16 | #ifdef __linux__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #define INVALID_SOCKET -1 23 | 24 | namespace websockets2_generic 25 | { 26 | namespace network2_generic 27 | { 28 | class LinuxTcpClient : public TcpClient 29 | { 30 | public: 31 | LinuxTcpClient(int socket = INVALID_SOCKET); 32 | bool connect(const WSString& host, int port) override; 33 | bool poll() override; 34 | bool available() override; 35 | void send(const WSString& data) override; 36 | void send(const WSString&& data) override; 37 | void send(const uint8_t* data, const uint32_t len) override; 38 | WSString readLine() override; 39 | void read(uint8_t* buffer, const uint32_t len) override; 40 | void close() override; 41 | virtual ~LinuxTcpClient(); 42 | 43 | protected: 44 | virtual int getSocket() const override 45 | { 46 | return _socket; 47 | } 48 | 49 | private: 50 | int _socket; 51 | }; 52 | } // namespace network2_generic 53 | } // namespace websockets2_generic 54 | 55 | #endif // #ifdef __linux__ 56 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | #include 38 | 39 | #define WEBSOCKETS_PORT 8080 40 | 41 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 42 | 43 | // Select the IP address according to your local network 44 | IPAddress serverIP(192, 168, 2, 96); 45 | 46 | IPAddress static_GW(192, 168, 2, 1); 47 | IPAddress static_SN(255, 255, 255, 0); 48 | 49 | // Google DNS Server IP 50 | IPAddress myDNS(8, 8, 8, 8); 51 | 52 | #endif //defines_h 53 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = { 31 | // D0 .. D13 32 | 5, // D0 is P0.05 (UART RX) 33 | 6, // D1 is P0.06 (UART TX) 34 | 7, // D2 is P0.07 35 | 31, // D3 is P0.31 36 | 18, // D4 is P0.18 (LED Blue) 37 | 99, // D5 (NC) 38 | 9, // D6 is P0.09 NFC1 39 | 10, // D7 is P0.10 (Button) NFC2 40 | 99, // D8 (NC) 41 | 8, // D9 is P0.08 42 | 11, // D10 is P0.11 CS 43 | 13, // D11 is P0.13 MOSI 44 | 12, // D12 is P0.12 MISO 45 | 14, // D13 is P0.14 SCK 46 | //I2C 47 | 2, // D14 is P0.2 (SDA) 48 | 3, // D15 is P0.3 (SCL) 49 | // D16 .. D21 (aka A0 .. A5) 50 | 3, // D16 is P0.03 (A0) 51 | 2, // D17 is P0.02 (A1) 52 | 4, // D18 is P0.04 (A2) 53 | 30, // D19 is P0.30 (A3) SW2 54 | 29, // D20 is P0.29 (A4) 55 | 28, // D21 is P0.28 (A5) 56 | 9, // P0.09 NFC 57 | 10, // P0.10 NFC 58 | 16, // SW1 (LED Green) 59 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = { 31 | // D0 .. D13 32 | 5, // D0 is P0.05 (UART RX) 33 | 6, // D1 is P0.06 (UART TX) 34 | 7, // D2 is P0.07 35 | 31, // D3 is P0.31 36 | 18, // D4 is P0.18 (LED Blue) 37 | 99, // D5 (NC) 38 | 9, // D6 is P0.09 NFC1 39 | 10, // D7 is P0.10 (Button) NFC2 40 | 99, // D8 (NC) 41 | 8, // D9 is P0.08 42 | 11, // D10 is P0.11 CS 43 | 13, // D11 is P0.13 MOSI 44 | 12, // D12 is P0.12 MISO 45 | 14, // D13 is P0.14 SCK 46 | //I2C 47 | 2, // D14 is P0.2 (SDA) 48 | 3, // D15 is P0.3 (SCL) 49 | // D16 .. D21 (aka A0 .. A5) 50 | 3, // D16 is P0.03 (A0) 51 | 2, // D17 is P0.02 (A1) 52 | 4, // D18 is P0.04 (A2) 53 | 30, // D19 is P0.30 (A3) SW2 54 | 29, // D20 is P0.29 (A4) 55 | 28, // D21 is P0.28 (A5) 56 | 9, // P0.09 NFC 57 | 10, // P0.10 NFC 58 | 16, // SW1 (LED Green) 59 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = { 31 | // D0 .. D13 32 | 5, // D0 is P0.05 (UART RX) 33 | 6, // D1 is P0.06 (UART TX) 34 | 7, // D2 is P0.07 35 | 31, // D3 is P0.31 36 | 18, // D4 is P0.18 (LED Blue) 37 | 99, // D5 (NC) 38 | 9, // D6 is P0.09 NFC1 39 | 10, // D7 is P0.10 (Button) NFC2 40 | 99, // D8 (NC) 41 | 8, // D9 is P0.08 42 | 11, // D10 is P0.11 CS 43 | 13, // D11 is P0.13 MOSI 44 | 12, // D12 is P0.12 MISO 45 | 14, // D13 is P0.14 SCK 46 | //I2C 47 | 2, // D14 is P0.2 (SDA) 48 | 3, // D15 is P0.3 (SCL) 49 | // D16 .. D21 (aka A0 .. A5) 50 | 3, // D16 is P0.03 (A0) 51 | 2, // D17 is P0.02 (A1) 52 | 4, // D18 is P0.04 (A2) 53 | 30, // D19 is P0.30 (A3) SW2 54 | 29, // D20 is P0.29 (A4) 55 | 28, // D21 is P0.28 (A5) 56 | 9, // P0.09 NFC 57 | 10, // P0.10 NFC 58 | 16, // SW1 (LED Green) 59 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = { 31 | // D0 .. D13 32 | 5, // D0 is P0.05 (UART RX) 33 | 6, // D1 is P0.06 (UART TX) 34 | 7, // D2 is P0.07 35 | 31, // D3 is P0.31 36 | 18, // D4 is P0.18 (LED Blue) 37 | 99, // D5 (NC) 38 | 9, // D6 is P0.09 NFC1 39 | 10, // D7 is P0.10 (Button) NFC2 40 | 99, // D8 (NC) 41 | 8, // D9 is P0.08 42 | 11, // D10 is P0.11 CS 43 | 13, // D11 is P0.13 MOSI 44 | 12, // D12 is P0.12 MISO 45 | 14, // D13 is P0.14 SCK 46 | //I2C 47 | 2, // D14 is P0.2 (SDA) 48 | 3, // D15 is P0.3 (SCL) 49 | // D16 .. D21 (aka A0 .. A5) 50 | 3, // D16 is P0.03 (A0) 51 | 2, // D17 is P0.02 (A1) 52 | 4, // D18 is P0.04 (A2) 53 | 30, // D19 is P0.30 (A3) SW2 54 | 29, // D20 is P0.29 (A4) 55 | 28, // D21 is P0.28 (A5) 56 | 9, // P0.09 NFC 57 | 10, // P0.10 NFC 58 | 16, // SW1 (LED Green) 59 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/windows/win_tcp_client.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | win_tcp_client.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | *****************************************************************************************************************************/ 13 | 14 | #pragma once 15 | 16 | #ifdef _WIN32 17 | 18 | #include 19 | #include 20 | 21 | #define WIN32_LEAN_AND_MEAN 22 | 23 | #undef _WIN32_WINNT 24 | #define _WIN32_WINNT 0x501 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | namespace websockets2_generic 35 | { 36 | namespace network2_generic 37 | { 38 | class WinTcpClient : public TcpClient 39 | { 40 | public: 41 | WinTcpClient(const SOCKET s = INVALID_SOCKET); 42 | bool connect(const WSString& host, const int port) override; 43 | bool poll() override; 44 | bool available() override; 45 | void send(const WSString& data) override; 46 | void send(const WSString&& data) override; 47 | void send(const uint8_t* data, const uint32_t len) override; 48 | WSString readLine() override; 49 | void read(uint8_t* buffer, const uint32_t len) override; 50 | void close() override; 51 | virtual ~WinTcpClient(); 52 | 53 | protected: 54 | int getSocket() const override; 55 | 56 | private: 57 | SOCKET socket; 58 | }; 59 | } // namespace network2_generic 60 | } // namespace websockets2_generic 61 | 62 | 63 | #endif // #ifdef _WIN32 64 | -------------------------------------------------------------------------------- /examples/ESP8266/SecuredTwoWay-Esp8266-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for SecuredTwoWay-ESP8266-Client.ino 3 | For ESP8266. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if (ESP8266) 19 | #define BOARD_TYPE "ESP8266" 20 | #else 21 | #error This code is intended to run only on the ESP8266 boards ! Please check your Tools->Board setting. 22 | #endif 23 | 24 | #ifndef BOARD_NAME 25 | #define BOARD_NAME BOARD_TYPE 26 | #endif 27 | 28 | #define DEBUG_WEBSOCKETS_PORT Serial 29 | // Debug Level from 0 to 4 30 | #define _WEBSOCKETS_LOGLEVEL_ 3 31 | 32 | const char* ssid = "ssid"; //Enter SSID 33 | const char* password = "password"; //Enter Password 34 | 35 | // Deprecated echo.websocket.org to be replaced or it won't work 36 | const char* websockets_connection_string = "wss://echo.websocket.org/"; //Enter server adress 37 | 38 | /* NTP Time Servers */ 39 | const char *ntp1 = "time.windows.com"; 40 | const char *ntp2 = "pool.ntp.org"; 41 | 42 | // True to use setTrustAnchors, false to use Fingerprint 43 | #define USING_SET_TRUST_ANCHORS true 44 | 45 | 46 | #if !USING_SET_TRUST_ANCHORS 47 | // To update SHA1 fingerprint, use Google Chrome to connect to https://www.websocket.org/echo.html 48 | // Then "View Site Information" => "Certificate Viewer" => Copy SHA1 fingerprint 49 | // KH, This SHA1 fingerprint was updated 15.04.2021, 50 | // Issued on Mar 15th 2021, expired on June 13th 2021 51 | const char echo_org_ssl_fingerprint[] PROGMEM = "34 A2 66 08 A1 4D 1E 83 1A 0E 49 3C 4A 84 45 9E 4A 0D 08 FE"; 52 | #endif 53 | 54 | #endif //defines_h 55 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_MinimalClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | 38 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 39 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 40 | 41 | #define WEBSOCKETS_PORT 8080 42 | 43 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 44 | 45 | // Select the IP address according to your local network 46 | IPAddress myIP(192, 168, 2, 232); 47 | IPAddress myGW(192, 168, 2, 1); 48 | IPAddress mySN(255, 255, 255, 0); 49 | 50 | // Google DNS Server IP 51 | IPAddress myDNS(8, 8, 8, 8); 52 | 53 | #endif //defines_h 54 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | 38 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 39 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 40 | 41 | #define WEBSOCKETS_PORT 8080 42 | 43 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 44 | 45 | // Select the IP address according to your local network 46 | IPAddress myIP(192, 168, 2, 232); 47 | IPAddress myGW(192, 168, 2, 1); 48 | IPAddress mySN(255, 255, 255, 0); 49 | 50 | // Google DNS Server IP 51 | IPAddress myDNS(8, 8, 8, 8); 52 | 53 | #endif //defines_h 54 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP32-Client.ino 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | 38 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 39 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 40 | 41 | #define WEBSOCKETS_PORT 8080 42 | 43 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 44 | 45 | // Select the IP address according to your local network 46 | IPAddress myIP(192, 168, 2, 232); 47 | IPAddress myGW(192, 168, 2, 1); 48 | IPAddress mySN(255, 255, 255, 0); 49 | 50 | // Google DNS Server IP 51 | IPAddress myDNS(8, 8, 8, 8); 52 | 53 | #endif //defines_h 54 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 58 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 59 | 60 | #define WEBSOCKETS_PORT 8080 61 | 62 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 63 | 64 | #endif //defines_h 65 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 58 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 59 | 60 | #define WEBSOCKETS_PORT 8080 61 | 62 | const uint16_t websockets_server_port = WEBSOCKETS_PORT; // Enter server port 63 | 64 | #endif //defines_h 65 | -------------------------------------------------------------------------------- /examples/ESP32/ESP32-Client_SINRIC/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for ESP32-Client_SINRIC.ino 3 | For ESP32, using SINRIC (https://sinric.com/) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if !( defined(ESP8266) || defined(ESP32) ) 19 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 20 | #elif ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 21 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 22 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 23 | #define BOARD_TYPE "ESP32-S2" 24 | #elif ( ARDUINO_ESP32C3_DEV ) 25 | #warning Using ESP32-C3 boards 26 | #define BOARD_TYPE "ESP32-C3" 27 | #else 28 | #define BOARD_TYPE "ESP32" 29 | #endif 30 | 31 | #ifndef BOARD_NAME 32 | #define BOARD_NAME BOARD_TYPE 33 | #endif 34 | 35 | #define DEBUG_WEBSOCKETS_PORT Serial 36 | // Debug Level from 0 to 4 37 | #define _WEBSOCKETS_LOGLEVEL_ 3 38 | 39 | const char* ssid = "ssid"; //Enter SSID 40 | const char* password = "password"; //Enter Password 41 | 42 | #define SINRIC_WEBSERVER "iot.sinric.com" 43 | #define SINRIC_WEBSERVER_PORT 80 44 | #define SINRIC_API_KEY "11111111-2222-3333-4444-555555555555" 45 | 46 | #define SINRIC_Device_ID_1 "012345678901234567890123" // Device ID, got from Sinric 47 | 48 | const char* websockets_server_host = SINRIC_WEBSERVER; //Enter server address 49 | const uint16_t websockets_server_port = SINRIC_WEBSERVER_PORT; // Enter server port 50 | 51 | #ifdef LED_BUILTIN 52 | #define LED_PIN LED_BUILTIN 53 | #else 54 | #define LED_PIN 2 55 | #endif 56 | 57 | #endif //defines_h 58 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-Minimal-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | const char* websockets_server_host = "192.168.2.30"; //Enter server address 58 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 59 | 60 | const uint16_t websockets_server_port = 8080; // Enter server port 61 | 62 | // Select the static IP address according to your local network 63 | IPAddress clientIP(192, 168, 2, 223); 64 | 65 | #endif //defines_h 66 | -------------------------------------------------------------------------------- /examples/WT32_ETH01/WT32_ETH01_Client_SINRIC/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h for WT32_ETH01_Client_SINRIC.ino 3 | For WT32_ETH01 (ESP32 + LAN8720) 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_ESP32S2_THING_PLUS || ARDUINO_MICROS2 || \ 19 | ARDUINO_METRO_ESP32S2 || ARDUINO_MAGTAG29_ESP32S2 || ARDUINO_FUNHOUSE_ESP32S2 || \ 20 | ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM ) 21 | #define BOARD_TYPE "ESP32-S2" 22 | #elif ( ARDUINO_ESP32C3_DEV ) 23 | #warning Using ESP32-C3 boards 24 | #define BOARD_TYPE "ESP32-C3" 25 | #elif ESP32 26 | #define BOARD_TYPE "ESP32" 27 | #else 28 | #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. 29 | #endif 30 | 31 | #define DEBUG_WEBSOCKETS_PORT Serial 32 | // Debug Level from 0 to 4 33 | #define _WEBSOCKETS_LOGLEVEL_ 3 34 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3 35 | 36 | #include // https://github.com/khoih-prog/WebServer_WT32_ETH01 37 | 38 | #define SINRIC_WEBSERVER "iot.sinric.com" 39 | #define SINRIC_WEBSERVER_PORT 80 40 | 41 | #define SINRIC_API_KEY "11111111-2222-3333-4444-555555555555" 42 | #define SINRIC_Device_ID_1 "012345678901234567890123" // Device ID, got from Sinric 43 | 44 | const char* websockets_server_host = SINRIC_WEBSERVER; //Enter server address 45 | const uint16_t websockets_server_port = SINRIC_WEBSERVER_PORT; // Enter server port 46 | 47 | // Select the IP address according to your local network 48 | IPAddress myIP(192, 168, 2, 232); 49 | IPAddress myGW(192, 168, 2, 1); 50 | IPAddress mySN(255, 255, 255, 0); 51 | 52 | // Google DNS Server IP 53 | IPAddress myDNS(8, 8, 8, 8); 54 | 55 | #define LED_PIN 12 // GPIO12 (pin 16) of WT32_ETH01 56 | 57 | #endif //defines_h 58 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/internals/wscrypto/crypto.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | crypto.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | 13 | Version: 1.13.2 14 | 15 | Version Modified By Date Comments 16 | ------- ----------- ---------- ----------- 17 | 1.0.0 K Hoang 14/07/2020 Initial coding/porting to support nRF52 and SAMD21/SAMD51 boards. Add SINRIC/Alexa support 18 | ... 19 | 1.9.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples 20 | 1.9.1 K Hoang 17/12/2021 Fix QNEthernet TCP interface 21 | 1.10.0 K Hoang 18/12/2021 Supporting case-insensitive headers, according to RFC2616 22 | 1.10.1 K Hoang 26/02/2022 Reduce QNEthernet latency 23 | 1.10.2 K Hoang 14/03/2022 Fix bug when using QNEthernet staticIP. Add staticIP option to NativeEthernet 24 | 1.10.3 K Hoang 11/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040 25 | 1.11.0 K Hoang 08/10/2022 Add support to ESP32 using W5x00 Ethernet 26 | 1.12.0 K Hoang 09/10/2022 Add support to ENC28J60 using EthernetENC or UIPEthernet for all supported boards 27 | 1.12.1 K Hoang 09/10/2022 Fix bug in examples 28 | 1.13.0 K Hoang 11/10/2022 Add support to RP2040W using CYW43439 WiFi 29 | 1.13.1 K Hoang 24/11/2022 Using new WiFi101_Generic library 30 | 1.13.2 K Hoang 06/12/2022 Fix compiler error using QNEthernet v0.17.0 31 | *****************************************************************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | 37 | namespace websockets2_generic 38 | { 39 | namespace crypto2_generic 40 | { 41 | WSString base64Encode(WSString data); 42 | WSString base64Encode(uint8_t* data, size_t len); 43 | WSString base64Decode(WSString data); 44 | WSString websocketsHandshakeEncodeKey(WSString key); 45 | WSString randomBytes(size_t len); 46 | } // namespace crypto2_generic 47 | } // namespace websockets2_generic 48 | -------------------------------------------------------------------------------- /examples/Generic/Portenta_H7/WiFi/Portenta_H7-Client_SINRIC/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For Portenta_H7 with Murata WiFi module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52 and SAMD21/SAMD51 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Example first created on: 10.05.2018 11 | Original Author: Markus Sattler 12 | 13 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 14 | Licensed under MIT license 15 | *****************************************************************************************************************************/ 16 | 17 | #ifndef defines_h 18 | #define defines_h 19 | 20 | #if ( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) ) 21 | 22 | #if defined(BOARD_NAME) 23 | #undef BOARD_NAME 24 | #endif 25 | 26 | #if defined(CORE_CM7) 27 | #warning Using Portenta H7 M7 core 28 | #define BOARD_NAME "PORTENTA_H7_M7" 29 | #else 30 | #warning Using Portenta H7 M4 core 31 | #define BOARD_NAME "PORTENTA_H7_M4" 32 | #endif 33 | 34 | #define USE_WIFI_PORTENTA_H7 true 35 | 36 | #define USE_WIFI_NINA false 37 | 38 | // To use the default WiFi library here 39 | #define USE_WIFI_CUSTOM false 40 | 41 | #else 42 | 43 | #error For Portenta_H7 only 44 | 45 | #endif 46 | 47 | #define WEBSOCKETS_USE_PORTENTA_H7_WIFI true 48 | //#define WEBSOCKETS_WIFI_USE_PORTENTA_H7 true 49 | 50 | #define DEBUG_WEBSOCKETS_PORT Serial 51 | // Debug Level from 0 to 4 52 | #define _WEBSOCKETS_LOGLEVEL_ 3 53 | 54 | const char* ssid = "ssid"; //Enter SSID 55 | const char* password = "password"; //Enter Password 56 | 57 | #define SINRIC_WEBSERVER "iot.sinric.com" 58 | #define SINRIC_WEBSERVER_PORT 80 59 | 60 | #define SINRIC_API_KEY "11111111-2222-3333-4444-555555555555" 61 | 62 | #define SINRIC_Device_ID_1 "012345678901234567890123" // Device ID, got from Sinric 63 | 64 | const char* websockets_server_host = SINRIC_WEBSERVER; //Enter server address 65 | const uint16_t websockets_server_port = SINRIC_WEBSERVER_PORT; // Enter server port 66 | 67 | #define LED_ON LOW 68 | #define LED_OFF HIGH 69 | 70 | #ifdef LED_BUILTIN 71 | #define LED_PIN LED_BUILTIN 72 | #else 73 | #define LED_PIN LEDB 74 | #endif 75 | 76 | #endif //defines_h 77 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/tcp_socket.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | tcp_socket.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | 13 | Version: 1.13.2 14 | 15 | Version Modified By Date Comments 16 | ------- ----------- ---------- ----------- 17 | 1.0.0 K Hoang 14/07/2020 Initial coding/porting to support nRF52 and SAMD21/SAMD51 boards. Add SINRIC/Alexa support 18 | ... 19 | 1.9.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples 20 | 1.9.1 K Hoang 17/12/2021 Fix QNEthernet TCP interface 21 | 1.10.0 K Hoang 18/12/2021 Supporting case-insensitive headers, according to RFC2616 22 | 1.10.1 K Hoang 26/02/2022 Reduce QNEthernet latency 23 | 1.10.2 K Hoang 14/03/2022 Fix bug when using QNEthernet staticIP. Add staticIP option to NativeEthernet 24 | 1.10.3 K Hoang 11/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040 25 | 1.11.0 K Hoang 08/10/2022 Add support to ESP32 using W5x00 Ethernet 26 | 1.12.0 K Hoang 09/10/2022 Add support to ENC28J60 using EthernetENC or UIPEthernet for all supported boards 27 | 1.12.1 K Hoang 09/10/2022 Fix bug in examples 28 | 1.13.0 K Hoang 11/10/2022 Add support to RP2040W using CYW43439 WiFi 29 | 1.13.1 K Hoang 24/11/2022 Using new WiFi101_Generic library 30 | 1.13.2 K Hoang 06/12/2022 Fix compiler error using QNEthernet v0.17.0 31 | *****************************************************************************************************************************/ 32 | 33 | #pragma once 34 | 35 | // KH add v1.0.6 36 | #include "WebSockets2_Generic_Debug.h" 37 | ////// 38 | 39 | #include 40 | 41 | namespace websockets2_generic 42 | { 43 | namespace network2_generic 44 | { 45 | struct TcpSocket 46 | { 47 | public: 48 | virtual bool available() = 0; 49 | virtual void close() = 0; 50 | virtual ~TcpSocket() {} 51 | protected: 52 | virtual int getSocket() const = 0; 53 | }; 54 | } // namespace network2_generic 55 | } // namespace websockets2_generic 56 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/tcp_server.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | tcp_server.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | 13 | Version: 1.13.2 14 | 15 | Version Modified By Date Comments 16 | ------- ----------- ---------- ----------- 17 | 1.0.0 K Hoang 14/07/2020 Initial coding/porting to support nRF52 and SAMD21/SAMD51 boards. Add SINRIC/Alexa support 18 | ... 19 | 1.9.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples 20 | 1.9.1 K Hoang 17/12/2021 Fix QNEthernet TCP interface 21 | 1.10.0 K Hoang 18/12/2021 Supporting case-insensitive headers, according to RFC2616 22 | 1.10.1 K Hoang 26/02/2022 Reduce QNEthernet latency 23 | 1.10.2 K Hoang 14/03/2022 Fix bug when using QNEthernet staticIP. Add staticIP option to NativeEthernet 24 | 1.10.3 K Hoang 11/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040 25 | 1.11.0 K Hoang 08/10/2022 Add support to ESP32 using W5x00 Ethernet 26 | 1.12.0 K Hoang 09/10/2022 Add support to ENC28J60 using EthernetENC or UIPEthernet for all supported boards 27 | 1.12.1 K Hoang 09/10/2022 Fix bug in examples 28 | 1.13.0 K Hoang 11/10/2022 Add support to RP2040W using CYW43439 WiFi 29 | 1.13.1 K Hoang 24/11/2022 Using new WiFi101_Generic library 30 | 1.13.2 K Hoang 06/12/2022 Fix compiler error using QNEthernet v0.17.0 31 | *****************************************************************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | #include 37 | //#include 38 | 39 | namespace websockets2_generic 40 | { 41 | namespace network2_generic 42 | { 43 | struct TcpServer : public TcpSocket 44 | { 45 | virtual bool poll() = 0; 46 | virtual bool listen(const uint16_t port) = 0; 47 | virtual TcpClient* accept() = 0; 48 | virtual ~TcpServer() {} 49 | }; 50 | } // namespace network2_generic 51 | } // namespace websockets2_generic 52 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to WebSockets2_Generic 2 | 3 | ### Reporting Bugs 4 | 5 | Please report bugs in [WebSockets2_Generic](https://github.com/khoih-prog/WebSockets2_Generic/issues/new) if you find them. 6 | 7 | However, before reporting a bug please check through the following: 8 | 9 | * [Existing Open Issues](https://github.com/khoih-prog/WebSockets2_Generic/issues) - someone might have already encountered this. 10 | 11 | If you don't find anything, please [open a new issue](https://github.com/khoih-prog/WebSockets2_Generic/issues/new). 12 | 13 | ### How to submit a bug report 14 | 15 | Please ensure to specify the following, or your post will be ignored and deleted: 16 | 17 | * Arduino IDE version (e.g. 1.8.19) or Platform.io version 18 | * `RP2040` Core Version (e.g. Arduino-mbed RP2040 v3.4.1 or arduino-pico core v2.6.3) 19 | * `RP2040` Board type (e.g. NANO_RP2040_CONNECT, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc.) 20 | * Contextual information (e.g. what you were trying to achieve) 21 | * Simplest possible steps to reproduce 22 | * Anything that might be relevant in your opinion, such as: 23 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a` 24 | * Network configuration 25 | 26 | Please be educated, civilized and constructive. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted. 27 | 28 | 29 | ### Example 30 | 31 | ``` 32 | Arduino IDE version: 1.8.19 33 | Arduino-mbed mbed_nano v3.4.1 34 | NANO_RP2040_CONNECT Module 35 | OS: Ubuntu 20.04 LTS 36 | Linux xy-Inspiron-3593 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 37 | 38 | Context: 39 | I encountered a crash while using this library 40 | 41 | Steps to reproduce: 42 | 1. ... 43 | 2. ... 44 | 3. ... 45 | 4. ... 46 | ``` 47 | 48 | --- 49 | 50 | ### Sending Feature Requests 51 | 52 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful. 53 | 54 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WebSockets2_Generic/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 55 | 56 | --- 57 | 58 | ### Sending Pull Requests 59 | 60 | Pull Requests with changes and fixes are also welcome! 61 | 62 | Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux) 63 | 64 | 1. Change directory to the library GitHub 65 | 66 | ``` 67 | xy@xy-Inspiron-3593:~$ cd Arduino/xy/WebSockets2_Generic_GitHub/ 68 | xy@xy-Inspiron-3593:~/Arduino/xy/WebSockets2_Generic_GitHub$ 69 | ``` 70 | 71 | 2. Issue astyle command 72 | 73 | ``` 74 | xy@xy-Inspiron-3593:~/Arduino/xy/WebSockets2_Generic_GitHub$ bash utils/restyle.sh 75 | ``` 76 | 77 | -------------------------------------------------------------------------------- /src/Tiny_Websockets_Generic/network/tcp_client.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | tcp_client.hpp 3 | For WebSockets2_Generic Library 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, SAM DUE, Teensy, RP2040 boards besides ESP8266 and ESP32 7 | 8 | The library provides simple and easy interface for websockets (Client and Server). 9 | 10 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 11 | Licensed under MIT license 12 | 13 | Version: 1.13.2 14 | 15 | Version Modified By Date Comments 16 | ------- ----------- ---------- ----------- 17 | 1.0.0 K Hoang 14/07/2020 Initial coding/porting to support nRF52 and SAMD21/SAMD51 boards. Add SINRIC/Alexa support 18 | ... 19 | 1.9.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples 20 | 1.9.1 K Hoang 17/12/2021 Fix QNEthernet TCP interface 21 | 1.10.0 K Hoang 18/12/2021 Supporting case-insensitive headers, according to RFC2616 22 | 1.10.1 K Hoang 26/02/2022 Reduce QNEthernet latency 23 | 1.10.2 K Hoang 14/03/2022 Fix bug when using QNEthernet staticIP. Add staticIP option to NativeEthernet 24 | 1.10.3 K Hoang 11/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040 25 | 1.11.0 K Hoang 08/10/2022 Add support to ESP32 using W5x00 Ethernet 26 | 1.12.0 K Hoang 09/10/2022 Add support to ENC28J60 using EthernetENC or UIPEthernet for all supported boards 27 | 1.12.1 K Hoang 09/10/2022 Fix bug in examples 28 | 1.13.0 K Hoang 11/10/2022 Add support to RP2040W using CYW43439 WiFi 29 | 1.13.1 K Hoang 24/11/2022 Using new WiFi101_Generic library 30 | 1.13.2 K Hoang 06/12/2022 Fix compiler error using QNEthernet v0.17.0 31 | *****************************************************************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | #include 37 | 38 | namespace websockets2_generic 39 | { 40 | namespace network2_generic 41 | { 42 | struct TcpClient : public TcpSocket 43 | { 44 | virtual bool poll() = 0; 45 | virtual void send(const WSString& data) = 0; 46 | virtual void send(const WSString&& data) = 0; 47 | virtual void send(const uint8_t* data, const uint32_t len) = 0; 48 | virtual WSString readLine() = 0; 49 | virtual uint32_t read(uint8_t* buffer, const uint32_t len) = 0; 50 | virtual bool connect(const WSString& host, int port) = 0; 51 | virtual ~TcpClient() {} 52 | }; 53 | } // namespace network2_generic 54 | } // namespace websockets2_generic 55 | -------------------------------------------------------------------------------- /examples/Generic/WiFiNINA/RP2040/RP2040-Server/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 19 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 20 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 21 | #undef WEBSOCKETS_WIFININA_USE_RP2040 22 | #endif 23 | #define WEBSOCKETS_USE_WIFININA true 24 | #define WEBSOCKETS_WIFININA_USE_RP2040 true 25 | #else 26 | #error This code is intended to run only on the RP2040 boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 30 | 31 | #warning Using ARDUINO_ARCH_MBED 32 | 33 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 34 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 35 | // Only undef known BOARD_NAME to use better one 36 | #undef BOARD_NAME 37 | #endif 38 | 39 | #if defined(ARDUINO_RASPBERRY_PI_PICO) 40 | #define BOARD_NAME "MBED RASPBERRY_PI_PICO" 41 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) 42 | #define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040" 43 | #elif defined(ARDUINO_GENERIC_RP2040) 44 | #define BOARD_NAME "MBED GENERIC_RP2040" 45 | #elif defined(ARDUINO_NANO_RP2040_CONNECT) 46 | #define BOARD_NAME "MBED NANO_RP2040_CONNECT" 47 | #else 48 | // Use default BOARD_NAME if exists 49 | #if !defined(BOARD_NAME) 50 | #define BOARD_NAME "MBED Unknown RP2040" 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef BOARD_NAME 57 | #define BOARD_NAME BOARD_TYPE 58 | #endif 59 | 60 | #include 61 | 62 | #define DEBUG_WEBSOCKETS_PORT Serial 63 | // Debug Level from 0 to 4 64 | #define _WEBSOCKETS_LOGLEVEL_ 3 65 | 66 | const char* ssid = "ssid"; //Enter SSID 67 | const char* password = "password"; //Enter Password 68 | 69 | // Select the IP address according to your local network 70 | IPAddress serverIP(192, 168, 2, 95); 71 | 72 | #define WEBSOCKETS_PORT 8080 73 | 74 | #endif //defines_h 75 | -------------------------------------------------------------------------------- /examples/Generic/WiFiNINA/RP2040/RP2040-AdvancedWebServer/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 19 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 20 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 21 | #undef WEBSOCKETS_WIFININA_USE_RP2040 22 | #endif 23 | #define WEBSOCKETS_USE_WIFININA true 24 | #define WEBSOCKETS_WIFININA_USE_RP2040 true 25 | #else 26 | #error This code is intended to run only on the RP2040 boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 30 | 31 | #warning Using ARDUINO_ARCH_MBED 32 | 33 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 34 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 35 | // Only undef known BOARD_NAME to use better one 36 | #undef BOARD_NAME 37 | #endif 38 | 39 | #if defined(ARDUINO_RASPBERRY_PI_PICO) 40 | #define BOARD_NAME "MBED RASPBERRY_PI_PICO" 41 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) 42 | #define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040" 43 | #elif defined(ARDUINO_GENERIC_RP2040) 44 | #define BOARD_NAME "MBED GENERIC_RP2040" 45 | #elif defined(ARDUINO_NANO_RP2040_CONNECT) 46 | #define BOARD_NAME "MBED NANO_RP2040_CONNECT" 47 | #else 48 | // Use default BOARD_NAME if exists 49 | #if !defined(BOARD_NAME) 50 | #define BOARD_NAME "MBED Unknown RP2040" 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef BOARD_NAME 57 | #define BOARD_NAME BOARD_TYPE 58 | #endif 59 | 60 | #include 61 | 62 | #define DEBUG_WEBSOCKETS_PORT Serial 63 | // Debug Level from 0 to 4 64 | #define _WEBSOCKETS_LOGLEVEL_ 3 65 | 66 | const char* ssid = "ssid"; //Enter SSID 67 | const char* password = "password"; //Enter Password 68 | 69 | const uint16_t websockets_server_port = 8080; // Enter server port 70 | 71 | // Select the IP address according to your local network 72 | IPAddress serverIP(192, 168, 2, 95); 73 | 74 | #endif //defines_h 75 | -------------------------------------------------------------------------------- /examples/Generic/WiFiNINA/RP2040/RP2040_ServerAllFunctionsDemo/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 19 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 20 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 21 | #undef WEBSOCKETS_WIFININA_USE_RP2040 22 | #endif 23 | #define WEBSOCKETS_USE_WIFININA true 24 | #define WEBSOCKETS_WIFININA_USE_RP2040 true 25 | #else 26 | #error This code is intended to run only on the RP2040 boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 30 | 31 | #warning Using ARDUINO_ARCH_MBED 32 | 33 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 34 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 35 | // Only undef known BOARD_NAME to use better one 36 | #undef BOARD_NAME 37 | #endif 38 | 39 | #if defined(ARDUINO_RASPBERRY_PI_PICO) 40 | #define BOARD_NAME "MBED RASPBERRY_PI_PICO" 41 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) 42 | #define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040" 43 | #elif defined(ARDUINO_GENERIC_RP2040) 44 | #define BOARD_NAME "MBED GENERIC_RP2040" 45 | #elif defined(ARDUINO_NANO_RP2040_CONNECT) 46 | #define BOARD_NAME "MBED NANO_RP2040_CONNECT" 47 | #else 48 | // Use default BOARD_NAME if exists 49 | #if !defined(BOARD_NAME) 50 | #define BOARD_NAME "MBED Unknown RP2040" 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef BOARD_NAME 57 | #define BOARD_NAME BOARD_TYPE 58 | #endif 59 | #include 60 | 61 | #define DEBUG_WEBSOCKETS_PORT Serial 62 | // Debug Level from 0 to 4 63 | #define _WEBSOCKETS_LOGLEVEL_ 3 64 | 65 | const char* ssid = "ssid"; //Enter SSID 66 | const char* password = "password"; //Enter Password 67 | 68 | const uint16_t websockets_server_port = 8080; // Enter server port 69 | 70 | // Select the IP address according to your local network 71 | IPAddress serverIP(192, 168, 2, 95); 72 | 73 | #endif //defines_h 74 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /examples/Generic/WiFiNINA/RP2040/RP2040-Client/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 19 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 20 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 21 | #undef WEBSOCKETS_WIFININA_USE_RP2040 22 | #endif 23 | #define WEBSOCKETS_USE_WIFININA true 24 | #define WEBSOCKETS_WIFININA_USE_RP2040 true 25 | #else 26 | #error This code is intended to run only on the RP2040 boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 30 | 31 | #warning Using ARDUINO_ARCH_MBED 32 | 33 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 34 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 35 | // Only undef known BOARD_NAME to use better one 36 | #undef BOARD_NAME 37 | #endif 38 | 39 | #if defined(ARDUINO_RASPBERRY_PI_PICO) 40 | #define BOARD_NAME "MBED RASPBERRY_PI_PICO" 41 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) 42 | #define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040" 43 | #elif defined(ARDUINO_GENERIC_RP2040) 44 | #define BOARD_NAME "MBED GENERIC_RP2040" 45 | #elif defined(ARDUINO_NANO_RP2040_CONNECT) 46 | #define BOARD_NAME "MBED NANO_RP2040_CONNECT" 47 | #else 48 | // Use default BOARD_NAME if exists 49 | #if !defined(BOARD_NAME) 50 | #define BOARD_NAME "MBED Unknown RP2040" 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef BOARD_NAME 57 | #define BOARD_NAME BOARD_TYPE 58 | #endif 59 | 60 | #include 61 | 62 | #define DEBUG_WEBSOCKETS_PORT Serial 63 | // Debug Level from 0 to 4 64 | #define _WEBSOCKETS_LOGLEVEL_ 3 65 | 66 | const char* ssid = "ssid"; //Enter SSID 67 | const char* password = "password"; //Enter Password 68 | 69 | const char* websockets_server_host = "192.168.2.95"; //Enter server address 70 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 71 | 72 | const uint16_t websockets_server_port = 8080; // Enter server port 73 | 74 | #endif //defines_h 75 | -------------------------------------------------------------------------------- /examples/Generic/WiFiNINA/RP2040/RP2040-RepeatingClient/defines.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | defines.h 3 | For RP2040 with WiFiNINA module/shield. 4 | 5 | Based on and modified from Gil Maimon's ArduinoWebsockets library https://github.com/gilmaimon/ArduinoWebsockets 6 | to support STM32F/L/H/G/WB/MP1, nRF52, SAMD21/SAMD51, RP2040 boards besides ESP8266 and ESP32 7 | 8 | 9 | The library provides simple and easy interface for websockets (Client and Server). 10 | 11 | Built by Khoi Hoang https://github.com/khoih-prog/Websockets2_Generic 12 | Licensed under MIT license 13 | *****************************************************************************************************************************/ 14 | 15 | #ifndef defines_h 16 | #define defines_h 17 | 18 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 19 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 20 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 21 | #undef WEBSOCKETS_WIFININA_USE_RP2040 22 | #endif 23 | #define WEBSOCKETS_USE_WIFININA true 24 | #define WEBSOCKETS_WIFININA_USE_RP2040 true 25 | #else 26 | #error This code is intended to run only on the RP2040 boards ! Please check your Tools->Board setting. 27 | #endif 28 | 29 | #if defined(WEBSOCKETS_WIFININA_USE_RP2040) 30 | 31 | #warning Using ARDUINO_ARCH_MBED 32 | 33 | #if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \ 34 | defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) ) 35 | // Only undef known BOARD_NAME to use better one 36 | #undef BOARD_NAME 37 | #endif 38 | 39 | #if defined(ARDUINO_RASPBERRY_PI_PICO) 40 | #define BOARD_NAME "MBED RASPBERRY_PI_PICO" 41 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) 42 | #define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040" 43 | #elif defined(ARDUINO_GENERIC_RP2040) 44 | #define BOARD_NAME "MBED GENERIC_RP2040" 45 | #elif defined(ARDUINO_NANO_RP2040_CONNECT) 46 | #define BOARD_NAME "MBED NANO_RP2040_CONNECT" 47 | #else 48 | // Use default BOARD_NAME if exists 49 | #if !defined(BOARD_NAME) 50 | #define BOARD_NAME "MBED Unknown RP2040" 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef BOARD_NAME 57 | #define BOARD_NAME BOARD_TYPE 58 | #endif 59 | 60 | #include 61 | 62 | #define DEBUG_WEBSOCKETS_PORT Serial 63 | // Debug Level from 0 to 4 64 | #define _WEBSOCKETS_LOGLEVEL_ 3 65 | 66 | const char* ssid = "ssid"; //Enter SSID 67 | const char* password = "password"; //Enter Password 68 | 69 | const char* websockets_server_host = "192.168.2.95"; //Enter server address 70 | //const char* websockets_server_host = "serverip_or_name"; //Enter server address 71 | 72 | const uint16_t websockets_server_port = 8080; // Enter server port 73 | 74 | #endif //defines_h 75 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | --------------------------------------------------------------------------------