diff --git a/Controllers/LenovoMotherboardController/LenovoMotherboardController.cpp b/Controllers/LenovoMotherboardController/LenovoMotherboardController.cpp index 88bbf4ee..21d8f505 100644 --- a/Controllers/LenovoMotherboardController/LenovoMotherboardController.cpp +++ b/Controllers/LenovoMotherboardController/LenovoMotherboardController.cpp @@ -13,11 +13,11 @@ #include "LenovoMotherboardController.h" #include "StringUtils.h" -LenovoMotherboardController::LenovoMotherboardController(hid_device* dev_handle, const hid_device_info& info) +LenovoMotherboardController::LenovoMotherboardController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name) { dev = dev_handle; location = info.path; - version = ""; + name = dev_name; } LenovoMotherboardController::~LenovoMotherboardController() @@ -30,6 +30,11 @@ std::string LenovoMotherboardController::GetDeviceLocation() return("HID: " + location); } +std::string LenovoMotherboardController::GetNameString() +{ + return(name); +} + std::string LenovoMotherboardController::GetSerialString() { wchar_t serial_string[128]; @@ -43,11 +48,6 @@ std::string LenovoMotherboardController::GetSerialString() return(StringUtils::wstring_to_string(serial_string)); } -std::string LenovoMotherboardController::GetFirmwareVersion() -{ - return(version); -} - void LenovoMotherboardController::SetMode(uint8_t zone, uint8_t mode, uint8_t brightness, uint8_t speed, RGBColor color) { uint8_t r = RGBGetRValue(color); diff --git a/Controllers/LenovoMotherboardController/LenovoMotherboardController.h b/Controllers/LenovoMotherboardController/LenovoMotherboardController.h index 0b44d927..2d698f7b 100644 --- a/Controllers/LenovoMotherboardController/LenovoMotherboardController.h +++ b/Controllers/LenovoMotherboardController/LenovoMotherboardController.h @@ -43,17 +43,17 @@ enum class LenovoMotherboardController { public: - LenovoMotherboardController(hid_device* dev_handle, const hid_device_info& info); + LenovoMotherboardController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name); ~LenovoMotherboardController(); - std::string GetSerialString(); std::string GetDeviceLocation(); - std::string GetFirmwareVersion(); + std::string GetNameString(); + std::string GetSerialString(); void SetMode(uint8_t zone, uint8_t mode, uint8_t brightness, uint8_t speed, RGBColor color); private: hid_device* dev; std::string location; - std::string version; + std::string name; }; diff --git a/Controllers/LenovoMotherboardController/LenovoMotherboardControllerDetect.cpp b/Controllers/LenovoMotherboardController/LenovoMotherboardControllerDetect.cpp index c1d6865f..9fe29316 100644 --- a/Controllers/LenovoMotherboardController/LenovoMotherboardControllerDetect.cpp +++ b/Controllers/LenovoMotherboardController/LenovoMotherboardControllerDetect.cpp @@ -32,9 +32,8 @@ void DetectLenovoMotherboardControllers(hid_device_info* info, const std::string { DMIInfo dmi; - LenovoMotherboardController* controller = new LenovoMotherboardController(dev, *info); + LenovoMotherboardController* controller = new LenovoMotherboardController(dev, *info, name + " " + dmi.getMainboard()); RGBController_LenovoMotherboard* rgb_controller = new RGBController_LenovoMotherboard(controller); - rgb_controller->name = name + " " + dmi.getMainboard(); ResourceManager::get()->RegisterRGBController(rgb_controller); } diff --git a/Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.cpp b/Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.cpp index e5356ce3..c3ef3732 100644 --- a/Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.cpp +++ b/Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.cpp @@ -27,13 +27,13 @@ RGBController_LenovoMotherboard::RGBController_LenovoMotherboard(LenovoMotherboardController* controller_ptr) { controller = controller_ptr; - name = "Lenovo motherboard"; + + name = controller->GetNameString(); vendor = "Lenovo"; type = DEVICE_TYPE_MOTHERBOARD; description = name; location = controller->GetDeviceLocation(); serial = controller->GetSerialString(); - version = controller->GetFirmwareVersion(); mode Static; Static.name = "Static";