Fill in serial field for all HID controllers using hidapi
This commit is contained in:
parent
92dc8411d6
commit
d19baf1365
101 changed files with 446 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ RGBController_ThermaltakeRiing::RGBController_ThermaltakeRiing(ThermaltakeRiingC
|
|||
type = DEVICE_TYPE_COOLER;
|
||||
description = "Thermaltake Riing Device";
|
||||
location = riing->GetDeviceLocation();
|
||||
serial = riing->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
|
|
|
|||
|
|
@ -29,6 +29,17 @@ std::string ThermaltakeRiingController::GetDeviceLocation()
|
|||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string ThermaltakeRiingController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
std::wstring return_wstring = serial_string;
|
||||
std::string return_string(return_wstring.begin(), return_wstring.end());
|
||||
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
void ThermaltakeRiingController::SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors)
|
||||
{
|
||||
unsigned char* color_data = new unsigned char[3 * num_colors];
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public:
|
|||
~ThermaltakeRiingController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors);
|
||||
void SetMode(unsigned char mode, unsigned char speed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue