From 0e7f2b9fc158d69d04afa2fe187a07e4b0c25516 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 5 Oct 2020 00:28:37 -0500 Subject: [PATCH] Use HID path for Location on SteelSeries Rival controller --- .../RGBController_SteelSeriesRival.cpp | 3 ++- .../SteelSeriesControllerDetect.cpp | 2 +- .../SteelSeriesRivalController.cpp | 13 ++++++++++--- .../SteelSeriesRivalController.h | 7 +++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Controllers/SteelSeriesController/RGBController_SteelSeriesRival.cpp b/Controllers/SteelSeriesController/RGBController_SteelSeriesRival.cpp index 2196a49d..83cc01c4 100644 --- a/Controllers/SteelSeriesController/RGBController_SteelSeriesRival.cpp +++ b/Controllers/SteelSeriesController/RGBController_SteelSeriesRival.cpp @@ -13,9 +13,10 @@ RGBController_SteelSeriesRival::RGBController_SteelSeriesRival(SteelSeriesRivalC { rival = rival_ptr; - name = rival_ptr->GetDeviceName(); + name = rival->GetDeviceName(); type = DEVICE_TYPE_MOUSE; description = "SteelSeries Rival Device"; + location = rival->GetDeviceLocation(); mode Static; Static.name = "Static"; diff --git a/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp b/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp index 2c961fd5..d15f5dee 100644 --- a/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp +++ b/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp @@ -148,7 +148,7 @@ void DetectSteelSeriesControllers(std::vector& rgb_controllers) case DEVICE_TYPE_MOUSE: { - SteelSeriesRivalController* controller = new SteelSeriesRivalController(dev, device_list[device_idx].proto_type); + SteelSeriesRivalController* controller = new SteelSeriesRivalController(dev, device_list[device_idx].proto_type, info->path); RGBController_SteelSeriesRival* rgb_controller = new RGBController_SteelSeriesRival(controller); rgb_controller->name = device_list[device_idx].name; diff --git a/Controllers/SteelSeriesController/SteelSeriesRivalController.cpp b/Controllers/SteelSeriesController/SteelSeriesRivalController.cpp index 8d89c19c..80bb5f39 100644 --- a/Controllers/SteelSeriesController/SteelSeriesRivalController.cpp +++ b/Controllers/SteelSeriesController/SteelSeriesRivalController.cpp @@ -30,11 +30,13 @@ static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size) SteelSeriesRivalController::SteelSeriesRivalController ( hid_device* dev_handle, - steelseries_type proto_type + steelseries_type proto_type, + const char* path ) { - dev = dev_handle; - proto = proto_type; + dev = dev_handle; + location = path; + proto = proto_type; } SteelSeriesRivalController::~SteelSeriesRivalController() @@ -42,6 +44,11 @@ SteelSeriesRivalController::~SteelSeriesRivalController() } +std::string SteelSeriesRivalController::GetDeviceLocation() +{ + return(location); +} + char* SteelSeriesRivalController::GetDeviceName() { return device_name; diff --git a/Controllers/SteelSeriesController/SteelSeriesRivalController.h b/Controllers/SteelSeriesController/SteelSeriesRivalController.h index 43cfccde..ac18207e 100644 --- a/Controllers/SteelSeriesController/SteelSeriesRivalController.h +++ b/Controllers/SteelSeriesController/SteelSeriesRivalController.h @@ -36,12 +36,14 @@ public: SteelSeriesRivalController ( hid_device* dev_handle, - steelseries_type proto_type + steelseries_type proto_type, + const char* path ); ~SteelSeriesRivalController(); - char* GetDeviceName(); + std::string GetDeviceLocation(); + char* GetDeviceName(); steelseries_type GetMouseType(); @@ -75,5 +77,6 @@ public: private: char device_name[32]; hid_device* dev; + std::string location; steelseries_type proto; };