Fill in serial field for all HID controllers using hidapi

This commit is contained in:
Adam Honse 2020-12-03 00:01:42 -06:00
parent 92dc8411d6
commit d19baf1365
101 changed files with 446 additions and 2 deletions

View file

@ -49,6 +49,17 @@ char* AMDWraithPrismController::GetDeviceName()
return device_name;
}
std::string AMDWraithPrismController::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);
}
std::string AMDWraithPrismController::GetEffectChannelString(unsigned char channel)
{
std::string ret_string = "";

View file

@ -117,6 +117,7 @@ public:
std::string GetEffectChannelString(unsigned char channel);
std::string GetFirmwareVersionString();
std::string GetLocationString();
std::string GetSerialString();
void SetRingEffectChannel(unsigned char channel);

View file

@ -19,6 +19,7 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
description = "AMD Wraith Prism Device";
version = wraith->GetFirmwareVersionString();
location = wraith->GetLocationString();
serial = wraith->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -26,6 +26,17 @@ std::string AuraCoreController::GetDeviceLocation()
return("HID: " + location);
}
std::string AuraCoreController::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 AuraCoreController::SendBrightness
(
unsigned char brightness

View file

@ -52,6 +52,7 @@ public:
~AuraCoreController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendBrightness
(

View file

@ -17,6 +17,7 @@ RGBController_AuraCore::RGBController_AuraCore(AuraCoreController* aura_ptr)
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Core Device";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -27,6 +27,17 @@ std::string AuraMouseController::GetDeviceLocation()
return("HID: " + location);
}
std::string AuraMouseController::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 AuraMouseController::SendUpdate
(
unsigned char zone,

View file

@ -38,6 +38,7 @@ public:
virtual ~AuraMouseController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendUpdate
(

View file

@ -40,6 +40,17 @@ std::string AuraUSBController::GetDeviceName()
return(device_name);
}
std::string AuraUSBController::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);
}
const std::vector<AuraDeviceInfo>& AuraUSBController::GetAuraDevices() const
{
return(device_info);

View file

@ -66,6 +66,7 @@ public:
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetSerialString();
const std::vector<AuraDeviceInfo>& GetAuraDevices() const;

View file

@ -18,6 +18,7 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
type = DEVICE_TYPE_MOUSE;
description = "ASUS Aura Mouse Device";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -20,6 +20,7 @@ RGBController_AuraUSB::RGBController_AuraUSB(AuraUSBController* aura_ptr) :
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASUS Aura USB Device";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -59,6 +59,17 @@ std::string CorsairLightingNodeController::GetLocationString()
return("HID: " + location);
}
std::string CorsairLightingNodeController::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 CorsairLightingNodeController::SetChannelEffect(unsigned char channel,
unsigned char num_leds,
unsigned char mode,

View file

@ -84,6 +84,7 @@ public:
std::string GetFirmwareString();
std::string GetLocationString();
std::string GetSerialString();
unsigned int GetStripsOnChannel(unsigned int channel);

View file

@ -20,6 +20,7 @@ RGBController_CorsairLightingNode::RGBController_CorsairLightingNode(CorsairLigh
type = DEVICE_TYPE_LEDSTRIP;
version = corsair->GetFirmwareString();
location = corsair->GetLocationString();
serial = corsair->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -96,6 +96,17 @@ std::string CorsairPeripheralController::GetName()
return name;
}
std::string CorsairPeripheralController::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 CorsairPeripheralController::SetLEDs(std::vector<RGBColor>colors)
{
switch(type)

View file

@ -75,6 +75,7 @@ public:
std::string GetDeviceLocation();
std::string GetFirmwareString();
std::string GetName();
std::string GetSerialString();
void SetLEDs(std::vector<RGBColor> colors);
void SetLEDsKeyboardFull(std::vector<RGBColor> colors);

View file

@ -580,6 +580,7 @@ RGBController_CorsairPeripheral::RGBController_CorsairPeripheral(CorsairPeripher
type = corsair->GetDeviceType();
version = corsair->GetFirmwareString();
location = corsair->GetDeviceLocation();
serial = corsair->GetSerialString();
physical_layout = corsair->GetPhysicalLayout();
logical_layout = corsair->GetLogicalLayout();

View file

@ -28,6 +28,17 @@ std::string DuckyKeyboardController::GetDeviceLocation()
return("HID: " + location);
}
std::string DuckyKeyboardController::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 DuckyKeyboardController::SendColors
(
unsigned char* color_data,

View file

@ -21,6 +21,7 @@ public:
~DuckyKeyboardController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendColors
(

View file

@ -180,6 +180,7 @@ RGBController_DuckyKeyboard::RGBController_DuckyKeyboard(DuckyKeyboardController
type = DEVICE_TYPE_KEYBOARD;
description = "Ducky Keyboard Device";
location = ducky->GetDeviceLocation();
serial = ducky->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -27,6 +27,17 @@ std::string ATC800Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string ATC800Controller::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 ATC800Controller::SendCoolerMode
(
unsigned char mode,

View file

@ -45,6 +45,7 @@ public:
~ATC800Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendCoolerMode
(

View file

@ -18,6 +18,7 @@ RGBController_AorusATC800::RGBController_AorusATC800(ATC800Controller* cooler_pt
type = DEVICE_TYPE_COOLER;
description = "Aorus ATC800 CPU Cooler";
location = cooler->GetDeviceLocation();
serial = cooler->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -21,6 +21,17 @@ std::string HoltekA070Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string HoltekA070Controller::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);
}
/*-------------------------------------------------------------------------------------------------*\
| Private packet sending functions. |
\*-------------------------------------------------------------------------------------------------*/

View file

@ -28,6 +28,7 @@ public:
~HoltekA070Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendCustomColor
(

View file

@ -17,6 +17,7 @@ RGBController_HoltekA070::RGBController_HoltekA070(HoltekA070Controller* holtek_
type = DEVICE_TYPE_MOUSE;
description = "Holtek USB Gaming Mouse Device";
location = holtek->GetDeviceLocation();
serial = holtek->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -30,6 +30,17 @@ std::string HyperXAlloyOriginsController::GetDeviceLocation()
return("HID " + location);
}
std::string HyperXAlloyOriginsController::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 HyperXAlloyOriginsController::SetLEDsDirect(std::vector<RGBColor> colors)
{
/*-----------------------------------------------------*\

View file

@ -21,6 +21,7 @@ public:
~HyperXAlloyOriginsController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetLEDsDirect(std::vector<RGBColor> colors);

View file

@ -43,6 +43,17 @@ std::string HyperXKeyboardController::GetDeviceLocation()
return("HID: " + location);
}
std::string HyperXKeyboardController::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 HyperXKeyboardController::SetMode
(
unsigned char mode,

View file

@ -69,6 +69,7 @@ public:
~HyperXKeyboardController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetMode
(

View file

@ -176,6 +176,7 @@ RGBController_HyperXAlloyOrigins::RGBController_HyperXAlloyOrigins(HyperXAlloyOr
type = DEVICE_TYPE_KEYBOARD;
description = "HyperX Alloy Origins Keyboard Device";
location = hyperx->GetDeviceLocation();
serial = hyperx->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -184,6 +184,7 @@ RGBController_HyperXKeyboard::RGBController_HyperXKeyboard(HyperXKeyboardControl
type = DEVICE_TYPE_KEYBOARD;
description = "HyperX RGB Keyboard Device";
location = hyperx->GetDeviceLocation();
serial = hyperx->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -27,6 +27,17 @@ std::string HyperXPulsefireSurgeController::GetDeviceLocation()
return("HID " + location);
}
std::string HyperXPulsefireSurgeController::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);
}
/*-------------------------------------------------------------------------------------------------*\
| Private packet sending functions. |
\*-------------------------------------------------------------------------------------------------*/

View file

@ -38,6 +38,7 @@ public:
~HyperXPulsefireSurgeController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SelectProfile
(

View file

@ -20,6 +20,7 @@ RGBController_HyperXPulsefireSurge::RGBController_HyperXPulsefireSurge(HyperXPul
type = DEVICE_TYPE_MOUSE;
description = "HyperX Pulsefire Surge Device";
location = hyperx->GetDeviceLocation();
serial = hyperx->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -27,6 +27,17 @@ std::string HyperXMousematController::GetDeviceLocation()
return("HID " + location);
}
std::string HyperXMousematController::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);
}
/*-------------------------------------------------------------------------------------------------*\
| Private packet sending functions. |
\*-------------------------------------------------------------------------------------------------*/

View file

@ -21,6 +21,7 @@ public:
~HyperXMousematController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendDirect
(

View file

@ -20,6 +20,7 @@ RGBController_HyperXMousemat::RGBController_HyperXMousemat(HyperXMousematControl
type = DEVICE_TYPE_MOUSEMAT;
description = "HyperX Mousemat Device";
location = hyperx->GetDeviceLocation();
serial = hyperx->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -22,6 +22,17 @@ std::string LogitechG203Controller::GetDeviceLocation()
return("HID " + location);
}
std::string LogitechG203Controller::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);
}
/*-------------------------------------------------------------------------------------------------*\
| Private packet sending functions. |
\*-------------------------------------------------------------------------------------------------*/

View file

@ -40,6 +40,7 @@ public:
~LogitechG203Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseMode
(

View file

@ -13,6 +13,17 @@ std::string LogitechG203LController::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechG203LController::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 LogitechG203LController::SendApply()
{
unsigned char usb_buf[20];

View file

@ -23,6 +23,7 @@ public:
~LogitechG203LController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetSingleLED(int led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(int mode, int speed, unsigned char brightness, unsigned char dir, unsigned char red, unsigned char green, unsigned char blue);

View file

@ -25,6 +25,17 @@ std::string LogitechG213Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechG213Controller::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 LogitechG213Controller::SetDirect
(
unsigned char zone,

View file

@ -20,6 +20,7 @@ public:
~LogitechG213Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetDirect
(

View file

@ -27,6 +27,17 @@ std::string LogitechG403Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechG403Controller::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 LogitechG403Controller::SendMouseMode
(
unsigned char mode,

View file

@ -40,6 +40,7 @@ public:
~LogitechG403Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseMode
(

View file

@ -27,6 +27,17 @@ std::string LogitechG502PSController::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechG502PSController::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 LogitechG502PSController::SendMouseMode
(
unsigned char mode,

View file

@ -41,6 +41,7 @@ public:
~LogitechG502PSController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseMode
(

View file

@ -21,6 +21,17 @@ LogitechG810Controller::~LogitechG810Controller()
}
std::string LogitechG810Controller::GetSerialString()
{
wchar_t serial_string[128];
hid_get_serial_number_string(dev_pkt_0x11, serial_string, 128);
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void LogitechG810Controller::Commit()
{
SendCommit();

View file

@ -54,6 +54,8 @@ public:
LogitechG810Controller(hid_device* dev_handle_0x11, hid_device* dev_handle_0x12);
~LogitechG810Controller();
std::string GetSerialString();
void Commit();
void SetDirect

View file

@ -27,6 +27,17 @@ std::string LogitechGPowerPlayController::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechGPowerPlayController::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 LogitechGPowerPlayController::SendMouseMatMode
(
unsigned char mode,

View file

@ -40,6 +40,7 @@ public:
~LogitechGPowerPlayController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseMatMode
(

View file

@ -27,6 +27,17 @@ std::string LogitechGProWirelessController::GetDeviceLocation()
return("HID: " + location);
}
std::string LogitechGProWirelessController::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 LogitechGProWirelessController::SendMouseMode
(
unsigned char mode,

View file

@ -40,6 +40,7 @@ public:
~LogitechGProWirelessController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseMode
(

View file

@ -18,6 +18,7 @@ RGBController_LogitechG203::RGBController_LogitechG203(LogitechG203Controller* l
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -9,6 +9,7 @@ RGBController_LogitechG203L::RGBController_LogitechG203L(LogitechG203LController
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -37,6 +37,7 @@ RGBController_LogitechG213::RGBController_LogitechG213(LogitechG213Controller* l
type = DEVICE_TYPE_KEYBOARD;
description = "Logitech G213 Keyboard Device";
location = logitechG213->GetDeviceLocation();
serial = logitechG213->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -18,6 +18,7 @@ RGBController_LogitechG403::RGBController_LogitechG403(LogitechG403Controller* l
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -18,6 +18,7 @@ RGBController_LogitechG502PS::RGBController_LogitechG502PS(LogitechG502PSControl
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -173,6 +173,7 @@ RGBController_LogitechG810::RGBController_LogitechG810(LogitechG810Controller* l
vendor = "Logitech";
type = DEVICE_TYPE_KEYBOARD;
description = "Logitech Keyboard Device";
serial = logitech->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -17,6 +17,8 @@ RGBController_LogitechGPowerPlay::RGBController_LogitechGPowerPlay(LogitechGPowe
vendor = "Logitech";
type = DEVICE_TYPE_MOUSEMAT;
description = "Logitech G PowerPlay Wireless Charging System";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Off;
Off.name = "Off";

View file

@ -18,6 +18,7 @@ RGBController_LogitechGProWireless::RGBController_LogitechGProWireless(LogitechG
type = DEVICE_TYPE_MOUSE;
description = "Logitech G Pro Wireless Gaming Mouse";
location = logitech->GetDeviceLocation();
serial = logitech->GetSerialString();
mode Off;
Off.name = "Off";

View file

@ -32,6 +32,17 @@ std::string MSI3ZoneController::GetDeviceLocation()
return("HID: " + location);
}
std::string MSI3ZoneController::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 MSI3ZoneController::SetLEDs(std::vector<RGBColor> colors)
{
//Shout out to bparker06 for reverse engineering the MSI keyboard USB protocol!

View file

@ -20,8 +20,9 @@ public:
MSI3ZoneController(hid_device* dev_handle, const char* path);
~MSI3ZoneController();
char* GetDeviceName();
char* GetDeviceName();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetLEDs(std::vector<RGBColor> colors);

View file

@ -18,6 +18,7 @@ RGBController_MSI3Zone::RGBController_MSI3Zone(MSI3ZoneController* msi_ptr)
type = DEVICE_TYPE_KEYBOARD;
description = "MSI 3-Zone Keyboard Device";
location = msi->GetDeviceLocation();
serial = msi->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -68,6 +68,17 @@ std::string NZXTHue2Controller::GetFirmwareVersion()
return(firmware_version);
}
std::string NZXTHue2Controller::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 NZXTHue2Controller::SendFan
(
unsigned char port,

View file

@ -59,6 +59,7 @@ public:
std::string GetFirmwareVersion();
std::string GetLocation();
std::string GetSerialString();
unsigned char GetFanCommand
(

View file

@ -19,6 +19,7 @@ RGBController_NZXTHue2::RGBController_NZXTHue2(NZXTHue2Controller* hue2_ptr)
description = "NZXT Hue 2 Device";
version = hue2->GetFirmwareVersion();
location = hue2->GetLocation();
serial = hue2->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -53,6 +53,17 @@ std::string NZXTKrakenController::GetLocation()
return("HID: " + location);
}
std::string NZXTKrakenController::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 NZXTKrakenController::UpdateStatus()
{
unsigned char usb_buf[64];

View file

@ -51,6 +51,7 @@ public:
std::string GetFirmwareVersion();
std::string GetLocation();
std::string GetSerialString();
void UpdateEffect
(

View file

@ -20,6 +20,7 @@ RGBController_NZXTKraken::RGBController_NZXTKraken(NZXTKrakenController* nzxtkra
description = "NZXT Kraken X42/X52/X62/X72/M22";
version = nzxtkraken->GetFirmwareVersion();
location = nzxtkraken->GetLocation();
serial = nzxtkraken->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -28,6 +28,8 @@ RGBController_RedragonK556::RGBController_RedragonK556(RedragonK556Controller* r
vendor = "Redragon";
type = DEVICE_TYPE_KEYBOARD;
description = "Redragon Keyboard Device";
location = redragon->GetDeviceLocation();
serial = redragon->GetSerialString();
mode Custom;
Custom.name = "Custom";

View file

@ -18,6 +18,7 @@ RGBController_RedragonM711::RGBController_RedragonM711(RedragonM711Controller* r
type = DEVICE_TYPE_MOUSE;
description = "Redragon Mouse Device";
location = redragon->GetDeviceLocation();
serial = redragon->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -13,6 +13,17 @@ std::string RedragonK556Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string RedragonK556Controller::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 RedragonK556Controller::SetKeyboardColors
(
unsigned char * color_data,

View file

@ -96,6 +96,7 @@ public:
~RedragonK556Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetKeyboardColors
(

View file

@ -18,6 +18,17 @@ std::string RedragonM711Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string RedragonM711Controller::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 RedragonM711Controller::SendMouseColor
(
unsigned char red,

View file

@ -31,6 +31,7 @@ public:
~RedragonM711Controller();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendMouseApply();

View file

@ -17,6 +17,7 @@ RGBController_Sinowealth::RGBController_Sinowealth(SinowealthController* sinowea
type = DEVICE_TYPE_MOUSE;
description = "Sinowealth Device";
location = sinowealth->GetLocation();
serial = sinowealth->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -39,6 +39,17 @@ unsigned int SinowealthController::GetLEDCount()
return(led_count);
}
std::string SinowealthController::GetSerialString()
{
wchar_t serial_string[128];
hid_get_serial_number_string(dev_report_id_4, serial_string, 128);
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void SinowealthController::SetLEDColor
(
RGBColor* color_buf

View file

@ -55,6 +55,7 @@ public:
unsigned int GetLEDCount();
std::string GetLocation();
std::string GetSerialString();
void SetLEDColor(RGBColor* color_buf);
void SetMode(unsigned char mode, unsigned char speed, unsigned char direction, RGBColor* color_buf);

View file

@ -19,6 +19,7 @@ RGBController_SonyDS4::RGBController_SonyDS4(SonyDS4Controller* dualshock)
type = DEVICE_TYPE_GAMEPAD;
description = "Sony DualShock 4 Device";
location = dualshock->GetLocation();
serial = dualshock->GetSerialString();
mode Direct;
Direct.value = 0;

View file

@ -36,6 +36,17 @@ std::string SonyDS4Controller::GetLocation()
return("HID: " + location);
}
std::string SonyDS4Controller::GetSerialString()
{
wchar_t serial_string[128];
hid_get_serial_number_string(device_handle, serial_string, 128);
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void SonyDS4Controller::SetColors(unsigned char red, unsigned char green, unsigned char blue)
{
if(is_bluetooth)

View file

@ -16,6 +16,7 @@ public:
SonyDS4Controller(hid_device * device_handle, const char * device_path);
std::string GetLocation();
std::string GetSerialString();
void SetColors(unsigned char red, unsigned char green, unsigned char blue);

View file

@ -262,6 +262,7 @@ RGBController_SteelSeriesApex::RGBController_SteelSeriesApex(SteelSeriesApexBase
type = DEVICE_TYPE_KEYBOARD;
description = "SteelSeries Apex RGB Device";
location = steelseries->GetDeviceLocation();
serial = steelseries->GetSerialString();
proto_type = steelseries->proto_type;

View file

@ -27,6 +27,7 @@ RGBController_SteelSeriesOldApex::RGBController_SteelSeriesOldApex(SteelSeriesOl
type = DEVICE_TYPE_KEYBOARD;
description = "SteelSeries old Apex device";
location = OldApex->GetDeviceLocation();
serial = OldApex->GetSerialString();
mode Brightness8;
Brightness8.name = "Brightness 8";

View file

@ -18,6 +18,7 @@ RGBController_SteelSeriesRival::RGBController_SteelSeriesRival(SteelSeriesRivalC
type = DEVICE_TYPE_MOUSE;
description = "SteelSeries Rival Device";
location = rival->GetDeviceLocation();
serial = rival->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -18,6 +18,7 @@ RGBController_SteelSeriesSiberia::RGBController_SteelSeriesSiberia(SteelSeriesSi
type = DEVICE_TYPE_HEADSET;
description = "SteelSeries Siberia Device";
location = siberia->GetDeviceLocation();
serial = siberia->GetSerialString();
mode Static;
Static.name = "Static";

View file

@ -23,6 +23,17 @@ public:
return("HID: " + location);
};
std::string 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);
}
steelseries_type proto_type;
virtual void SetMode

View file

@ -63,6 +63,17 @@ char* SteelSeriesOldApexController::GetDeviceName()
return device_name;
}
std::string SteelSeriesOldApexController::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);
}
steelseries_type SteelSeriesOldApexController::GetKeyboardType()
{
return proto;

View file

@ -63,6 +63,7 @@ public:
std::string GetDeviceLocation();
char* GetDeviceName();
std::string GetSerialString();
steelseries_type GetKeyboardType();

View file

@ -54,6 +54,17 @@ char* SteelSeriesRivalController::GetDeviceName()
return device_name;
}
std::string SteelSeriesRivalController::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);
}
steelseries_type SteelSeriesRivalController::GetMouseType()
{
return proto;

View file

@ -44,6 +44,7 @@ public:
std::string GetDeviceLocation();
char* GetDeviceName();
std::string GetSerialString();
steelseries_type GetMouseType();

View file

@ -57,6 +57,17 @@ char* SteelSeriesSiberiaController::GetDeviceName()
return device_name;
}
std::string SteelSeriesSiberiaController::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 SteelSeriesSiberiaController::SetColor
(
unsigned char red,

View file

@ -24,7 +24,8 @@ public:
~SteelSeriesSiberiaController();
std::string GetDeviceLocation();
char* GetDeviceName();
char* GetDeviceName();
std::string GetSerialString();
void SetColor
(

View file

@ -152,6 +152,7 @@ RGBController_PoseidonZRGB::RGBController_PoseidonZRGB(PoseidonZRGBController* p
type = DEVICE_TYPE_KEYBOARD;
description = "Thermaltake Poseidon Z RGB Device";
location = poseidon->GetDeviceLocation();
serial = poseidon->GetSerialString();
mode Direct;
Direct.name = "Direct";

View file

@ -38,6 +38,17 @@ std::string PoseidonZRGBController::GetDeviceLocation()
return("HID: " + location);
}
std::string PoseidonZRGBController::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 PoseidonZRGBController::SetMode(unsigned char mode, unsigned char direction, unsigned char speed)
{
active_mode = mode;

View file

@ -78,6 +78,7 @@ public:
~PoseidonZRGBController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetMode(unsigned char mode, unsigned char direction, unsigned char speed);
void SetLEDsDirect(std::vector<RGBColor> colors);

View file

@ -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";

View file

@ -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];

Some files were not shown because too many files have changed in this diff Show more