Skip to content

Commit af886db

Browse files
committed
clang, fix offline test runner to install
1 parent 77bbf1a commit af886db

27 files changed

+157
-144
lines changed

.github/workflows/release-caller-offline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
clang_and_doxy:
15-
name: 🔎Clang & Doxygen
15+
name: 🔎 Clang
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/setup-python@v5

.github/workflows/run-offline-tests.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,40 @@
22
#
33
# SPDX-License-Identifier: MIT
44
name: WipperSnapper Tests for Offline Mode
5-
65
on:
7-
pull_request:
8-
6+
release:
7+
types: [published]
8+
secrets:
9+
GH_REPO_TOKEN:
10+
required: true
911
permissions:
1012
checks: write
1113
pull-requests: write
1214

1315
jobs:
1416
build:
1517
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
test:
19-
- test_offline
20-
fail-fast: false
2118
steps:
2219
- name: Check out repository code
23-
uses: actions/checkout@v3
24-
25-
- name: Check out repository code
26-
uses: actions/checkout@v3
27-
20+
uses: actions/checkout@v4
2821
- name: Set up Python
2922
uses: actions/setup-python@v5
3023
with:
3124
python-version: '3.13'
32-
3325
- name: Install Python dependencies
3426
run: |
3527
python -m pip install --upgrade pip
3628
pip install -r tests/requirements.txt
37-
3829
- name: Install Wokwi CI server
3930
uses: wokwi/wokwi-ci-server-action@v1
40-
4131
- name: Install Wokwi CLI
4232
run: curl -L https://wokwi.com/ci/install.sh | sh
43-
33+
- name: Install platformIO libraries
34+
run: pio lib install
35+
- name: Build PlatformIO examples
36+
run: pio ci --board=esp32dev
37+
env:
38+
PLATFORMIO_CI_SRC: ${{ matrix.example }}
4439
- name: Test on Wokwi
4540
run: pytest tests/${{ matrix.test }}.py --junitxml=report.xml -v
4641
env:

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ lib_deps =
7575
https://github.com/pstolarz/OneWireNg.git
7676
https://github.com/Sensirion/arduino-sht.git
7777
https://github.com/Sensirion/arduino-i2c-sen5x.git
78-
https://github.com/Sensirion/arduino-i2c-scd4x.git#0.4.0
7978
https://github.com/adafruit/WiFiNINA.git
8079
https://github.com/Starmbi/hp_BH1750.git
8180
https://github.com/adafruit/RTClib.git
8281
https://github.com/bblanchon/ArduinoStreamUtils.git
82+
https://github.com/Sensirion/arduino-i2c-scd4x.git
8383

8484
; Common build environment for ESP32 platform
8585
[common:esp32]

