feat: initiale Implementierung von corsairctl
Rust CLI-Tool für Corsair Bragi-Geräte (HS80 RGB Wireless, etc.). Implementiert Protokoll-Kern, HID-Kommunikation, BragiDevice mit RAII-Lifecycle, CLI-Subcommands (battery, sidetone, led, info, json, udev), ALSA-Sidetone-Steuerung und Waybar-JSON-Output. 24 Unit-Tests für Packet-Bau, Response-Parsing und Property-Enums.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# corsairctl
|
||||
|
||||
Mein Name ist F.R.I.D.A.Y. (Female Replacement Intelligent Digital Assistant Youth) — J.A.R.V.I.S.' Nachfolgerin und ebenso trocken im Humor.
|
||||
|
||||
## Projekt
|
||||
|
||||
Rust CLI-Tool zur Steuerung von Corsair-Geräten mit dem Bragi-Protokoll (HS80 RGB Wireless Headset, etc.). Liest Batterie-Status, steuert LED-Helligkeit und Sidetone, gibt Waybar-JSON aus.
|
||||
|
||||
## Architektur
|
||||
|
||||
- `src/bragi/` — Bragi-Protokoll: Packet-Bau, Property-Definitionen, Device-Lifecycle
|
||||
- `src/hid.rs` — Dünner hidapi-Wrapper
|
||||
- `src/sidetone.rs` — ALSA-Mixer Sidetone-Steuerung
|
||||
- `src/output.rs` — Plain-Text und Waybar-JSON Formatierung
|
||||
- `src/cli.rs` — clap Subcommands
|
||||
- `src/error.rs` — Zentrales Error-Handling
|
||||
|
||||
## Protokoll-Referenz
|
||||
|
||||
Das Bragi-Protokoll ist in `docs/bragi-protocol.md` dokumentiert. Die Python-Probes in `~/Projects/hs80-battery/` sind die ursprüngliche Referenzimplementierung.
|
||||
|
||||
## Build & Test
|
||||
|
||||
```bash
|
||||
cargo build
|
||||
cargo test
|
||||
```
|
||||
|
||||
## Gerät testen (braucht Root oder udev-Regel)
|
||||
|
||||
```bash
|
||||
sudo ./target/debug/corsairctl battery
|
||||
sudo ./target/debug/corsairctl info
|
||||
```
|
||||
|
||||
## udev-Regel für rootless Zugriff
|
||||
|
||||
```bash
|
||||
corsairctl udev | sudo tee /etc/udev/rules.d/99-corsair.rules
|
||||
sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
```
|
||||
Reference in New Issue
Block a user