|
@@ -3,45 +3,108 @@
|
|
|
## Status
|
|
## Status
|
|
|
|
|
|
|
|
- ✅ Go module initialized (`github.com/wobkey/rgb`)
|
|
- ✅ Go module initialized (`github.com/wobkey/rgb`)
|
|
|
-- ✅ `git init` + AGENTS.md + README.md
|
|
|
|
|
-- ✅ Directory structure: `cmd/wobkey/`, `internal/device/`, `internal/hid/`, `internal/rgb/`, `internal/via/`
|
|
|
|
|
-- ✅ Pure-Go HID layer: reads `/dev/hidraw*`, `/sys/class/hidraw/*/report_descriptor`, and HID metadata (no cgo, no libudev)
|
|
|
|
|
-- ✅ Keyboard discovery: detects Impact 80 (VID `0x36B0`, PID `0x309F`) and Rainy 75
|
|
|
|
|
-- ✅ All 8 RGB subcommands implemented (effect, brightness, speed, color, mode, enable, disable, info)
|
|
|
|
|
-- ✅ `go build` ✅ `go vet` ✅ `go test ./...` ✅ `gofmt` clean
|
|
|
|
|
-- ✅ QMK v12 Raw HID protocol: custom set/get values with 32-byte reports and response validation
|
|
|
|
|
-- ✅ Impact 80 three-zone lighting control (logo, backlight, side)
|
|
|
|
|
-- ✅ `keyboards.json` with decimal VID/PID
|
|
|
|
|
|
|
+- ✅ HID discovery and QMK v12 Raw HID transport implemented
|
|
|
|
|
+- ✅ Impact 80 three-zone lighting control (Logo, Backlight, Side) implemented
|
|
|
|
|
+- ✅ Zone selection with default-all and explicit `--zone` behavior implemented
|
|
|
|
|
+- ✅ Zone-aware effect names, aliases, and target resolution implemented
|
|
|
|
|
+- ✅ Per-zone `rgb info` JSON implemented
|
|
|
|
|
+- ✅ All RGB subcommands implemented (effect, brightness, speed, color, mode, enable, disable, info)
|
|
|
|
|
+- ✅ Automated tests, vet, formatting, and build verification
|
|
|
|
|
+- ⚠️ Hardware smoke discovery succeeds, but the connected Impact 80 is blocked by root-only `/dev/hidraw7` permissions
|
|
|
|
|
|
|
|
-## Open Issues
|
|
|
|
|
|
|
+## Zone-Aware Lighting Semantics
|
|
|
|
|
|
|
|
-### 1. Impact 80 Effect Mapping
|
|
|
|
|
|
|
+The `rgb` command has a persistent `--zone` flag with the values `logo`,
|
|
|
|
|
+`backlight`, and `side`. Without the flag, commands target Logo, Backlight,
|
|
|
|
|
+and Side in that order. With the flag, commands target exactly one zone.
|
|
|
|
|
|
|
|
-The keyboard's official VIA definition uses model-specific effect IDs for its three lighting zones. The generic QMK effect list in `internal/rgb/effects.go` does not yet map names such as `rainbow` to those IDs.
|
|
|
|
|
|
|
+An unknown effect name fails before the device is opened. An effect that is
|
|
|
|
|
+unsupported by an explicitly selected zone also fails before the device is
|
|
|
|
|
+opened. For a default all-zone request, supported zones receive the command
|
|
|
|
|
+and unsupported zones are skipped with a warning on stderr.
|
|
|
|
|
|
|
|
-### 2. Cross-Platform HID Backends
|
|
|
|
|
|
|
+The exact effect examples are:
|
|
|
|
|
|
|
|
-The current transport is Linux-specific (`/dev/hidraw*` and Linux syscalls). macOS and Windows builds need platform-specific HID backends or a shared library.
|
|
|
|
|
|
|
+```bash
|
|
|
|
|
+wobkey rgb effect breathing
|
|
|
|
|
+wobkey rgb effect rainbow_moving_chevron
|
|
|
|
|
+wobkey rgb effect rainbow_moving_chevron --zone backlight
|
|
|
|
|
+wobkey rgb brightness 160
|
|
|
|
|
+wobkey rgb speed 2
|
|
|
|
|
+wobkey rgb color 00ff00
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
-### 3. Documentation and Release Artifacts
|
|
|
|
|
|
|
+## Effect Families
|
|
|
|
|
|
|
|
-Keep protocol documentation, keyboard metadata, and generated graph outputs synchronized with the implementation.
|
|
|
|
|
|
|
+Logo and Side share the complete seven-name family:
|
|
|
|
|
|
|
|
-## Quick Commands for Next Session
|
|
|
|
|
|
|
+```text
|
|
|
|
|
+none, wave, fixed_wave, spectrum, breathing, light, shutdown
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
-```bash
|
|
|
|
|
-# Rebuild with latest code
|
|
|
|
|
-go build -o /tmp/wobkey ./cmd/wobkey/
|
|
|
|
|
|
|
+Backlight uses these complete 46 names, with IDs 0–45:
|
|
|
|
|
|
|
|
-# Discover the QMK Raw HID interface
|
|
|
|
|
-/tmp/wobkey keyboard info
|
|
|
|
|
|
|
+```text
|
|
|
|
|
+none, solid_color, alphas_mods, gradient_up_down, gradient_left_right,
|
|
|
|
|
+breathing, band_sat, band_val, band_pinwheel_sat, band_pinwheel_val,
|
|
|
|
|
+band_spiral_sat, band_spiral_val, cycle_all, cycle_left_right,
|
|
|
|
|
+cycle_up_down, cycle_out_in, cycle_out_in_dual, rainbow_moving_chevron,
|
|
|
|
|
+cycle_pinwheel, cycle_spiral, dual_beacon, rainbow_beacon,
|
|
|
|
|
+rainbow_pinwheels, flower_blooming, raindrops, jellybean_raindrops,
|
|
|
|
|
+hue_breathing, hue_pendulum, hue_wave, pixel_flow, digital_rain,
|
|
|
|
|
+solid_reactive, solid_reactive_wide, solid_reactive_multiwide,
|
|
|
|
|
+solid_reactive_cross, solid_reactive_multicross, solid_reactive_nexus,
|
|
|
|
|
+solid_reactive_multinexus, splash, multisplash, solid_splash,
|
|
|
|
|
+solid_multisplash, starlight, starlight_dual_hue, starlight_dual_sat,
|
|
|
|
|
+riverflow
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
-# Test RGB state
|
|
|
|
|
-/tmp/wobkey rgb disable
|
|
|
|
|
-/tmp/wobkey rgb info
|
|
|
|
|
|
|
+Backlight ID 39 is `multisplash`; ID 41 is the distinct
|
|
|
|
|
+`solid_multisplash` name. Compatibility aliases are `off`, `breathe`,
|
|
|
|
|
+`rainbow`, `rainbow_wave`, `solid`, and the legacy `static` alias; aliases
|
|
|
|
|
+resolve independently for each zone.
|
|
|
|
|
+
|
|
|
|
|
+## Verification
|
|
|
|
|
|
|
|
-# Run all checks
|
|
|
|
|
|
|
+Run the complete automated check set from the repository root:
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
gofmt -w .
|
|
gofmt -w .
|
|
|
|
|
+go test -count=1 ./...
|
|
|
go vet ./...
|
|
go vet ./...
|
|
|
-go test ./...
|
|
|
|
|
|
|
+go build -o /tmp/wobkey ./cmd/wobkey/
|
|
|
|
|
+git diff --check
|
|
|
```
|
|
```
|
|
|
|
|
+
|
|
|
|
|
+Run the hardware smoke sequence when the Impact 80 is available:
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+/tmp/wobkey keyboard info
|
|
|
|
|
+/tmp/wobkey rgb effect breathing
|
|
|
|
|
+/tmp/wobkey rgb effect rainbow_moving_chevron
|
|
|
|
|
+/tmp/wobkey rgb effect rainbow_moving_chevron --zone backlight
|
|
|
|
|
+/tmp/wobkey rgb info
|
|
|
|
|
+/tmp/wobkey rgb color 00ff00
|
|
|
|
|
+/tmp/wobkey rgb disable
|
|
|
|
|
+/tmp/wobkey rgb enable
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+The expected result is three selected zones, warnings only for unsupported
|
|
|
|
|
+default targets, a working explicit Backlight command, per-zone JSON from
|
|
|
|
|
+`rgb info`, and a final enabled state. Record device or permission failures
|
|
|
|
|
+without changing unrelated code.
|
|
|
|
|
+
|
|
|
|
|
+## Open Issues
|
|
|
|
|
+
|
|
|
|
|
+### Cross-Platform HID Backends
|
|
|
|
|
+
|
|
|
|
|
+The current transport is Linux-specific (`/dev/hidraw*` and Linux syscalls).
|
|
|
|
|
+macOS and Windows require platform-specific HID backends or a shared library.
|
|
|
|
|
+
|
|
|
|
|
+### Hardware Environment
|
|
|
|
|
+
|
|
|
|
|
+Hardware smoke tests require the Impact 80 to be connected and the user to
|
|
|
|
|
+have permission to access its hidraw device. In the acceptance environment,
|
|
|
|
|
+`/dev/hidraw7` is `root:root` with mode `600`, so discovery succeeds but all
|
|
|
|
|
+HID opens fail with `permission denied`. No persistent profile storage or
|
|
|
|
|
+EEPROM save command is included.
|