src/Wippersnapper_V2.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ class Wippersnapper_V2 {
213213
void BlinkKATStatus();
214214

215215
// Error handling helpers
216-
void
217-
haltErrorV2(String error, ws_led_status_t ledStatusColor = WS_LED_STATUS_ERROR_RUNTIME, bool reboot = true);
216+
void haltErrorV2(String error,
217+
ws_led_status_t ledStatusColor = WS_LED_STATUS_ERROR_RUNTIME,
218+
bool reboot = true);
218219
void errorWriteHangV2(String error);
219220

220221
bool _is_offline_mode; ///< Global flag for if the device is in offline mode

src/Wippersnapper_demo.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// All text above must be included in any redistribution.
1010

1111
#include "ws_adapters.h"
12-
//ws_adapter_wifi wipper;
13-
ws_adapter_offline wipper;
12+
ws_adapter_wifi wipper;
13+
// Uncomment the following line to use the offline adapter for Pico
14+
// ws_adapter_offline wipper;
1415

1516
#define WS_DEBUG // Enable debug output!
1617

src/adapters/wifi/ws_wifi_esp8266.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ class ws_wifi_esp8266 : public Wippersnapper_V2 {
145145
if (WS._isWiFiMultiV2) {
146146
// multi network mode
147147
for (int j = 0; j < WS_MAX_ALT_WIFI_NETWORKS; j++) {
148-
if (strcmp(WsV2._multiNetworksV2[j].ssid, WiFi.SSID(i).c_str()) == 0) {
148+
if (strcmp(WsV2._multiNetworksV2[j].ssid, WiFi.SSID(i).c_str()) ==
149+
0) {
149150
WS_DEBUG_PRINT("SSID (");
150151
WS_DEBUG_PRINT(WsV2._multiNetworksV2[j].ssid);
151152
WS_DEBUG_PRINT(") found! RSSI: ");

src/adapters/wifi/ws_wifi_ninafw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ws_wifi_ninafw : public Wippersnapper {
5050
*/
5151
/**************************************************************************/
5252
ws_wifi_ninafw(const char *aioUsername, const char *aioKey,
53-
const char *netSSID, const char *netPass)
53+
const char *netSSID, const char *netPass)
5454
: Wippersnapper() {
5555
_ssid = netSSID;
5656
_pass = netPass;

src/adapters/wifi/ws_wifi_pico.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ class ws_wifi_pico : public Wippersnapper_V2 {
184184
? _aio_root_ca_prod
185185
: _aio_root_ca_staging);
186186
WsV2._mqttV2 = new Adafruit_MQTT_Client(
187-
_mqtt_client_secure, WsV2._configV2.aio_url, WsV2._configV2.io_port, clientID,
188-
WsV2._configV2.aio_user, WsV2._configV2.aio_key);
187+
_mqtt_client_secure, WsV2._configV2.aio_url, WsV2._configV2.io_port,
188+
clientID, WsV2._configV2.aio_user, WsV2._configV2.aio_key);
189189
} else {
190190
_mqtt_client_insecure = new WiFiClient();
191191
WsV2._mqttV2 = new Adafruit_MQTT_Client(
@@ -330,13 +330,13 @@ class ws_wifi_pico : public Wippersnapper_V2 {
330330

331331
// Use the macro to retry the status check until connected / timed out
332332
int lastResult;
333-
/* RETRY_FUNCTION_UNTIL_TIMEOUT(
334-
[]() -> int { return WiFi.status(); }, // Function call each cycle
335-
int, // return type
336-
lastResult, // return variable (unused here)
337-
[](int status) { return status == WL_CONNECTED; }, // check
338-
PICO_CONNECT_TIMEOUT_MS, // timeout interval (ms)
339-
PICO_CONNECT_RETRY_DELAY_MS); // interval between retries */
333+
/* RETRY_FUNCTION_UNTIL_TIMEOUT(
334+
[]() -> int { return WiFi.status(); }, // Function call each
335+
cycle int, // return type
336+
lastResult, // return variable (unused here)
337+
[](int status) { return status == WL_CONNECTED; }, // check
338+
PICO_CONNECT_TIMEOUT_MS, // timeout interval (ms)
339+
PICO_CONNECT_RETRY_DELAY_MS); // interval between retries */
340340

341341
if (lastResult == WL_CONNECTED) {
342342
_statusV2 = WS_NET_CONNECTED;

src/components/checkin/model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CheckinModel {
3030
void CreateCheckinRequest(const char *hardware_uid,
3131
const char *firmware_version);
3232
bool EncodeCheckinRequest();
33-
wippersnapper_checkin_CheckinRequest* getCheckinRequest();
33+
wippersnapper_checkin_CheckinRequest *getCheckinRequest();
3434
// Response Message
3535
bool DecodeCheckinResponse(pb_istream_t *stream);
3636
void ParseCheckinResponse();

src/components/digitalIO/hardware.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class DigitalIOHardware {
3131
bool GetValue(uint8_t pin_name);
3232
void deinit(uint8_t pin_name);
3333
bool IsStatusLEDPin(uint8_t pin_name);
34+
3435
private:
3536
};
3637
#endif // WS_DIGITALIO_HARDWARE_H

0 commit comments

Comments
 (0)