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
|
|
@ -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. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public:
|
|||
~HyperXMousematController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendDirect
|
||||
(
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue