Detection of MSI 156x devices made working for all types (fixes #2802)

This commit is contained in:
Thomas Boos 2022-10-22 19:13:28 +00:00 committed by Adam Honse
parent 2ba69fc2e9
commit c7326f73a3

View file

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