OpenRGB/Controllers/BlinkyTapeController/BlinkyTapeControllerDetect.cpp
Matt Mets 0db567b8bc Add support for BlinkyTape LED controllers
This adds support for the Blinkinlabs BlinkyTape controller, a
USB-powered digital LED strip controller. Devices are detected
automatically by scanning for their VID/PID, and connected to using
serial.

This code was tested in Windows.

Commit squashed and amended for code style and to fix Linux build by Adam Honse <calcprogrammer1@gmail.com>
2021-07-16 20:07:26 -05:00

38 lines
1.6 KiB
C++

#include "Detector.h"
#include "BlinkyTapeController.h"
#include "RGBController.h"
#include "RGBController_BlinkyTape.h"
#include "SettingsManager.h"
#include "find_usb_serial_port.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#define BLINKINLABS_VID 0x1D50
#define BLINKYTAPE_PID 0x605E
/******************************************************************************************\
* *
* DetectBlinkyTapeControllers *
* *
* Detect BlinkyTape devices *
* *
\******************************************************************************************/
void DetectBlinkyTapeControllers(std::vector<RGBController*> &rgb_controllers)
{
std::vector<std::string *> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
for(unsigned int device_idx = 0; device_idx < device_locations.size(); device_idx++)
{
int led_count = 64;
BlinkyTapeController* controller = new BlinkyTapeController();
controller->Initialize(*device_locations[device_idx], led_count);
RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller);
rgb_controllers.push_back(rgb_controller);
}
}
REGISTER_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers);