Initial commit for the Steelseries Aerox 3 mouse to resolve #2492

+ Adding STEELSERIES_AEROX_3_PID and registering detector
+ Adding Abstract SteelSeriesMouseController class to accomodate new mouse
+ Adding SteelSeriesAerox3Controller class
* Rewrote SteelSeriesRival3Controller to align with abstract class
* Adjusted RGBController_SteelSeriesRival3 class to align with both mice
This commit is contained in:
Chris
2022-06-10 01:32:16 +10:00
parent d193c93e6d
commit a961bf87b4
11 changed files with 480 additions and 122 deletions

View File

@@ -0,0 +1,61 @@
/*-------------------------------------------------------------------*\
| SteelSeriesMouseController.cpp |
| |
| OpenRGB abstract driver for SteelSeries Mice |
| |
| Chris M (Dr_No) 9th June 2022 |
\*-------------------------------------------------------------------*/
#include <cstring>
#include "SteelSeriesMouseController.h"
SteelSeriesMouseController::SteelSeriesMouseController(hid_device* dev_handle, steelseries_type proto_type, const char* path)
{
dev = dev_handle;
location = path;
proto = proto_type;
}
SteelSeriesMouseController::~SteelSeriesMouseController()
{
}
std::string SteelSeriesMouseController::GetDeviceLocation()
{
return("HID: " + location);
}
char* SteelSeriesMouseController::GetDeviceName()
{
return device_name;
}
std::string SteelSeriesMouseController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if (ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
steelseries_type SteelSeriesMouseController::GetMouseType()
{
return proto;
}
void SteelSeriesMouseController::Save()
{
const uint8_t SAVE_BUFFER_SIZE = 10;
uint8_t usb_buf[SAVE_BUFFER_SIZE] = { 0x00, 0x09 };
hid_write(dev, usb_buf, SAVE_BUFFER_SIZE);
}