Store name in InstantMouseController to avoid setting it in detector
This commit is contained in:
parent
d5f8e2cac9
commit
0bdf600409
4 changed files with 15 additions and 15 deletions
|
|
@ -13,12 +13,12 @@
|
||||||
#include "InstantMouseController.h"
|
#include "InstantMouseController.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
|
|
||||||
InstantMouseController::InstantMouseController(hid_device* dev_handle, const hid_device_info& info)
|
InstantMouseController::InstantMouseController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name)
|
||||||
{
|
{
|
||||||
dev = dev_handle;
|
dev = dev_handle;
|
||||||
location = info.path;
|
location = info.path;
|
||||||
pid = info.product_id;
|
pid = info.product_id;
|
||||||
version = "";
|
name = dev_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstantMouseController::~InstantMouseController()
|
InstantMouseController::~InstantMouseController()
|
||||||
|
|
@ -31,6 +31,11 @@ std::string InstantMouseController::GetDeviceLocation()
|
||||||
return("HID: " + location);
|
return("HID: " + location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string InstantMouseController::GetNameString()
|
||||||
|
{
|
||||||
|
return(name);
|
||||||
|
}
|
||||||
|
|
||||||
std::string InstantMouseController::GetSerialString()
|
std::string InstantMouseController::GetSerialString()
|
||||||
{
|
{
|
||||||
wchar_t serial_string[128];
|
wchar_t serial_string[128];
|
||||||
|
|
@ -49,11 +54,6 @@ uint16_t InstantMouseController::GetPID()
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string InstantMouseController::GetFirmwareVersion()
|
|
||||||
{
|
|
||||||
return(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InstantMouseController::SendColor(RGBColor color)
|
void InstantMouseController::SendColor(RGBColor color)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,13 @@ enum
|
||||||
class InstantMouseController
|
class InstantMouseController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InstantMouseController(hid_device* dev_handle, const hid_device_info& info);
|
InstantMouseController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name);
|
||||||
~InstantMouseController();
|
~InstantMouseController();
|
||||||
|
|
||||||
|
std::string GetNameString();
|
||||||
std::string GetSerialString();
|
std::string GetSerialString();
|
||||||
std::string GetDeviceLocation();
|
std::string GetDeviceLocation();
|
||||||
uint16_t GetPID();
|
uint16_t GetPID();
|
||||||
std::string GetFirmwareVersion();
|
|
||||||
|
|
||||||
void SetMode(uint8_t mode_value, uint8_t speed, uint8_t brightness, uint8_t direction);
|
void SetMode(uint8_t mode_value, uint8_t speed, uint8_t brightness, uint8_t direction);
|
||||||
void SendColor(RGBColor color);
|
void SendColor(RGBColor color);
|
||||||
|
|
@ -63,6 +63,6 @@ public:
|
||||||
private:
|
private:
|
||||||
hid_device* dev;
|
hid_device* dev;
|
||||||
std::string location;
|
std::string location;
|
||||||
std::string version;
|
std::string name;
|
||||||
uint16_t pid;
|
uint16_t pid;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ void DetectInstantMouseControllers(hid_device_info* info, const std::string& nam
|
||||||
|
|
||||||
if(dev)
|
if(dev)
|
||||||
{
|
{
|
||||||
InstantMouseController* controller = new InstantMouseController(dev, *info);
|
InstantMouseController* controller = new InstantMouseController(dev, *info, name);
|
||||||
RGBController_InstantMouse* rgb_controller = new RGBController_InstantMouse(controller);
|
RGBController_InstantMouse* rgb_controller = new RGBController_InstantMouse(controller);
|
||||||
rgb_controller->name = name;
|
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@
|
||||||
RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* controller_ptr)
|
RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* controller_ptr)
|
||||||
{
|
{
|
||||||
controller = controller_ptr;
|
controller = controller_ptr;
|
||||||
vendor = "Instant Microelectronics";
|
|
||||||
|
vendor = controller->GetNameString();
|
||||||
type = DEVICE_TYPE_MOUSE;
|
type = DEVICE_TYPE_MOUSE;
|
||||||
description = "Instant USB Gaming Mouse";
|
description = "Instant USB Gaming Mouse";
|
||||||
location = controller->GetDeviceLocation();
|
location = controller->GetDeviceLocation();
|
||||||
serial = controller->GetSerialString();
|
serial = controller->GetSerialString();
|
||||||
version = controller->GetFirmwareVersion();
|
|
||||||
|
|
||||||
mode direct;
|
mode direct;
|
||||||
direct.name = "Direct";
|
direct.name = "Direct";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue