Skip to content

Commit

Permalink
Merge branch 'Links2004:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc authored Sep 16, 2024
2 parents b956de0 + 7a4c416 commit ffa4e22
Show file tree
Hide file tree
Showing 23 changed files with 734 additions and 43 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
10 changes: 10 additions & 0 deletions .github/workflows/arduino-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Arduino library compliance (Lint)
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
69 changes: 69 additions & 0 deletions .github/workflows/compile-arduino_wifinina-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Compile Arduino WiFiNINA Examples

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-arduino_wifinina-examples.yaml"
- "examples/arduino_wifinina/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-arduino_wifinina-examples.yaml"
- "examples/arduino_wifinina/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:samd:mkrwifi1010
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrwifi1010
libraries: |
- name: WiFiNINA
- fqbn: arduino:samd:nano_33_iot
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-nano_33_iot
libraries: |
- name: WiFiNINA
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
${{ matrix.board.libraries }}
sketch-paths: |
- examples/arduino_wifinina/arduino_wifinina.ino
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
81 changes: 81 additions & 0 deletions .github/workflows/compile-seeed-studio-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Compile SeedStudio Examples

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-seeed-studio-examples.yaml"
- "examples/seeed-studio/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-seeed-studio-examples.yaml"
- "examples/seeed-studio/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off
platforms: |
- name: Seeeduino:samd
source-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
libraries: |
- name: Seeed Arduino rpcWiFi
- name: Seeed Arduino rpcUnified
- name: Seeed_Arduino_mbedtls
- name: Seeed Arduino FS
- name: Seeed Arduino SFUD
artifact-name-suffix: seeeduino-xia0
- fqbn: Seeeduino:samd:seeed_wio_terminal
platforms: |
- name: Seeeduino:samd
source-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
libraries: |
- name: Seeed Arduino rpcWiFi
- name: Seeed Arduino rpcUnified
- name: Seeed_Arduino_mbedtls
- name: Seeed Arduino FS
- name: Seeed Arduino SFUD
artifact-name-suffix: seeeduino-wio_terminal

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
${{ matrix.board.libraries }}
sketch-paths: |
- examples/seeed-studio/xio-wio-terminal/WebSocketClient
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
60 changes: 60 additions & 0 deletions .github/workflows/compile-unor4wifi-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Compile Arduino UNO R4 WiFi Examples

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-unor4wifi-examples.yaml"
- "examples/arduino_renesas/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-unor4wifi-examples.yaml"
- "examples/arduino_renesas/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:renesas_uno:unor4wifi
platforms: |
- name: arduino:renesas_uno
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
sketch-paths: |
- examples/arduino_renesas/arduino_uno_r4_wifi
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
check_version_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: check version
run: |
Expand All @@ -26,7 +26,7 @@ jobs:
prepare_example_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: generate examples
id: set-matrix
Expand Down Expand Up @@ -61,15 +61,15 @@ jobs:
ARDUINO_DIRECTORIES_DATA: /home/runner/arduino_ide

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get hash
id: get-hash
run: |
echo "hash=$(/bin/date -u "+%Y%m%d")-$(md5sum ".github/workflows/main.yml" | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache_all
with:
path: |
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: install libgtk2.0-0
run: |
Expand All @@ -128,7 +128,7 @@ jobs:
echo "hash=$(/bin/date -u "+%Y%m%d")-$(md5sum ".github/workflows/main.yml" | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache_all
with:
path: |
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WebSocket Server and Client for Arduino [![Build Status](https://github.com/Links2004/arduinoWebSockets/workflows/CI/badge.svg?branch=master)](https://github.com/Links2004/arduinoWebSockets/actions?query=workflow%3ACI+branch%3Amaster)
WebSocket Server and Client for Arduino [![Build Status](https://github.com/Links2004/arduinoWebSockets/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Links2004/arduinoWebSockets/actions?query=branch%3Amaster)
===========================================

a WebSocket Server and Client for Arduino based on RFC6455.
Expand Down Expand Up @@ -32,6 +32,9 @@ a WebSocket Server and Client for Arduino based on RFC6455.
- ATmega328 with enc28j60 (ATmega branch)
- ATmega2560 with Ethernet Shield (ATmega branch)
- ATmega2560 with enc28j60 (ATmega branch)
- Arduino UNO [R4 WiFi](https://github.com/arduino/ArduinoCore-renesas)
- Arduino Nano 33 IoT, MKR WIFI 1010 (requires [WiFiNINA](https://github.com/arduino-libraries/WiFiNINA/) library)
- Seeeduino XIAO, Seeeduino Wio Terminal (requires [rpcWiFi](https://github.com/Seeed-Studio/Seeed_Arduino_rpcWiFi) library)

###### Note: ######

Expand Down Expand Up @@ -73,19 +76,19 @@ The mode can be activated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE
```c++
void begin(const char *host, uint16_t port, const char * url = "/", const char * protocol = "arduino");
void begin(String host, uint16_t port, String url = "/", String protocol = "arduino");
```
```
- `onEvent`: Callback to handle for websocket events
```c++
```c++
void onEvent(WebSocketClientEvent cbEvent);
```
```

- `WebSocketClientEvent`: Handler for websocket events
```c++
```c++
void (*WebSocketClientEvent)(WStype_t type, uint8_t * payload, size_t length)
```
```
Where `WStype_t type` is defined as:
```c++
```c++
typedef enum {
WStype_ERROR,
WStype_DISCONNECTED,
Expand All @@ -99,13 +102,11 @@ Where `WStype_t type` is defined as:
WStype_PING,
WStype_PONG,
} WStype_t;
```
```

### Issues ###
Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues

[![Join the chat at https://gitter.im/Links2004/arduinoWebSockets](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Links2004/arduinoWebSockets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### License and credits ###

The library is licensed under [LGPLv2.1](https://github.com/Links2004/arduinoWebSockets/blob/master/LICENSE)
Expand Down
Loading

0 comments on commit ffa4e22

Please sign in to comment.