mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-19 12:06:37 -04:00
Store name in BloodyB820RController to avoid setting it in detector
This commit is contained in:
@@ -20,10 +20,11 @@
|
||||
| the second packet. |
|
||||
\*-------------------------------------------------------------------------------------*/
|
||||
|
||||
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path)
|
||||
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendControlPacket(BLOODY_B820R_GAIN_CONTROL);
|
||||
}
|
||||
@@ -52,6 +53,11 @@ std::string BloodyB820RController::GetLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string BloodyB820RController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void BloodyB820RController::SendControlPacket(uint8_t data)
|
||||
{
|
||||
uint8_t buffer[BLOODY_B820R_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
@@ -39,15 +39,17 @@ enum
|
||||
class BloodyB820RController
|
||||
{
|
||||
public:
|
||||
BloodyB820RController(hid_device* dev_handle, const char* path);
|
||||
BloodyB820RController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~BloodyB820RController();
|
||||
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
|
||||
void SetLEDDirect(std::vector<RGBColor> colors);
|
||||
void SendControlPacket(uint8_t data);
|
||||
private:
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ RGBController_BloodyB820R::RGBController_BloodyB820R(BloodyB820RController *cont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Bloody B820R";
|
||||
name = controller->GetName();
|
||||
vendor = "A4Tech";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "A4Tech Bloody Keyboard";
|
||||
|
||||
Reference in New Issue
Block a user