Files
nvcurve/Makefile
T
ARIA 1e11a2c18b feat: wireview firmware check + DFU flash (bundled image, dfu-util)
Port of the wireview-linux firmware update feature:

- nvcurve/wireview_firmware.py: Intel-HEX parser (checksum-verified),
  BuildStruct identity extraction (vendor/product/version/build string
  at image base + 192), compatibility verdicts (version then build
  date, Noctua Edition product alias + 2026-09-02 floor), and a
  dfu-util flasher (progress parsing, exit-74-after-:leave quirk,
  timeouts).
- Bundle TG-WV-PRO2-FW.hex (v05, build 20260902_0741, base
  0x08000000) in nvcurve/firmware/.
- WireViewSerialDevice.enter_bootloader() sends the top-level 0xF1
  command; vendor/product ids are exposed in info().
- GET /api/wireview/firmware (device vs. bundled verdict, dfu-util
  availability, flash state) and POST /api/wireview/firmware/flash
  (gates: serial transport, product match, Noctua floor, downgrade/
  same require override). The flash runs as a background task
  (bootloader -> wait for 0483:df11 -> dfu-util) with progress
  streamed over /ws/wireview.
- WireView tab: Firmware card with device vs. bundled firmware,
  verdict, dfu-util/hwmon warnings, confirm dialog, live progress
  bar; re-checks after the device reboots.
- tests/test_wireview_firmware.py: 66 tests (HEX parser, checksum
  rejection, identity, all verdict paths, mocked flasher, bootloader
  command via pty); added to the Makefile test target.
- Docs: firmware section in docs/WireView.md, README note.
2026-10-05 20:07:19 +02:00

33 lines
1.0 KiB
Makefile

# NVCurve — developer convenience targets.
#
# End users don't need make: run ./install.sh (see README "Installation").
UV ?= uv
NPM ?= npm
.PHONY: help frontend frontend-dev install dev test clean
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
frontend: ## Build the React frontend into frontend/dist
cd frontend && $(NPM) ci && $(NPM) run build
frontend-dev: ## Run the Vite dev server (hot reload)
cd frontend && $(NPM) run dev
install: ## Install nvcurve as a uv tool (builds frontend if missing/stale)
$(UV) tool install --force .
dev: ## Create/refresh the dev environment (uv sync)
$(UV) sync
test: ## Run the test suite
$(UV) run python tests/test_security.py
$(UV) run python tests/test_rm_power.py
$(UV) run python tests/test_wireview.py
$(UV) run python tests/test_wireview_firmware.py
$(UV) run python tests/test_processes.py
clean: ## Remove build artifacts
rm -rf frontend/dist frontend/node_modules