mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-18 11:35:21 -04:00
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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user