diff --git a/Controllers/BlinkyTapeController/BlinkyTapeControllerDetect.cpp b/Controllers/BlinkyTapeController/BlinkyTapeControllerDetect.cpp index cf7feca2..6a768b65 100644 --- a/Controllers/BlinkyTapeController/BlinkyTapeControllerDetect.cpp +++ b/Controllers/BlinkyTapeController/BlinkyTapeControllerDetect.cpp @@ -13,7 +13,6 @@ #include "DetectionManager.h" #include "BlinkyTapeController.h" #include "RGBController_BlinkyTape.h" -#include "find_usb_serial_port.h" /*---------------------------------------------------------*\ | BlinkyTape VID and PID | @@ -21,23 +20,18 @@ #define BLINKINLABS_VID 0x1D50 #define BLINKYTAPE_PID 0x605E -DetectedControllers DetectBlinkyTapeControllers() +DetectedControllers DetectBlinkyTapeControllers(SerialDeviceInfo* port_info, const std::string& name) { DetectedControllers detected_controllers; - std::vector device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID); - for(unsigned int device_idx = 0; device_idx < device_locations.size(); device_idx++) - { - BlinkyTapeController* controller = new BlinkyTapeController(); - controller->Initialize(device_locations[device_idx]); + BlinkyTapeController* controller = new BlinkyTapeController(); + controller->Initialize(port_info->port_path); - RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller); + RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller); - detected_controllers.push_back(rgb_controller); - } + detected_controllers.push_back(rgb_controller); return(detected_controllers); } -REGISTER_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers); -REGISTER_CUSTOM_UDEV_RULE(blinky_tape, "BlinkyTape", "SUBSYSTEMS==\"serial|hidraw\", ATTRS{idVendor}==\"1d50\", ATTRS{idProduct}==\"605e\", TAG+=\"uaccess\", TAG+=\"BlinkyTape\""); +REGISTER_USB_SERIAL_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers, BLINKINLABS_VID, BLINKYTAPE_PID);