Store name in RoccatControllers to avoid setting it in detectors

This commit is contained in:
Adam Honse
2025-08-16 02:07:11 -05:00
parent c2e0bd496f
commit 079e344c5a
34 changed files with 333 additions and 304 deletions

View File

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