Skip to content
Merged
Changes from all 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
26 changes: 26 additions & 0 deletions lib/devices/steelseries_arctis_7_plus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ namespace headsetcontrol {
* - Chatmix
* - Inactive time
* - Equalizer (10 bands, -12 to +12 range)
*
* Every setter follows the write with the save command (00 09), so the value
* survives a power cycle. That means each set writes to flash - worth knowing
* before calling these on a timer.
*/
class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeriesArctis7Plus> {
public:
Expand Down Expand Up @@ -85,6 +89,12 @@ class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeri
return presets;
}

Result<void> saveStateArctis7Plus(hid_device* device_handle) const
{
std::array<uint8_t, 2> cmd { 0x00, 0x09 };
return sendCommand(device_handle, cmd);
}

// Rich Results V2 API
Result<BatteryResult> getBattery(hid_device* device_handle) override
{
Expand Down Expand Up @@ -137,6 +147,10 @@ class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeri
return result.error();
}

if (auto save_result = saveStateArctis7Plus(device_handle); !save_result) {
return save_result.error();
}

return SidetoneResult {
.current_level = level,
.min_level = 0,
Expand All @@ -158,6 +172,10 @@ class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeri
return result.error();
}

if (auto save_result = saveStateArctis7Plus(device_handle); !save_result) {
return save_result.error();
}

return InactiveTimeResult {
.minutes = minutes,
.min_minutes = 0,
Expand Down Expand Up @@ -228,6 +246,10 @@ class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeri
return result.error();
}

if (auto save_result = saveStateArctis7Plus(device_handle); !save_result) {
return save_result.error();
}

return EqualizerPresetResult { .preset = preset, .total_presets = EQUALIZER_PRESETS_COUNT };
}

Expand Down Expand Up @@ -255,6 +277,10 @@ class SteelSeriesArctis7Plus : public protocols::SteelSeriesNovaDevice<SteelSeri
return result.error();
}

if (auto save_result = saveStateArctis7Plus(device_handle); !save_result) {
return save_result.error();
}

return EqualizerResult {};
}
};
Expand Down
Loading