Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
5c1cb4f
Refactor Packet Monitor into stacked asynchronous graphs (#1483)
justcallmekoko Aug 19, 2026
6c2040f
Bump firmware version to v1.15.0
justcallmekoko Aug 19, 2026
65fab0c
Bump firmware version to v1.15.0 (#1484)
justcallmekoko Aug 19, 2026
ec23ee0
Add LilyGo T-Dongle C5 support (.github/workflows/build_parallel.yml)
justcallmekoko Aug 19, 2026
673f781
Add LilyGo T-Dongle C5 support (.github/workflows/nightly_build.yml)
justcallmekoko Aug 19, 2026
99ed700
Add LilyGo T-Dongle C5 support (.github/workflows/build_parallel.yml)
justcallmekoko Aug 19, 2026
b0a0a53
Add LilyGo T-Dongle C5 support (.github/workflows/nightly_build.yml)
justcallmekoko Aug 19, 2026
db70f86
Add LilyGo T-Dongle C5 support (esp32_marauder/WiFiScan.cpp)
justcallmekoko Aug 19, 2026
5f7437c
Add LilyGo T-Dongle C5 support (esp32_marauder/WiFiScan.h)
justcallmekoko Aug 19, 2026
c91fa07
Add LilyGo T-Dongle C5 support (esp32_marauder/configs.h)
justcallmekoko Aug 19, 2026
95bdfdc
Add LilyGo T-Dongle C5 support (esp32_marauder/esp32_marauder.ino)
justcallmekoko Aug 19, 2026
4545547
Add LilyGo T-Dongle C5 support (esp32_marauder/TDongleDisplay.cpp)
justcallmekoko Aug 19, 2026
c8f0b20
Add LilyGo T-Dongle C5 support (esp32_marauder/TDongleDisplay.h)
justcallmekoko Aug 19, 2026
4ec216d
Add LilyGo T-Dongle C5 support (User_Setup_marauder_t_dongle_c5.h)
justcallmekoko Aug 19, 2026
534a638
Add LilyGo T-Dongle C5 support (installer/targets.json)
justcallmekoko Aug 19, 2026
772fa11
Add LilyGo T-Dongle C5 support (tools/test_installer_manifest.py)
justcallmekoko Aug 19, 2026
50f0d8d
Use 16 MB T-Dongle partition layout (.github/workflows/build_parallel…
justcallmekoko Aug 19, 2026
2e29898
Use 16 MB T-Dongle partition layout (.github/workflows/nightly_build.…
justcallmekoko Aug 19, 2026
38bf1b0
Use 16 MB T-Dongle partition layout (esp32_marauder/partitions.csv)
justcallmekoko Aug 19, 2026
7a5f030
Fix T-Dongle dashboard build (esp32_marauder/TDongleDisplay.cpp)
justcallmekoko Aug 19, 2026
9c99bb2
Fix T-Dongle dashboard build (esp32_marauder/WiFiScan.cpp)
justcallmekoko Aug 19, 2026
5c25cf3
Select T-Dongle TFT setup in CI
justcallmekoko Aug 19, 2026
12ab51a
Cover T-Dongle scan view labels (platformio.ini)
justcallmekoko Aug 19, 2026
2f3dbe6
Cover T-Dongle scan view labels (esp32_marauder/TDongleStats.h)
justcallmekoko Aug 19, 2026
2769d34
Cover T-Dongle scan view labels (esp32_marauder/TDongleStats.cpp)
justcallmekoko Aug 19, 2026
f569f27
Cover T-Dongle scan view labels (esp32_marauder/TDongleDisplay.h)
justcallmekoko Aug 19, 2026
80b81e6
Cover T-Dongle scan view labels (esp32_marauder/TDongleDisplay.cpp)
justcallmekoko Aug 19, 2026
d6ad5e3
Cover T-Dongle scan view labels (test/test_t_dongle_stats/test_main.cpp)
justcallmekoko Aug 19, 2026
b5539b7
Fix T-Dongle C5 display and status LED
justcallmekoko Aug 19, 2026
b3c0a23
Expose T-Dongle status LED to scanner
justcallmekoko Aug 19, 2026
9e9a600
Fix T-Dongle LED idle state and enable GPS
justcallmekoko Aug 19, 2026
928f598
Harden T-Dongle APA102 idle handling
justcallmekoko Aug 19, 2026
8c34780
Use reference APA102 driver for T-Dongle
justcallmekoko Aug 19, 2026
b416590
Install APA102 in manifest builds
justcallmekoko Aug 19, 2026
a150978
Fix T-Dongle shared display LED pins
justcallmekoko Aug 19, 2026
7f1aa4b
Restore display SPI after T-Dongle LED writes
justcallmekoko Aug 19, 2026
3259173
Defer display SPI restore until redraw
justcallmekoko Aug 19, 2026
c26906f
Make T-Dongle LED the final bus writer
justcallmekoko Aug 20, 2026
649a87f
Correct T-Dongle LED clock pin
justcallmekoko Aug 20, 2026
2508630
Merge pull request #1485 from justcallmekoko/feat/t-dongle-c5-marauder
justcallmekoko Aug 20, 2026
9a16486
fix: scan complete IPv4 subnet ranges
justcallmekoko Aug 20, 2026
be00fdb
fix(build): scope T-Dongle partition layout
justcallmekoko Aug 20, 2026
1f99510
Fix IP scanner subnet range iteration (#1487)
justcallmekoko Aug 20, 2026
fe9b63b
ci: use 8 MB OTA layout for C5 DevKit
justcallmekoko Aug 20, 2026
986f6f9
Merge pull request #1489 from justcallmekoko/feat/c5-default-8mb
justcallmekoko Aug 21, 2026
bcbaf95
fix: rework network scanner display UI
justcallmekoko Aug 21, 2026
2c15675
test: exclude hardware-only scanner UI from host coverage
justcallmekoko Aug 22, 2026
14e6408
Rework ping and port scanner display UI (#1490)
justcallmekoko Aug 22, 2026
a2fe858
fix: enable ARP scanning on ESP32-C5
justcallmekoko Aug 22, 2026
9bf224e
test: exclude live lwIP ARP paths from host coverage
justcallmekoko Aug 22, 2026
cdb2d2c
fix: expose ARP scan on dual-band targets
justcallmekoko Aug 22, 2026
29a93d7
test: exclude hardware ARP entry points from host coverage
justcallmekoko Aug 22, 2026
4c6b3a7
fix: lock lwIP core during C5 ARP operations
justcallmekoko Aug 22, 2026
5be4913
fix: use ARP discovery for service scans on C5
justcallmekoko Aug 22, 2026
a90f8b7
refactor: reuse station ARP lookup state
justcallmekoko Aug 22, 2026
49bb27d
refactor: inline single-host ARP probe
justcallmekoko Aug 22, 2026
278e3c2
refactor: reuse active station for ARP cache reads
justcallmekoko Aug 22, 2026
894ba3c
refactor: trim redundant C5 scan work
justcallmekoko Aug 22, 2026
48f42fb
refactor: compact service scan iteration
justcallmekoko Aug 22, 2026
1e45ef4
refactor: consolidate ARP result reporting
justcallmekoko Aug 22, 2026
ed6e8ee
test: exclude live ARP service discovery from host coverage
justcallmekoko Aug 22, 2026
c1d575b
refactor: restore clear ARP scan implementation
justcallmekoko Aug 22, 2026
c3cbec7
Enable ARP scanning on ESP32-C5 hardware (#1491)
justcallmekoko Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build_installer_manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ jobs:
ref: 1.12.0
path: CustomAdafruit_NeoPixel

- name: Install APA102 for LilyGo T-Dongle C5
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
uses: actions/checkout@v4
with:
repository: pololu/apa102-arduino
ref: 3.0.0
path: CustomAPA102

- name: Install ArduinoJson
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -227,6 +235,10 @@ jobs:
done
fi

- name: Configure LilyGo T-Dongle C5 partition table
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
run: cp installer/partitions/t_dongle_c5.csv esp32_marauder/partitions.csv

- name: Build Marauder for ${{ matrix.board.name }}
uses: ArminJo/arduino-test-compile@v3.3.0
with:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/build_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
- { name: "Marauder CYD 3.5inch", flag: "MARAUDER_CYD_3_5_INCH", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_3_5_inch", tft: true, tft_file: "User_Setup_cyd_3_5_inch.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5Cardputer", flag: "MARAUDER_CARDPUTER", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer", tft: true, tft_file: "User_Setup_marauder_m5cardputer.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5Cardputer ADV", flag: "MARAUDER_CARDPUTER_ADV", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer_adv", tft: true, tft_file: "User_Setup_marauder_m5cardputer_adv.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=min_spiffs,PSRAM=enabled", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=default_8MB,PSRAM=enabled", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "LilyGo T-Dongle C5", flag: "MARAUDER_T_DONGLE_C5", fbqn: "esp32:esp32:esp32c5:CDCOnBoot=cdc,FlashMode=qio,FlashSize=16M,PartitionScheme=custom,PSRAM=enabled", file_name: "t_dongle_c5", tft: true, tft_file: "User_Setup_marauder_t_dongle_c5.h", tft_repo: "H4W9/TFT_eSPI", tft_ref: "ESP32-C5", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5NanoC6", flag: "MARAUDER_M5_NANO_C6", fbqn: "esp32:esp32:esp32c6:CDCOnBoot=cdc,PartitionScheme=min_spiffs", file_name: "m5nanoc6", tft: false, tft_file: "", build_dir: "esp32c6", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "Marauder Pancake", flag: "MARAUDER_PANCAKE", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=default_8MB,PSRAM=enabled", file_name: "pancake", tft: true, tft_file: "User_Setup_marauder_pancake.h", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master", tft_repo: "H4W9/TFT_eSPI", tft_ref: "ESP32-C5" }

Expand Down Expand Up @@ -148,6 +149,14 @@ jobs:
ref: 1.12.0
path: CustomAdafruit_NeoPixel

- name: Install APA102 for LilyGo T-Dongle C5
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
uses: actions/checkout@v4
with:
repository: pololu/apa102-arduino
ref: 3.0.0
path: CustomAPA102

- name: Install ArduinoJson
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -235,6 +244,10 @@ jobs:
sed -i 's/^\/\/#include <${{ matrix.board.tft_file }}>/#include <${{ matrix.board.tft_file }}>/' /home/runner/work/ESP32Marauder/ESP32Marauder/CustomTFT_eSPI/User_Setup_Select.h
fi

- name: Configure LilyGo T-Dongle C5 partition table
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
run: cp installer/partitions/t_dongle_c5.csv esp32_marauder/partitions.csv

- name: Build Marauder for ${{ matrix.board.name }}
uses: ArminJo/arduino-test-compile@v3.3.0
with:
Expand Down Expand Up @@ -342,6 +355,7 @@ jobs:
| M5 Cardputer | `_m5cardputer.bin` (Available on M5 Burner) |
| M5 Cardputer ADV | `_m5cardputer_adv.bin` |
| ESP32-C5 DevKit | [`_esp32c5_devkit.bin`](https://github.com/justcallmekoko/ESP32Marauder/wiki/ESP32%E2%80%90C5%E2%80%90DevKitC%E2%80%901) |
| LilyGo T-Dongle C5 | `_t_dongle_c5.bin` |
| AWOK V2/V3 screen (white usb) | `_v6_1.bin` |
| AWOK V2 flipper (orange usb) | `_flipper.bin` |
| AWOK V3 flipper (orange usb) | `_marauder_dev_board_pro.bin` |
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ jobs:
- { name: "Marauder CYD 3.5inch", flag: "MARAUDER_CYD_3_5_INCH", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_3_5_inch", tft: true, tft_file: "User_Setup_cyd_3_5_inch.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5Cardputer", flag: "MARAUDER_CARDPUTER", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer", tft: true, tft_file: "User_Setup_marauder_m5cardputer.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5Cardputer ADV", flag: "MARAUDER_CARDPUTER_ADV", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer_adv", tft: true, tft_file: "User_Setup_marauder_m5cardputer_adv.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=min_spiffs,PSRAM=enabled", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=default_8MB,PSRAM=enabled", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "LilyGo T-Dongle C5", flag: "MARAUDER_T_DONGLE_C5", fbqn: "esp32:esp32:esp32c5:CDCOnBoot=cdc,FlashMode=qio,FlashSize=16M,PartitionScheme=custom,PSRAM=enabled", file_name: "t_dongle_c5", tft: true, tft_file: "User_Setup_marauder_t_dongle_c5.h", tft_repo: "H4W9/TFT_eSPI", tft_ref: "ESP32-C5", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
- { name: "M5NanoC6", flag: "MARAUDER_M5_NANO_C6", fbqn: "esp32:esp32:esp32c6:CDCOnBoot=cdc,PartitionScheme=min_spiffs", file_name: "m5nanoc6", tft: false, tft_file: "", build_dir: "esp32c6", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "2.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }

steps:
Expand Down Expand Up @@ -162,8 +163,8 @@ jobs:
- name: Install TFT_eSPI
uses: actions/checkout@v2
with:
repository: Bodmer/TFT_eSPI
ref: V2.5.34
repository: ${{ matrix.board.tft_repo || 'Bodmer/TFT_eSPI' }}
ref: ${{ matrix.board.tft_ref || 'V2.5.34' }}
path: CustomTFT_eSPI

- name: Install XPT2046_Touchscreen
Expand Down Expand Up @@ -201,6 +202,14 @@ jobs:
ref: 1.12.0
path: CustomAdafruit_NeoPixel

- name: Install APA102 for LilyGo T-Dongle C5
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
uses: actions/checkout@v4
with:
repository: pololu/apa102-arduino
ref: 3.0.0
path: CustomAPA102

- name: Install ArduinoJson
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -288,6 +297,10 @@ jobs:
sed -i 's/^\/\/#include <${{ matrix.board.tft_file }}>/#include <${{ matrix.board.tft_file }}>/' /home/runner/work/ESP32Marauder/ESP32Marauder/CustomTFT_eSPI/User_Setup_Select.h
fi

- name: Configure LilyGo T-Dongle C5 partition table
if: matrix.board.flag == 'MARAUDER_T_DONGLE_C5'
run: cp installer/partitions/t_dongle_c5.csv esp32_marauder/partitions.csv

- name: Build Marauder for ${{ matrix.board.name }}
uses: ArminJo/arduino-test-compile@v3.3.0
with:
Expand Down Expand Up @@ -431,4 +444,3 @@ jobs:
| AWOK V2/V3 screen (white usb) | `_v6_1.bin` |
| AWOK V2 flipper (orange usb) | `_flipper.bin` |
| AWOK V3 flipper (orange usb) | `_marauder_dev_board_pro.bin` |

1 change: 1 addition & 0 deletions User_Setup_Select.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
//#include <User_Setup_marauder_m5cardputer_adv.h>
//#include <User_Setup_cyd_3_5_inch.h>
//#include <User_Setup_marauder_pancake.h>
//#include <User_Setup_marauder_t_dongle_c5.h>

//#include <User_Setups/Setup1_ILI9341.h> // Setup file configured for my ILI9341
//#include <User_Setups/Setup2_ST7735.h> // Setup file configured for my ST7735
Expand Down
19 changes: 19 additions & 0 deletions User_Setup_marauder_t_dongle_c5.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// TFT_eSPI setup for the LilyGo T-Dongle C5 onboard 80x160 ST7735 display.
#define ST7735_DRIVER
#define TFT_WIDTH 80
#define TFT_HEIGHT 160
#define ST7735_GREENTAB160x80
#define TFT_RGB_ORDER TFT_BGR

#define TFT_MISO 7
#define TFT_MOSI 2
#define TFT_SCLK 6
#define TFT_CS 10
#define TFT_DC 3
#define TFT_RST 1
#define TFT_BL 0
#define TFT_BACKLIGHT_ON LOW

#define LOAD_GLCD
#define SPI_FREQUENCY 27000000
#define SPI_READ_FREQUENCY 16000000
10 changes: 5 additions & 5 deletions esp32_marauder/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,11 @@ void CommandLine::runCommand(String input) {
this->startScanFromCLI(WIFI_PING_SCAN, TFT_GREEN, "Ping Scan");
}

#ifndef HAS_DUAL_BAND
if (cmd_args.get(0) == ARP_SCAN_CMD) {
this->startScanFromCLI(WIFI_ARP_SCAN, TFT_CYAN, "ARP Scan");
}
#endif
// GCOVR_EXCL_START -- command dispatch requires the firmware CLI runtime.
if (cmd_args.get(0) == ARP_SCAN_CMD) {
this->startScanFromCLI(WIFI_ARP_SCAN, TFT_CYAN, "ARP Scan");
}
// GCOVR_EXCL_STOP

// GPS POI
if (cmd_args.get(0) == GPS_POI_CMD) {
Expand Down
43 changes: 43 additions & 0 deletions esp32_marauder/IPv4Range.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "IPv4Range.h"

namespace marauder {

namespace {

bool isContiguousMask(uint32_t mask) {
const uint32_t inverted = ~mask;
return (inverted & (inverted + 1U)) == 0U;
}

} // namespace

IPv4HostRange ipv4HostRange(uint32_t address, uint32_t subnetMask) {
const uint32_t network = address & subnetMask;
const uint32_t broadcast = network | ~subnetMask;
const bool valid = isContiguousMask(subnetMask) &&
(broadcast - network) >= 2U;

return {network, broadcast, valid ? network + 1U : 0U,
valid ? broadcast - 1U : 0U, valid};
}

uint32_t nextIPv4Host(uint32_t current, const IPv4HostRange& range) {
if (!range.valid || current >= range.last) {
return 0U;
}
if (current < range.first) {
return range.first;
}
return current + 1U;
}

uint32_t previousIPv4Host(uint32_t current, uint32_t steps,
const IPv4HostRange& range) {
if (!range.valid || current < range.first || current > range.last ||
steps > current - range.first) {
return 0U;
}
return current - steps;
}

} // namespace marauder
20 changes: 20 additions & 0 deletions esp32_marauder/IPv4Range.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include <cstdint>

namespace marauder {

struct IPv4HostRange {
uint32_t network;
uint32_t broadcast;
uint32_t first;
uint32_t last;
bool valid;
};

IPv4HostRange ipv4HostRange(uint32_t address, uint32_t subnetMask);
uint32_t nextIPv4Host(uint32_t current, const IPv4HostRange& range);
uint32_t previousIPv4Host(uint32_t current, uint32_t steps,
const IPv4HostRange& range);

} // namespace marauder
52 changes: 45 additions & 7 deletions esp32_marauder/LedInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,41 @@ void LedInterface::RunSetup() {
strip.show();
#endif

#ifdef HAS_T_DONGLE_LED
pinMode(T_DONGLE_LED_DATA_PIN, OUTPUT);
pinMode(T_DONGLE_LED_CLOCK_PIN, OUTPUT);
this->writeApa102Color(0, 0, 0);
#endif

this->initTime = millis();
}

void LedInterface::main(uint32_t currentTime) {
if ((!settings_obj.loadSetting<bool>("EnableLED")) ||
(this->current_mode == MODE_OFF)) {
uint8_t mode_to_render = settings_obj.loadSetting<bool>("EnableLED")
? this->current_mode : MODE_OFF;

#ifdef HAS_T_DONGLE_LED
// Only clock a frame when the state changes. Continuously sending idle
// frames can make some APA102-compatible parts fall back to white.
if (mode_to_render == this->last_t_dongle_mode) return;
this->last_t_dongle_mode = mode_to_render;
#endif

if (mode_to_render == MODE_OFF) {
this->ledOff();
return;
}

else if (this->current_mode == MODE_RAINBOW) {
else if (mode_to_render == MODE_RAINBOW) {
this->rainbow();
}
else if (this->current_mode == MODE_ATTACK) {
else if (mode_to_render == MODE_ATTACK) {
this->attackLed();
}
else if (this->current_mode == MODE_SNIFF) {
else if (mode_to_render == MODE_SNIFF) {
this->sniffLed();
}
else if (this->current_mode == MODE_CUSTOM) {
else if (mode_to_render == MODE_CUSTOM) {
return;
}
else {
Expand All @@ -58,13 +73,35 @@ uint8_t LedInterface::getMode() {
return this->current_mode;
}

#ifdef HAS_T_DONGLE_LED
void LedInterface::refresh() {
// GPIO2 is shared with the display MOSI line. Re-send the intended LED
// frame after display traffic, even when the Marauder mode did not change.
this->last_t_dongle_mode = 0xFF;
this->main(millis());
}
#endif

void LedInterface::setColor(int r, int g, int b) {
#ifdef HAS_NEOPIXEL_LED
strip.setPixelColor(0, strip.Color(r, g, b));
strip.show();
#endif
#ifdef HAS_T_DONGLE_LED
this->writeApa102Color(static_cast<uint8_t>(r), static_cast<uint8_t>(g),
static_cast<uint8_t>(b));
#endif
}

#ifdef HAS_T_DONGLE_LED
void LedInterface::writeApa102Color(uint8_t red, uint8_t green, uint8_t blue) {
const uint8_t brightness = (red || green || blue) ? 10 : 0;
this->t_dongle_led.startFrame();
this->t_dongle_led.sendColor(red, green, blue, brightness);
this->t_dongle_led.endFrame(1);
}
#endif

void LedInterface::sniffLed() {
this->setColor(0, 0, 255);
}
Expand Down Expand Up @@ -103,4 +140,5 @@ uint32_t LedInterface::Wheel(byte WheelPos) {
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
#endif
}
return 0;
}
16 changes: 16 additions & 0 deletions esp32_marauder/LedInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#ifdef HAS_NEOPIXEL_LED
#include <Adafruit_NeoPixel.h>
#endif
#ifdef HAS_T_DONGLE_LED
#include <APA102.h>
#endif

#define Pixels 1

Expand All @@ -23,6 +26,11 @@ class LedInterface {
private:
uint32_t initTime = 0;

#ifdef HAS_T_DONGLE_LED
uint8_t last_t_dongle_mode = 0xFF;
APA102<T_DONGLE_LED_DATA_PIN, T_DONGLE_LED_CLOCK_PIN> t_dongle_led;
#endif

int current_fade_itter = 1;
int wheel_pos = 255;
int wheel_speed = 1; // lower = slower
Expand All @@ -35,13 +43,21 @@ class LedInterface {
void ledOff();
void attackLed();
void sniffLed();

#ifdef HAS_T_DONGLE_LED
void writeApa102Color(uint8_t red, uint8_t green, uint8_t blue);
#endif

public:
LedInterface();

void RunSetup();
void main(uint32_t currentTime);

#ifdef HAS_T_DONGLE_LED
void refresh();
#endif

void setMode(uint8_t);
void setColor(int r, int g, int b);
uint8_t getMode();
Expand Down
Loading
Loading