diff --git a/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp b/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp index 39329f75..a3b8775e 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp @@ -56,12 +56,6 @@ void DetectMSIMysticLightControllers rgb_controller->name = "MSI " + dmi.getMainboard(); ResourceManager::get()->RegisterRGBController(rgb_controller); } - else if(packet_length == sizeof(FeaturePacket_64) ) - { - MSIMysticLight64Controller* controller = new MSIMysticLight64Controller(dev, info->path); - RGBController_MSIMysticLight64* rgb_controller = new RGBController_MSIMysticLight64(controller); - ResourceManager::get()->RegisterRGBController(rgb_controller); - } else // no supported length returned { std::string name = "MSI " + dmi.getMainboard(); @@ -71,7 +65,26 @@ void DetectMSIMysticLightControllers } } -REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_1563", DetectMSIMysticLightControllers, MSI_USB_VID, 0x1563, 0x00FF, 0x01); + +void DetectMSIMysticLight64Controllers + ( + hid_device_info* info, + const std::string& /*name*/ + ) +{ + hid_device* dev = hid_open_path(info->path); + if(dev != nullptr) + { + MSIMysticLight64Controller* controller = new MSIMysticLight64Controller(dev, info->path); + RGBController_MSIMysticLight64* rgb_controller = new RGBController_MSIMysticLight64(controller); + ResourceManager::get()->RegisterRGBController(rgb_controller); + } +} + + +REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_1562", DetectMSIMysticLight64Controllers, MSI_USB_VID, 0x1562, 0x00FF, 0x01); +REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_1563", DetectMSIMysticLight64Controllers, MSI_USB_VID, 0x1563, 0x00FF, 0x01); +REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_1564", DetectMSIMysticLight64Controllers, MSI_USB_VID, 0x1564, 0x00FF, 0x01); REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_1720", DetectMSIMysticLightControllers, MSI_USB_VID, 0x1720, 0x0001, 0x00); REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7B12", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7B12, 0x0001, 0x00); REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7B16", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7B16, 0x0001, 0x00);