fix: Audit-Findings behoben (Perf, Security, Quality)

- Sleep vor HID-Reads entfernt — read_timeout reicht als
  Synchronisation, spart ~300ms pro Aufruf
- udev-Regel: MODE 0660 + GROUP plugdev statt world-writable 0666
- Eigener CorsairError::SidetoneNotFound für fehlende ALSA-Controls
- Response-Validierung vorbereitet (parse_response_validated),
  Korrelation noch deaktiviert da Response-Format andere Endpoint-IDs
  nutzt als das Request-Format (0x00/0x01 vs 0x08/0x09)
- Protokoll-Doku zum Response-Format korrigiert
- 18 neue Tests für output.rs (Waybar-JSON Formatierung + Grenzwerte)
This commit is contained in:
2026-03-27 23:11:50 +01:00
parent 488c4c2631
commit a9d526023d
8 changed files with 185 additions and 19 deletions
+9 -4
View File
@@ -26,13 +26,18 @@ Rest: 0x00-gepaddet auf 65 Bytes
### Response (Gerät → Host)
```
Byte 0: 0x02Protokoll-Marker
Byte 1: Status — 0x00 = OK, 0xF0/0xF1 = Error/Not Supported
Byte 2: Endpoint — Echo des Request-Endpoints
Byte 3: Command — Echo des Request-Commands
Byte 0: 0x01Report-Typ (immer 0x01, NICHT 0x02 wie im Request)
Byte 1: Endpoint — 0x00 = Receiver, 0x01 = Headset (andere IDs als im Request!)
Bei Fehler: 0xF0/0xF1 = Error/Not Supported
Byte 2: Command — Echo: 0x01 = SET, 0x02 = GET
Byte 3: Status — 0x00 = OK
Byte 4+: Daten — Property-Wert (typisch uint16 Little-Endian in Bytes 4-5)
```
**Achtung:** Das Response-Format weicht vom Request-Format ab:
- Byte 0 ist `0x01` (nicht `0x02` wie der Request-Marker)
- Endpoint-IDs sind `0x00`/`0x01` (nicht `0x08`/`0x09` wie im Request)
**Fehler-Erkennung:** Byte 1 == 0xF0 oder 0xF1 bedeutet, dass die Property nicht
unterstützt wird oder der Request ungültig war.