Use HID path for Location on Logitech mouse controllers

merge-requests/182/head
Adam Honse 2 years ago
parent 7b93275443
commit ffb452f6f4
  1. 14
      Controllers/LogitechController/LogitechControllerDetect.cpp
  2. 10
      Controllers/LogitechController/LogitechG203Controller.cpp
  3. 5
      Controllers/LogitechController/LogitechG203Controller.h
  4. 10
      Controllers/LogitechController/LogitechG203LController.cpp
  5. 14
      Controllers/LogitechController/LogitechG203LController.h
  6. 10
      Controllers/LogitechController/LogitechG403Controller.cpp
  7. 5
      Controllers/LogitechController/LogitechG403Controller.h
  8. 10
      Controllers/LogitechController/LogitechG502PSController.cpp
  9. 5
      Controllers/LogitechController/LogitechG502PSController.h
  10. 10
      Controllers/LogitechController/LogitechGPowerPlayController.cpp
  11. 5
      Controllers/LogitechController/LogitechGPowerPlayController.h
  12. 10
      Controllers/LogitechController/LogitechGProWirelessController.cpp
  13. 5
      Controllers/LogitechController/LogitechGProWirelessController.h
  14. 1
      Controllers/LogitechController/RGBController_LogitechG203.cpp
  15. 1
      Controllers/LogitechController/RGBController_LogitechG203L.cpp
  16. 1
      Controllers/LogitechController/RGBController_LogitechG403.cpp
  17. 1
      Controllers/LogitechController/RGBController_LogitechG502PS.cpp
  18. 1
      Controllers/LogitechController/RGBController_LogitechGProWireless.cpp

