Files
OpenRGB/Controllers/SteelSeriesController/SteelSeriesApex3Controller.cpp
Chris 085e1fca41 Initial commit for the Steelseries Apex 3 TKL to resolve #1902
* Combining the Apex3 Full size and TKL controllers
* Cleanup of controllers for readability and optimisation
2022-11-25 23:55:49 +00:00

44 lines
1.3 KiB
C++

/*-------------------------------------------------------------------*\
| SteelSeriesApex3Controller.cpp |
| |
| Driver for Steelseries Apex3 Controllers |
| This is the base class for the Ten Zone and 8 Zone keyboards |
| |
| Chris M (Dr_No) 23rd Feb 2022 |
\*-------------------------------------------------------------------*/
#include <cstring>
#include "SteelSeriesApex3Controller.h"
SteelSeriesApex3Controller::SteelSeriesApex3Controller(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
}
SteelSeriesApex3Controller::~SteelSeriesApex3Controller()
{
hid_close(dev);
}
std::string SteelSeriesApex3Controller::GetDeviceLocation()
{
return("HID: " + location);
}
std::string SteelSeriesApex3Controller::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);
}