#include "Detector.h"
#include "N5312AController.h"
#include "RGBController.h"
#include "RGBController_N5312A.h"

/*---------------------------------------------------------*\
| N5312A vendor ID                                          |
\*---------------------------------------------------------*/
#define N5312A_VID                                     0x4E53

/*---------------------------------------------------------*\
| Product ID                                                |
\*---------------------------------------------------------*/
#define N5312A_PID                                     0x5406

void DetectN5312AControllers(hid_device_info* info, const std::string& name)
{
    hid_device* dev = hid_open_path(info->path);

    if(dev)
    {
        N5312AController*     controller         = new N5312AController(dev, *info);
        RGBController_N5312A* rgb_controller     = new RGBController_N5312A(controller);
        rgb_controller->name                     = name;

        ResourceManager::get()->RegisterRGBController(rgb_controller);
    }
}

REGISTER_HID_DETECTOR_IPU("N5312A USB Optical Mouse", DetectN5312AControllers, N5312A_VID, N5312A_PID, 1, 0xFF01, 0x01);
