mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Store name in RoccatControllers to avoid setting it in detectors
This commit is contained in:
@@ -14,10 +14,11 @@
|
||||
#include "RoccatSenseAimoController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
RoccatSenseAimoController::RoccatSenseAimoController(hid_device* dev_handle, char *path)
|
||||
RoccatSenseAimoController::RoccatSenseAimoController(hid_device* dev_handle, char *path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
RoccatSenseAimoController::~RoccatSenseAimoController()
|
||||
@@ -25,6 +26,29 @@ RoccatSenseAimoController::~RoccatSenseAimoController()
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetSerial()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetVersion()
|
||||
{
|
||||
uint8_t buf[8] = { 0x01 };
|
||||
@@ -42,24 +66,6 @@ std::string RoccatSenseAimoController::GetVersion()
|
||||
return std::string(version);
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetSerial()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
std::string RoccatSenseAimoController::GetLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
mode_struct RoccatSenseAimoController::GetMode()
|
||||
{
|
||||
uint8_t buf[19] = { 0x02 };
|
||||
|
||||
Reference in New Issue
Block a user