@ -234,7 +234,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
{
case LOGITECH_G203_PID:
{
LogitechG203Controller* controller = new LogitechG203Controller(dev);
LogitechG203Controller* controller = new LogitechG203Controller(dev, info->path);
RGBController_LogitechG203* rgb_controller = new RGBController_LogitechG203(controller);
@ -245,7 +245,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
case LOGITECH_G203L_PID:
{
LogitechG203LController* controller = new LogitechG203LController(dev);
LogitechG203LController* controller = new LogitechG203LController(dev, info->path);
RGBController_LogitechG203L* rgb_controller = new RGBController_LogitechG203L(controller);
@ -257,7 +257,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
case LOGITECH_G403_PID:
case LOGITECH_G403H_PID:
{
LogitechG403Controller* controller = new LogitechG403Controller(dev);
LogitechG403Controller* controller = new LogitechG403Controller(dev, info->path);
RGBController_LogitechG403* rgb_controller = new RGBController_LogitechG403(controller);
@ -269,7 +269,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
case LOGITECH_G502_PS_PID:
case LOGITECH_G502H_PID:
{
LogitechG502PSController* controller = new LogitechG502PSController(dev);
LogitechG502PSController* controller = new LogitechG502PSController(dev, info->path);
RGBController_LogitechG502PS* rgb_controller = new RGBController_LogitechG502PS(controller);
@ -281,7 +281,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
case LOGITECH_GPRO_WIRELESS_PID:
case LOGITECH_G_LIGHTSPEED_WIRELESS_PID:
{
LogitechGProWirelessController* controller = new LogitechGProWirelessController(dev);
LogitechGProWirelessController* controller = new LogitechGProWirelessController(dev, info->path);
RGBController_LogitechGProWireless* rgb_controller = new RGBController_LogitechGProWireless(controller);
@ -292,7 +292,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
case LOGITECH_G_LIGHTSPEED_POWERPLAY_PID:
{
//Add mouse
LogitechGProWirelessController* mouse_controller = new LogitechGProWirelessController(dev);
LogitechGProWirelessController* mouse_controller = new LogitechGProWirelessController(dev, info->path);
RGBController_LogitechGProWireless* mouse_rgb_controller = new RGBController_LogitechGProWireless(mouse_controller);
@ -300,7 +300,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
rgb_controllers.push_back(mouse_rgb_controller);
//Add Powerplay mousemat
LogitechGPowerPlayController* mousemat_controller = new LogitechGPowerPlayController(dev);
LogitechGPowerPlayController* mousemat_controller = new LogitechGPowerPlayController(dev, info->path);
RGBController_LogitechGPowerPlay* mousemat_rgb_controller = new RGBController_LogitechGPowerPlay(mousemat_controller);

@ -11,9 +11,15 @@
#include <cstring>
LogitechG203Controller::LogitechG203Controller(hid_device* dev_handle)
LogitechG203Controller::LogitechG203Controller(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
std::string LogitechG203Controller::GetDeviceLocation()
{
return(location);
}
/*-------------------------------------------------------------------------------------------------*\

@ -36,9 +36,11 @@ enum
class LogitechG203Controller
{
public:
LogitechG203Controller(hid_device* dev_handle);
LogitechG203Controller(hid_device* dev_handle, const char* path);
~LogitechG203Controller();
std::string GetDeviceLocation();
void SendMouseMode
(
unsigned char mode,
@ -50,4 +52,5 @@ public:
private:
hid_device* dev;
std::string location;
};

@ -2,9 +2,15 @@
#include <cstring>
LogitechG203LController::LogitechG203LController(hid_device* dev_handle)
LogitechG203LController::LogitechG203LController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
std::string LogitechG203LController::GetDeviceLocation()
{
return(location);
}
void LogitechG203LController::SendApply()

@ -19,14 +19,18 @@ enum
class LogitechG203LController
{
public:
LogitechG203LController(hid_device* dev_handle);
LogitechG203LController(hid_device* dev_handle, const char* path);
~LogitechG203LController();
void SetSingleLED(int led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(int mode, int speed, unsigned char brightness, unsigned char dir, unsigned char red, unsigned char green, unsigned char blue);
void SetDevice(std::vector<RGBColor> colors);
std::string GetDeviceLocation();
void SetSingleLED(int led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(int mode, int speed, unsigned char brightness, unsigned char dir, unsigned char red, unsigned char green, unsigned char blue);
void SetDevice(std::vector<RGBColor> colors);
private:
hid_device* dev;
void SendApply();
std::string location;
void SendApply();
};

@ -11,9 +11,10 @@
#include <cstring>
LogitechG403Controller::LogitechG403Controller(hid_device* dev_handle)
LogitechG403Controller::LogitechG403Controller(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
LogitechG403Controller::~LogitechG403Controller()
@ -21,6 +22,11 @@ LogitechG403Controller::~LogitechG403Controller()
hid_close(dev);
}
std::string LogitechG403Controller::GetDeviceLocation()
{
return(location);
}
void LogitechG403Controller::SendMouseMode
(
unsigned char mode,

@ -36,9 +36,11 @@ enum
class LogitechG403Controller
{
public:
LogitechG403Controller(hid_device* dev_handle);
LogitechG403Controller(hid_device* dev_handle, const char* path);
~LogitechG403Controller();
std::string GetDeviceLocation();
void SendMouseMode
(
unsigned char mode,
@ -51,4 +53,5 @@ public:
private:
hid_device* dev;
std::string location;
};

@ -11,9 +11,10 @@
#include <cstring>
LogitechG502PSController::LogitechG502PSController(hid_device* dev_handle)
LogitechG502PSController::LogitechG502PSController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
LogitechG502PSController::~LogitechG502PSController()
@ -21,6 +22,11 @@ LogitechG502PSController::~LogitechG502PSController()
hid_close(dev);
}
std::string LogitechG502PSController::GetDeviceLocation()
{
return(location);
}
void LogitechG502PSController::SendMouseMode
(
unsigned char mode,

@ -37,9 +37,11 @@ enum
class LogitechG502PSController
{
public:
LogitechG502PSController(hid_device* dev_handle);
LogitechG502PSController(hid_device* dev_handle, const char* path);
~LogitechG502PSController();
std::string GetDeviceLocation();
void SendMouseMode
(
unsigned char mode,
@ -52,4 +54,5 @@ public:
private:
hid_device* dev;
std::string location;
};

@ -11,9 +11,10 @@
#include <cstring>
LogitechGPowerPlayController::LogitechGPowerPlayController(hid_device* dev_handle)
LogitechGPowerPlayController::LogitechGPowerPlayController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
LogitechGPowerPlayController::~LogitechGPowerPlayController()
@ -21,6 +22,11 @@ LogitechGPowerPlayController::~LogitechGPowerPlayController()
hid_close(dev);
}
std::string LogitechGPowerPlayController::GetDeviceLocation()
{
return(location);
}
void LogitechGPowerPlayController::SendMouseMatMode
(
unsigned char mode,

@ -36,9 +36,11 @@ enum
class LogitechGPowerPlayController
{
public:
LogitechGPowerPlayController(hid_device* dev_handle);
LogitechGPowerPlayController(hid_device* dev_handle, const char* path);
~LogitechGPowerPlayController();
std::string GetDeviceLocation();
void SendMouseMatMode
(
unsigned char mode,
@ -52,4 +54,5 @@ public:
private:
hid_device* dev;
std::string location;
};

@ -11,9 +11,10 @@
#include <cstring>
LogitechGProWirelessController::LogitechGProWirelessController(hid_device* dev_handle)
LogitechGProWirelessController::LogitechGProWirelessController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
}
LogitechGProWirelessController::~LogitechGProWirelessController()
@ -21,6 +22,11 @@ LogitechGProWirelessController::~LogitechGProWirelessController()
hid_close(dev);
}
std::string LogitechGProWirelessController::GetDeviceLocation()
{
return(location);
}
void LogitechGProWirelessController::SendMouseMode
(
unsigned char mode,

@ -36,9 +36,11 @@ enum
class LogitechGProWirelessController
{
public:
LogitechGProWirelessController(hid_device* dev_handle);
LogitechGProWirelessController(hid_device* dev_handle, const char* path);
~LogitechGProWirelessController();
std::string GetDeviceLocation();
void SendMouseMode
(
unsigned char mode,
@ -52,4 +54,5 @@ public:
private:
hid_device* dev;
std::string location;
};

@ -16,6 +16,7 @@ RGBController_LogitechG203::RGBController_LogitechG203(LogitechG203Controller* l
name = "Logitech Mouse Device";
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
mode Static;
Static.name = "Static";

@ -7,6 +7,7 @@ RGBController_LogitechG203L::RGBController_LogitechG203L(LogitechG203LController
name = "Logitech Mouse Device";
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";

@ -16,6 +16,7 @@ RGBController_LogitechG403::RGBController_LogitechG403(LogitechG403Controller* l
name = "Logitech Mouse Device";
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
mode Static;
Static.name = "Static";

@ -16,6 +16,7 @@ RGBController_LogitechG502PS::RGBController_LogitechG502PS(LogitechG502PSControl
name = "Logitech Mouse Device";
type = DEVICE_TYPE_MOUSE;
description = "Logitech Mouse Device";
location = logitech->GetDeviceLocation();
mode Static;
Static.name = "Static";

@ -16,6 +16,7 @@ RGBController_LogitechGProWireless::RGBController_LogitechGProWireless(LogitechG
name = "Logitech G Pro Wireless Gaming Mouse";
type = DEVICE_TYPE_MOUSE;
description = "Logitech G Pro Wireless Gaming Mouse";
location = logitech->GetDeviceLocation();
mode Off;
Off.name = "Off";

Loading…
Cancel
Save