Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A cross-platform tool to control USB gaming headsets on **Linux**, **macOS**, an
| Logitech G633/G635/G733/G933/G935 | All | x | x | | x | | | | | | | | | | | | |
| Logitech G431/G432/G433 | All | x | | | | | | | | | | | | | | | |
| Logitech G930 | All | x | x | | | | | | | | | | | | | | |
| Logitech G PRO X 2 LIGHTSPEED | All | x | x | | | x | | | | | | | | | | | |
| Logitech G PRO X 2 LIGHTSPEED | All | x | x | | | x | | | | x | x | x | | | | | |
| Logitech G PRO Series | All | x | x | | | x | | | | | | | | | | | |
| Logitech Zone Wired/Zone 750 | All | x | | | | | | x | x | | | | | | | | |
| Corsair Headset Device | All | x | x | x | x | | | | | | | | | | | | |
Expand Down
51 changes: 33 additions & 18 deletions docs/LIBRARY_USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ headsetcontrol -o env

### Status Values

| Status | Description |
|--------|-------------|
| Status | Description |
| --------- | ------------------------------ |
| `success` | All queries completed normally |
| `partial` | Some queries failed |
| `failure` | Device communication failed |
| `partial` | Some queries failed |
| `failure` | Device communication failed |

### Battery Status Values

| Status | Description |
|--------|-------------|
| `BATTERY_AVAILABLE` | Battery level available |
| `BATTERY_CHARGING` | Currently charging (level may be -1) |
| `BATTERY_UNAVAILABLE` | Device unavailable/off |
| Status | Description |
| --------------------- | ------------------------------------ |
| `BATTERY_AVAILABLE` | Battery level available |
| `BATTERY_CHARGING` | Currently charging (level may be -1) |
| `BATTERY_UNAVAILABLE` | Device unavailable/off |

### Performing Actions

Expand All @@ -73,24 +73,28 @@ headsetcontrol -s 64 -b -o json
```

Action results include status:

```json
{
"devices": [{
"sidetone": {
"status": "success",
"level": 64
},
"battery": {
"status": "BATTERY_AVAILABLE",
"level": 85
"devices": [
{
"sidetone": {
"status": "success",
"level": 64
},
"battery": {
"status": "BATTERY_AVAILABLE",
"level": 85
}
}
}]
]
}
```

### API Versioning

The `api_version` field uses semantic versioning:

- First number increments on **breaking changes**
- Second number increments on **additions**

Expand Down Expand Up @@ -327,6 +331,12 @@ if (headset.supports(CAP_EQUALIZER_PRESET)) {
headset.setEqualizerPreset(2); // Preset #2

int presetCount = headset.getEqualizerPresetsCount();

if (auto presets = headset.getEqualizerPresets()) {
for (const auto& preset : presets->presets) {
std::cout << preset.name << ": " << preset.values.size() << " bands\n";
}
}
}

// Custom EQ curve
Expand Down Expand Up @@ -535,6 +545,7 @@ int count = hsc_discover(&headsets); // Includes test device
```

The test device implements all capabilities and returns predictable values, making it useful for:

- Testing library integration
- Developing GUI applications
- CI/CD pipelines
Expand All @@ -550,20 +561,24 @@ The test device implements all capabilities and returns predictable values, maki
## Platform Notes

### Linux

- Requires udev rules for non-root access
- Generate with: `headsetcontrol -u > /etc/udev/rules.d/70-headset.rules`
- Reload: `sudo udevadm control --reload-rules && sudo udevadm trigger`

### macOS

- No special permissions needed

### Windows

- Uses SetupAPI for device access
- May require running as Administrator for some devices

## Dependencies

When linking manually, you need:

- **HIDAPI**: `libhidapi` (automatically linked when using CMake subdirectory)
- **Math library**: `-lm` on Linux/macOS

Expand Down
Loading
Loading