Use HID path for Location on Corsair Lighting Node controllers

This commit is contained in:
Adam Honse 2020-10-02 20:29:17 -05:00
parent b829bfe538
commit 406ebcc789
4 changed files with 13 additions and 4 deletions

View file

@ -37,9 +37,10 @@ THREAD keepalive_thread(void *param)
THREADRETURN
}
CorsairLightingNodeController::CorsairLightingNodeController(hid_device* dev_handle)
CorsairLightingNodeController::CorsairLightingNodeController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
SendFirmwareRequest();
@ -78,6 +79,11 @@ std::string CorsairLightingNodeController::GetFirmwareString()
return(firmware_version);
}
std::string CorsairLightingNodeController::GetLocationString()
{
return(location);
}
void CorsairLightingNodeController::SetChannelEffect(unsigned char channel,
unsigned char num_leds,
unsigned char mode,

View file

@ -79,10 +79,11 @@ enum
class CorsairLightingNodeController
{
public:
CorsairLightingNodeController(hid_device* dev_handle);
CorsairLightingNodeController(hid_device* dev_handle, const char* path);
~CorsairLightingNodeController();
std::string GetFirmwareString();
std::string GetLocationString();
unsigned int GetStripsOnChannel(unsigned int channel);
@ -110,6 +111,7 @@ public:
private:
hid_device* dev;
std::string firmware_version;
std::string location;
std::chrono::time_point<std::chrono::steady_clock> last_commit_time;
void SendFirmwareRequest();

View file

@ -64,7 +64,7 @@ void DetectCorsairLightingNodeControllers(std::vector<RGBController*> &rgb_contr
if( dev )
{
CorsairLightingNodeController* controller = new CorsairLightingNodeController(dev);
CorsairLightingNodeController* controller = new CorsairLightingNodeController(dev, info->path);
RGBController_CorsairLightingNode* rgb_controller = new RGBController_CorsairLightingNode(controller);

View file

@ -18,6 +18,7 @@ RGBController_CorsairLightingNode::RGBController_CorsairLightingNode(CorsairLigh
description = "Corsair Lighting Node Device";
type = DEVICE_TYPE_LEDSTRIP;
version = corsair->GetFirmwareString();
location = corsair->GetLocationString();
mode Direct;
Direct.name = "Direct";