MSI MPG 491CQP Control
USB HID control for MSI MPG 491CQP monitor. Rust implementation.
Project Structure
crates/
├── msi-core/ # Core library (protocol, features, monitor API)
├── msi-cli/ # Command-line interface
├── msi-gui/ # Desktop GUI (Dioxus)
└── msi-hwtest/ # Hardware integration tests
docs/
├── protocol/ # Protocol specifications (source of truth)
├── guides/ # User guides
└── research/ # Research notes and data
Before Making Changes
- Run
cargo testto verify tests pass - Read the relevant AGENTS.md in subdirectories (
crates/AGENTS.md,docs/AGENTS.md)
After Making Changes
- Run
cargo fmt(no approval needed) - Run
cargo clippyand fix warnings - Run
cargo testto verify nothing broke - For protocol changes, update
docs/protocol/usb-hid-reference.md
Always Do
- Commit changes after each logical step (don't wait to be reminded)
- When you discover a missing rule, add it to AGENTS.md
- Use Report ID
0x01in all USB HID commands (0x00 fails silently) - Encode feature codes as 5 ASCII characters (
0x0400→"00400") - Use 3-digit decimal values for most features (
75→"075") - Document protocol discoveries in
docs/protocol/
Never Do
- Use Report ID
0x00(fails silently, no error returned) - Commit binary files (pcap captures, firmware, etc.)
- Guess at protocol details without verification from captures
- Test unknown feature codes without asking (could have side effects)
Ask First
- Testing unknown feature codes on hardware
- Adding new dependencies to Cargo.toml
- Major architectural changes
Quick Commands
cargo build --release # Build all
cargo test # Unit tests
cargo run --bin msi-cli -- list # Test CLI
cargo clippy # Lint
just check # Full check (requires just)
Hardware Setup
- Linux: Install udev rules:
sudo cp config/udev/99-msi-monitor.rules /etc/udev/rules.d/ - macOS: No setup required
- Windows: HID driver usually automatic
See Also
crates/AGENTS.md- Rust code patternsdocs/AGENTS.md- Documentation guidelinesdocs/protocol/usb-hid-reference.md- Protocol specification