mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-07-08 12:25:07 -04:00
Add optional HID device hotplug support (requires https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug)
This commit is contained in:
@@ -13,10 +13,11 @@
|
||||
#include "LogitechG910Controller.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
LogitechG910Controller::LogitechG910Controller(hid_device* dev_handle_0x11, hid_device* dev_handle_0x12, std::string dev_name)
|
||||
LogitechG910Controller::LogitechG910Controller(hid_device* dev_handle_0x11, hid_device* dev_handle_0x12, char* path, std::string dev_name)
|
||||
{
|
||||
dev_pkt_0x11 = dev_handle_0x11;
|
||||
dev_pkt_0x12 = dev_handle_0x12;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
@@ -31,6 +32,11 @@ std::string LogitechG910Controller::GetNameString()
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string LogitechG910Controller::GetLocationString()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string LogitechG910Controller::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -52,9 +52,10 @@ enum
|
||||
class LogitechG910Controller
|
||||
{
|
||||
public:
|
||||
LogitechG910Controller(hid_device* dev_handle_0x11, hid_device* dev_handle_0x12, std::string dev_name);
|
||||
LogitechG910Controller(hid_device* dev_handle_0x11, hid_device* dev_handle_0x12, char* path, std::string dev_name);
|
||||
~LogitechG910Controller();
|
||||
|
||||
std::string GetLocationString();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
@@ -79,6 +80,7 @@ public:
|
||||
private:
|
||||
hid_device* dev_pkt_0x11;
|
||||
hid_device* dev_pkt_0x12;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void SendDirectFrame
|
||||
|
||||
@@ -188,6 +188,7 @@ RGBController_LogitechG910::RGBController_LogitechG910(LogitechG910Controller* c
|
||||
vendor = "Logitech";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Logitech Keyboard Device";
|
||||
location = controller->GetLocationString();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
|
||||
Reference in New Issue
Block a user