Compare commits

..
Author SHA1 Message Date
Adam Honse 567cdfcb6b Implement size verification on RGBController set description functions 2026-04-13 23:46:42 -05:00
Adam Honse e045ea9bf1 Clean up zone initialization dialog 2026-04-13 11:43:23 -05:00
Adam Honse 5bb2245307 Require local client permission for DeleteProfile, SaveProfile, UploadProfile, SetSettings, and SaveSettings operations, some general cleanup 2026-04-13 11:43:23 -05:00
Adam Honse 7bd6f67d75 Sanitize profile filenames 2026-04-13 11:43:23 -05:00
Adam Honse 03806ebe6b Add RescanDevices to plugin API 2026-04-13 11:43:23 -05:00
Adam Honse d4fcd40e3d Implement segment groups in zone editor 2026-04-13 11:43:23 -05:00
Adam Honse 91ecdaa9b7 Rework server initialization
* Only create server instance if server is actually needed
    * Pass initial server host and port through ResourceManager
    * Allow setting default server host and port in Server settings
2026-04-13 11:43:22 -05:00
stephen iacovelli f11b3057d3 Sort profiles list alphabetically 2026-04-13 11:43:22 -05:00
Adam Honse 5b335962f2 Organize OpenRGBSettingsPage with Group Boxes 2026-04-13 11:43:22 -05:00
Kasslim a1f75de3d9 Correct spelling Busses -> Buses
Commits merged by Adam Honse <[email protected]>
2026-04-13 11:43:22 -05:00
诺诺 5c7b084aa9 Add Nollie controller OS2.1 2026-04-13 11:43:22 -05:00
Adam Honse e6cebf4a61 Initial implementation of OpenRGB SDK protocol Wireshark dissector 2026-04-13 11:43:22 -05:00
Adam Honse ed07e5224f Add ACK to network packets processed by NetworkServer 2026-04-13 11:43:22 -05:00
Adam Honse 592c7ff4ed Only update device view when RGBController::UpdateLEDs signal is sent to OpenRGBDevicePage, fix device view not refreshing if multiple LEDs are selected 2026-04-13 11:43:22 -05:00
Adam Honse 22cc5da057 Don't emit selection update on mouse click event to avoid sending unnecessary events, also only send one type of event per mouse release event. Fix LED box not being updated 2026-04-13 11:43:22 -05:00
Adam Honse 6b0bf07838 Have dummy controller shut down its background thread immediately during constructor to save resources 2026-04-13 11:43:22 -05:00
Adam Honse b3383358c1 DeviceView code cleanup, formatting, commenting 2026-04-13 11:43:22 -05:00
Adam Honse 656579aff0 Fix selecting LEDs in device view 2026-04-13 11:43:22 -05:00
Adam Honse 3cbd28f6fe TabLabel sets its own tooltip so all tabs have a tooltip rather than just devices 2026-04-13 11:43:22 -05:00
Adam Honse e4d8dd9a48 Resize tabs when width is small 2026-04-13 11:43:22 -05:00
Adam Honse 3b11bd146c Rework adding segments with ConfigureZone 2026-04-13 11:43:22 -05:00
Adam Honse 1cbb5a48ac Zone and Segment type updates
* Add zone flags to indicate if fields are manually configurable and if they have been manually configured
  * Add flags field to segment type
  * Add segment flags for group start and group member
  * Add color mode support flags to zone (RGB, RBG, GRB, GBR, BRG, BGR)
  * Add color mode enum to zone
  * Update zone and segment description functions to support new fields
  * Rename the effects-only configurable size flag
  * Remove zone type and matrix map configuration from E1.31 manual configuration, use zone editor instead
  * Rework DeviceResizeZone to DeviceConfigureZone
  * Rework most ARGB controllers to allow zone customizations
  * Rework DRGBController to define devices in DRGBDevices list (similar to RazerDevices)
  * Rework NollieController to define devices in NollieDevices list (similar to RazerDevices)
2026-04-13 11:43:22 -05:00
Adam Honse 5a6eb93db4 Add matrix map automatic generation to matrix map editor 2026-04-13 11:43:22 -05:00
Adam Honse a02c9aa527 RGBController API changes and segment configuration updates
* Make the Get/Set RGBControler descriptor functions static
  * Add functions for getting the matrix_map_type for zone and segment matrix maps
  * Rename zone resize dialog to zone editor dialog
  * Add additional segment types
  * Add option to import segments configuration from JSON file in zone editor dialog
  * Update device view to be able to display matrix segment types
  * Add matrix map editor dialog for creating/editing segment matrix maps
  * Add option to export segments configuration to JSON file in zone editor dialog
2026-04-13 11:43:22 -05:00
Adam Honse ed27303085 When updating existing profile without profile editor dialog, keep saved states for unavailable controllers, base color, and only update plugins already part of the existing profile 2026-04-13 11:43:22 -05:00
Adam Honse ee7e3e70e0 When saving sizes/manual configuration, keep any existing controllers that are not currently available 2026-04-13 11:43:22 -05:00
Adam Honse 2915d8151c Rework how manual configuration (previously sizes) are loaded to newly detected controllers, load active profile to newly detected controllers 2026-04-13 11:43:21 -05:00
Adam Honse 2b6355b4d0 Profile editor dialog 2026-04-13 11:43:21 -05:00
Adam Honse 2282351925 Rework API interface passed into plugins from ResourceManagerInterface to OpenRGBPluginAPIInterface 2026-04-13 11:43:21 -05:00
Adam Honse b7c8afca65 [next] Active profile tracking 2026-04-13 11:43:21 -05:00
Adam Honse e6d04d3c1e Apply profiles server-side rather than client-side, signal active profile update, forward loaded profile to local client for plugins 2026-04-13 11:43:21 -05:00
Adam Honse 97b7261bd1 Split HID and wrapped HID detector lists into specific detectors (with exact VID/PID matching) and generic detectors (with only IPU matching) and prioritize specific detectors when detecting HID devices 2026-04-13 11:43:21 -05:00
Adam Honse 3b0c85592e Move RGBController base destructor functionality into RGBController::Shutdown() so that update thread can be stopped before deleting the controller. Shutdown() must be called in every RGBController implementation before deleting the controller. Also some fixes to the NetworkServer to avoid deadlocking and disconnect issues 2026-04-13 11:43:21 -05:00
Adam Honse 5176f7ff7d Add detectors for filtering on IPU only (no VID/PID) 2026-04-13 11:43:21 -05:00
Adam Honse 11fca22a5b Drop support for old hidapi versions that don't support usage information 2026-04-13 11:43:21 -05:00
Adam Honse 0389531658 Add some validity checks to mode setters and getters in RGBController 2026-04-13 11:43:21 -05:00
Adam Honse 7aa5b61845 [next] SDK v6: Implement client and server flags to indicate capabilities and... 2026-04-13 11:43:21 -05:00
Adam Honse 61fe4fb19d SDK documentation updates 2026-04-13 11:43:21 -05:00
Adam Honse f75139f792 Expose LogManager in ResourceManager so that plugins can use it 2026-04-13 11:43:21 -05:00
Adam Honse 23cacbe117 Update NetworkClient to use log manager and use common name constant in server logs 2026-04-13 11:43:21 -05:00
Adam Honse c26e15fd7b Use std::string.assign when setting strings in the SDK protocol and description handlers so that string size limit is enforced, then strip out null terminators 2026-04-13 11:43:21 -05:00
Adam Honse e8495115b5 Add optional HID device hotplug support (requires https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug) 2026-04-13 11:43:21 -05:00
Adam Honse e1b84ba874 SDK v6: Use unique IDs for identifying RGBControllers in SDK protocol 2026-04-13 11:43:21 -05:00
Adam Honse 31d02f64b2 Rework list handling in ResourceManager by having NetworkClient own its own list rather than sharing ResourceManager's list 2026-04-13 11:43:20 -05:00
Adam Honse e546dc63e8 Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions 2026-04-13 11:43:20 -05:00
Adam Honse 8374a650f6 Detection progress SDK integration, NetworkClient callback rework 2026-04-13 11:43:20 -05:00
Adam Honse 84d3656f4d Split out detection system from ResourceManager into DetectionManager
* Split detection system out into its own class, DetectionManager
    * Clean up ResourceManger's many callbacks into just two, one for detection and one general purpose
2026-04-13 11:43:20 -05:00
Adam Honse 1d963193ae SDK Version 6 Updates
* SDK Protocol
    * Server sends its name to client
    * ProfileManager
      * Rename existing profile commands
      * Add Upload Profile, Download Profile, and Get Active Profile commands
    * SettingsManager
      * Add Get, Set, and Save Settings commands
    * Add zone::active_mode, zone::mode fields for zone-specific modes
    * Add NET_PACKET_ID_RGBCONTROLLER_UPDATEZONEMODE packet for updating zone modes
    * Add segment::matrix_map to segment packet
    * Add NET_PACKET_ID_RGBCONTROLLER_SIGNALUPDATE packet for passing SignalUpdate signal from server to clients
  * NetworkServer
    * Formatting cleanup
    * Use per-controller threads for handling NetworkServer controller-specific packets to avoid delays from controller mutexes
  * NetworkClient
    * Formatting cleanup
  * RGBController
    * Clean up and modularize descriptor functions
2026-04-13 11:43:20 -05:00
Adam Honse 66921e1cd9 Rework Profiles to use JSON format
* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
    * Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
    * Update ProfileManager to store profiles in "profiles" folder in .json format
    * Update ProfileManager to store size profile in sizes.json
    * Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
    * Code cleanup of ProfileManager and profile-related code
2026-04-13 11:43:20 -05:00
Adam Honse add92d7f73 RGBController API Overhaul
* Reorganize and clean up RGBController API functions
    * Add functions to get protected RGBController member values
    * Make NetworkClient, ProfileManager, and ResourceManager friend classes so they can access protected members
    * Protected previously-public RGBController members
        * Information strings (name, vendor, description, version, serial location)
        * Device type
        * Active mode
        * Flags
        * LEDs vector
        * LED alternate names vector
        * Modes vector
        * Colors vector
        * Zones vector
    * Add CONTROLLER_FLAG_HIDDEN to allow plugins to hide controllers from control GUI
    * Add update reason codes to RGBController update callback and signal updates on more RGBController events
    * Add loop zone types and segmented zone type
    * Add matrix map field to segments
    * Rework matrix_map_type from using pointers to vector to prevent memory leaks
    * Rework KeyboardLayoutManager to return new matrix_map_type
    * Add access mutex to RGBController API
    * Add per-zone modes ot RGBController API
    * Add JSON description functions to RGBController API
2026-04-13 11:43:20 -05:00
Adam Honse e42e79538c Move plugin SDK integration from callback into plugin API and PluginManager 2026-04-13 11:43:20 -05:00
Adam Honse c87f343f8b Update Plugin API to 5 and SDK Protocol to 6 2026-04-13 11:43:19 -05:00
Adam Honse fc24044a48 Update default builds to Qt6
* Update Debian packages to use Qt6
  * Update Fedora packages to use Qt6
  * Update default AppImage builds to use Qt6
  * Update default Windows builds to use Qt6
  * Update default MacOS builds to use Qt6
2026-04-13 11:43:19 -05:00
222 changed files with 13296 additions and 40223 deletions
+16 -4
View File
@@ -536,7 +536,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt6 arm
- eval $(/opt/homebrew/bin/brew shellenv)
- qmake OpenRGB.pro
- make -j16
- macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -552,7 +555,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt5 arm
- eval $(/opt/homebrew/bin/brew shellenv)
- /opt/homebrew/opt/qt@5/bin/qmake OpenRGB.pro
- make -j16
- /opt/homebrew/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Qt5_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -568,7 +574,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt6 intel
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
@@ -584,7 +593,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt5 intel
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/opt/qt@5/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_Qt5_${CI_COMMIT_SHORT_SHA}"
-4
View File
@@ -69,7 +69,3 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
## AI Guidelines
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.
@@ -31,7 +31,7 @@ AOCKeyboardController::~AOCKeyboardController()
std::string AOCKeyboardController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCKeyboardController::GetDeviceName()
@@ -27,7 +27,7 @@ AOCMouseController::~AOCMouseController()
std::string AOCMouseController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCMouseController::GetDeviceName()
@@ -27,7 +27,7 @@ AOCMousematController::~AOCMousematController()
std::string AOCMousematController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCMousematController::GetDeviceName()
@@ -36,7 +36,7 @@ ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -36,7 +36,7 @@ ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -37,7 +37,7 @@ ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -91,9 +91,9 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == ASROCK_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for Polychrome controller at 0x6A
@@ -32,7 +32,7 @@ std::string AuraGPUController::GetDeviceName()
std::string AuraGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -79,7 +79,7 @@ void AuraGPUController::AuraGPURegisterWrite(unsigned char reg, unsigned char va
bool AuraGPUController::SaveOnlyApplies()
{
switch (bus->info.pci_subsystem_device)
switch (bus->pci_subsystem_device)
{
case ASUS_VEGA64_STRIX:
return false;
@@ -21,7 +21,7 @@
bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -19,10 +19,7 @@ AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, con
| Manually adding device info for now |
| TODO: Implement config table accurately |
\*-----------------------------------------------------*/
uint8_t leds = (dev_name.find("Ryujin") != std::string::npos) ? 5 : 12;
device_info.push_back({0x00, 0x00, leds, 0, AuraDeviceType::FIXED});
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
}
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
@@ -120,7 +120,6 @@
#define AURA_TERMINAL_PID 0x1889
#define ROG_STRIX_LC120_PID 0x879E
#define AURA_RYUO_AIO_PID 0x1887
#define AURA_RYUJIN_AIO_PID 0x18AE
#define ASUS_ROG_ALLY_PID 0x1ABE
#define ASUS_ROG_ALLY_X_PID 0x1B4C
@@ -524,7 +523,6 @@ REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAs
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Strix LC", DetectAsusAuraUSBROGStrixLC, AURA_USB_VID, ROG_STRIX_LC120_PID, 0x00FF, 1);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryuo AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUO_AIO_PID, 0xFF72, 0x00A1);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryujin AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUJIN_AIO_PID, 0xFF72, 0x00A1);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI GUNDAM", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_GUNDAM_PID, 0);
@@ -26,7 +26,7 @@ ColorfulGPUController::~ColorfulGPUController()
std::string ColorfulGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -45,7 +45,7 @@ void ColorfulGPUController::SetDirect(RGBColor color)
uint8_t g = RGBGetGValue(color);
uint8_t b = RGBGetBValue(color);
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
if(this->bus->pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
{
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
@@ -24,7 +24,7 @@ ColorfulTuringGPUController::~ColorfulTuringGPUController()
std::string ColorfulTuringGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -17,7 +17,7 @@ DetectedControllers DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus,
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
ColorfulTuringGPUController* controller = new ColorfulTuringGPUController(bus, i2c_addr, name);
RGBController_ColorfulTuringGPU* rgb_controller = new RGBController_ColorfulTuringGPU(controller);
@@ -52,7 +52,7 @@ unsigned char CorsairDRAMController::GetProtocolVersion()
std::string CorsairDRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -366,7 +366,7 @@ void CorsairDRAMController::ReadDeviceInfo()
/*-----------------------------------------------------*\
| Log Device Information Data |
\*-----------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
if(LogManager::get()->getLoglevel() >= LL_TRACE)
{
char device_info_buf[256];
unsigned int pos;
@@ -44,9 +44,9 @@ bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char addres
res = bus->i2c_smbus_read_byte_data(address, 0x44);
if(!(res == 0x01 || res == 0x03 || res == 0x04))
if(!(res == 0x03 || res == 0x04))
{
LOG_DEBUG("[%s] Failed: expected 0x01, 0x03, or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
LOG_DEBUG("[%s] Failed: expected 0x03 or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
return false;
}
@@ -59,7 +59,7 @@ DetectedControllers DetectCorsairDRAMControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DRAM_NAME, bus);
@@ -34,7 +34,7 @@ std::string CorsairVengeanceController::GetDeviceName()
std::string CorsairVengeanceController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -23,7 +23,7 @@ CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller()
std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string CreativeSoundBlasterXG6Controller::GetDeviceName()
@@ -35,7 +35,7 @@ std::string CrucialController::GetDeviceVersion()
std::string CrucialController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -145,7 +145,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
{
int address_list_idx = -1;
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
for(unsigned int slot = 0; slot < 4; slot++)
{
@@ -182,7 +182,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
std::this_thread::sleep_for(1ms);
}
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->info.pci_vendor, buses[bus]->info.pci_device, TESTING_ADDRESSES);
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->pci_vendor, buses[bus]->pci_device, TESTING_ADDRESSES);
// Add Crucial controllers
for(unsigned int address_list_idx = 0; address_list_idx < CRUCIAL_ADDRESS_COUNT; address_list_idx++)
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "nlohmann/json.hpp"
#include "DetectionManager.h"
#include "LogManager.h"
#include "ResourceManager.h"
@@ -13,7 +13,6 @@
#include <algorithm>
#include <cstring>
#include "KeyboardLayoutManager.h"
#include "JsonUtils.h"
#include "RGBController_Debug.h"
/**------------------------------------------------------------------*\
@@ -55,69 +54,80 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
if(custom_controller)
{
/*-------------------------------------------------*\
| Set the name, description, location, version, and |
| serial |
| Set the name |
\*-------------------------------------------------*/
name = JsonUtils::JsonGetString(debug_settings, "DeviceName", "Custom Device");
description = JsonUtils::JsonGetString(debug_settings, "DeviceDescription");
location = JsonUtils::JsonGetString(debug_settings, "DeviceLocation");
version = JsonUtils::JsonGetString(debug_settings, "DeviceVersion");
serial = JsonUtils::JsonGetString(debug_settings, "DeviceSerial");
name = debug_settings["DeviceName"];
/*-------------------------------------------------*\
| Find the device type |
\*-------------------------------------------------*/
std::string device_type = JsonUtils::JsonGetString(debug_settings, "DeviceType", "keyboard");
if (debug_settings["DeviceType"] == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if (debug_settings["DeviceType"] == "dram") type = DEVICE_TYPE_DRAM;
else if (debug_settings["DeviceType"] == "gpu") type = DEVICE_TYPE_GPU;
else if (debug_settings["DeviceType"] == "cooler") type = DEVICE_TYPE_COOLER;
else if (debug_settings["DeviceType"] == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if (debug_settings["DeviceType"] == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if (debug_settings["DeviceType"] == "mouse") type = DEVICE_TYPE_MOUSE;
else if (debug_settings["DeviceType"] == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if (debug_settings["DeviceType"] == "headset") type = DEVICE_TYPE_HEADSET;
else if (debug_settings["DeviceType"] == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if (debug_settings["DeviceType"] == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if (debug_settings["DeviceType"] == "light") type = DEVICE_TYPE_LIGHT;
else if (debug_settings["DeviceType"] == "speaker") type = DEVICE_TYPE_SPEAKER;
else if (debug_settings["DeviceType"] == "unknown") type = DEVICE_TYPE_UNKNOWN;
if( device_type == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if(device_type == "dram") type = DEVICE_TYPE_DRAM;
else if(device_type == "gpu") type = DEVICE_TYPE_GPU;
else if(device_type == "cooler") type = DEVICE_TYPE_COOLER;
else if(device_type == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if(device_type == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if(device_type == "mouse") type = DEVICE_TYPE_MOUSE;
else if(device_type == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if(device_type == "headset") type = DEVICE_TYPE_HEADSET;
else if(device_type == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if(device_type == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if(device_type == "light") type = DEVICE_TYPE_LIGHT;
else if(device_type == "speaker") type = DEVICE_TYPE_SPEAKER;
else if(device_type == "unknown") type = DEVICE_TYPE_UNKNOWN;
/*-------------------------------------------------*\
| Set description, location, version, and serial |
\*-------------------------------------------------*/
description = debug_settings["DeviceDescription"];
location = debug_settings["DeviceLocation"];
version = debug_settings["DeviceVersion"];
serial = debug_settings["DeviceSerial"];
}
else
{
std::string name_setting = JsonUtils::JsonGetString(debug_settings, "name");
std::string type_setting = JsonUtils::JsonGetString(debug_settings, "type", "keyboard");
std::string name_setting = "";
std::string type_setting = "keyboard";
if(debug_settings.contains("name"))
{
name_setting = debug_settings["name"];
}
if(debug_settings.contains("type"))
{
type_setting = debug_settings["type"];
}
if(type_setting == "motherboard")
{
name = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
name = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
}
else if(type_setting == "dram")
{
name = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
name = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
}
else if(type_setting == "gpu")
{
name = "Debug GPU";
type = DEVICE_TYPE_GPU;
name = "Debug GPU";
type = DEVICE_TYPE_GPU;
}
else if(type_setting == "keyboard")
{
name = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
name = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
}
else if(type_setting == "mouse")
{
name = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
name = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
}
else if(type_setting == "argb")
{
name = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
name = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
}
/*---------------------------------------------------------*\
@@ -133,41 +143,6 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
{
name = name_setting;
}
/*---------------------------------------------------------*\
| Create test configuration |
\*---------------------------------------------------------*/
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
configuration_json["schema"]["test_string"]["title"] = "String Setting";
configuration_json["schema"]["test_string"]["type"] = "string";
configuration_json["schema"]["test_bool"]["title"] = "Boolean Setting";
configuration_json["schema"]["test_bool"]["type"] = "bool";
configuration_json["schema"]["test_enum"]["title"] = "String Enum Setting";
configuration_json["schema"]["test_enum"]["type"] = "string";
configuration_json["schema"]["test_enum"]["enum"][0] = "Option 1";
configuration_json["schema"]["test_enum"]["enum"][1] = "Option 2";
configuration_json["schema"]["test_enum"]["enum"][2] = "Option 3";
configuration_json["schema"]["test_enum_int"]["title"] = "Integer Enum Setting";
configuration_json["schema"]["test_enum_int"]["type"] = "integer";
configuration_json["schema"]["test_enum_int"]["enum"][0] = 2;
configuration_json["schema"]["test_enum_int"]["enum"][1] = 4;
configuration_json["schema"]["test_enum_int"]["enum"][2] = 8;
configuration_json["schema"]["test_int"]["title"] = "Integer Setting";
configuration_json["schema"]["test_int"]["type"] = "integer";
configuration_json["configuration"]["test_string"] = "This is a test";
configuration_json["configuration"]["test_bool"] = true;
configuration_json["configuration"]["test_enum"] = "Option 2";
configuration_json["configuration"]["test_enum_int"] = 4;
configuration_json["configuration"]["test_int"] = 12345;
configuration = configuration_json.dump();
}
/*-----------------------------------------------------*\
@@ -206,7 +181,6 @@ void RGBController_Debug::SetupZones()
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
led_alt_names.clear();
leds.clear();
colors.clear();
@@ -242,9 +216,9 @@ void RGBController_Debug::SetupZones()
continue;
}
custom_zone.leds_min = JsonUtils::JsonGetInt(ZoneJson, "leds_min");
custom_zone.leds_max = JsonUtils::JsonGetInt(ZoneJson, "leds_max");
custom_zone.leds_count = JsonUtils::JsonGetInt(ZoneJson, "leds_count");
custom_zone.leds_min = ZoneJson["leds_min"];
custom_zone.leds_max = ZoneJson["leds_max"];
custom_zone.leds_count = ZoneJson["leds_count"];
/*---------------------------------------------*\
| Fill in the matrix map |
@@ -267,8 +241,8 @@ void RGBController_Debug::SetupZones()
continue;
}
unsigned int H = JsonUtils::JsonGetInt(ZoneJson, "matrix_width");
unsigned int W = JsonUtils::JsonGetInt(ZoneJson, "matrix_height");
unsigned int H = ZoneJson["matrix_width"];
unsigned int W = ZoneJson["matrix_height"];
BadVal = ((unsigned int)ZoneJson["matrix_map"].size() != H);
@@ -359,11 +333,36 @@ void RGBController_Debug::SetupZones()
}
else
{
bool zone_single = JsonUtils::JsonGetBool(debug_settings, "single", true);
bool zone_linear = JsonUtils::JsonGetBool(debug_settings, "linear", true);
bool zone_resizable = JsonUtils::JsonGetBool(debug_settings, "resizable", false);
bool zone_keyboard = JsonUtils::JsonGetBool(debug_settings, "keyboard", false);
bool zone_underglow = JsonUtils::JsonGetBool(debug_settings, "underglow", false);
bool zone_single = true;
bool zone_linear = true;
bool zone_resizable = false;
bool zone_keyboard = false;
bool zone_underglow = false;
if(debug_settings.contains("single"))
{
zone_single = debug_settings["single"];
}
if(debug_settings.contains("linear"))
{
zone_linear = debug_settings["linear"];
}
if(debug_settings.contains("resizable"))
{
zone_resizable = debug_settings["resizable"];
}
if(debug_settings.contains("keyboard"))
{
zone_keyboard = debug_settings["keyboard"];
}
if(debug_settings.contains("underglow"))
{
zone_underglow = debug_settings["underglow"];
}
/*-------------------------------------------------*\
| Create a single zone/LED |
@@ -372,23 +371,21 @@ void RGBController_Debug::SetupZones()
{
zone single_zone;
single_zone.name = "Single Zone";
single_zone.type = ZONE_TYPE_SINGLE;
single_zone.leds_min = 1;
single_zone.leds_max = 1;
single_zone.leds_count = 1;
if(first_run)
{
zones.push_back(single_zone);
}
zones[zone_idx].name = "Single Zone";
zones[zone_idx].type = ZONE_TYPE_SINGLE;
if(first_run)
else
{
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC;
zones[zone_idx] = single_zone;
}
zones[zone_idx].leds_min = 1;
zones[zone_idx].leds_max = 1;
zones[zone_idx].leds_count = 1;
led single_led;
single_led.name = "Single LED";
@@ -397,27 +394,6 @@ void RGBController_Debug::SetupZones()
led_alt_names.push_back("");
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["color_order"]["title"] = "Color Order";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][0] = "RGB";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][1] = "GRB";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["color_order"] = "RGB";
}
configuration = configuration_json.dump();
zone_idx++;
}
@@ -428,18 +404,22 @@ void RGBController_Debug::SetupZones()
{
zone linear_zone;
linear_zone.name = "Linear Zone";
linear_zone.type = ZONE_TYPE_LINEAR;
linear_zone.leds_min = 10;
linear_zone.leds_max = 10;
linear_zone.leds_count = 10;
if(first_run)
{
zones.push_back(linear_zone);
}
else
{
zones[zone_idx] = linear_zone;
}
zones[zone_idx].name = "Linear Zone";
zones[zone_idx].type = ZONE_TYPE_LINEAR;
zones[zone_idx].leds_min = 10;
zones[zone_idx].leds_max = 10;
zones[zone_idx].leds_count = 10;
for(std::size_t led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
for(std::size_t led_idx = 0; led_idx < 10; led_idx++)
{
led linear_led;
@@ -461,24 +441,6 @@ void RGBController_Debug::SetupZones()
KEYBOARD_LAYOUT layout = KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ANSI_QWERTY;
KEYBOARD_SIZE size = KEYBOARD_SIZE::KEYBOARD_SIZE_FULL;
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
zone keyboard_zone;
if(first_run)
{
zones.push_back(keyboard_zone);
}
zones[zone_idx].name = "Keyboard Zone";
zones[zone_idx].type = ZONE_TYPE_MATRIX;
if(first_run)
{
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC | ZONE_FLAG_ZONE_GEOMETRY_MAY_CHANGE;
}
if(debug_settings.contains("layout"))
{
KEYBOARD_LAYOUT temp_layout = debug_settings["layout"];
@@ -489,29 +451,6 @@ void RGBController_Debug::SetupZones()
}
}
if(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
{
if(configuration_json.contains("zones") && (zone_idx < (int)configuration_json["zones"].size()))
{
if(configuration_json["zones"][zone_idx].contains("configuration"))
{
if(configuration_json["zones"][zone_idx]["configuration"].contains("layout"))
{
std::string layout_string = configuration_json["zones"][zone_idx]["configuration"]["layout"];
for(std::size_t layout_idx = 0; layout_idx < NUM_LAYOUTS; layout_idx++)
{
if(layout_names[layout_idx] == layout_string)
{
layout = (KEYBOARD_LAYOUT)layout_idx;
break;
}
}
}
}
}
}
if(debug_settings.contains("size"))
{
size = debug_settings["size"];
@@ -519,6 +458,8 @@ void RGBController_Debug::SetupZones()
KeyboardLayoutManager new_kb(layout, size);
description += ", Layout: " + layout_names[layout] + ", Size: " + new_kb.GetName();
/*---------------------------------------------*\
| Check for custom key inserts and swaps |
\*---------------------------------------------*/
@@ -577,12 +518,25 @@ void RGBController_Debug::SetupZones()
new_kb.ChangeKeys(change);
}
zones[zone_idx].leds_min = new_kb.GetKeyCount();
zones[zone_idx].leds_max = new_kb.GetKeyCount();
zones[zone_idx].leds_count = new_kb.GetKeyCount();
zones[zone_idx].matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
zone keyboard_zone;
for(unsigned int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
keyboard_zone.name = "Keyboard Zone";
keyboard_zone.type = ZONE_TYPE_MATRIX;
keyboard_zone.leds_min = new_kb.GetKeyCount();
keyboard_zone.leds_max = new_kb.GetKeyCount();
keyboard_zone.leds_count = new_kb.GetKeyCount();
keyboard_zone.matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
if(first_run)
{
zones.push_back(keyboard_zone);
}
else
{
zones[zone_idx] = keyboard_zone;
}
for(unsigned int led_idx = 0; led_idx < keyboard_zone.leds_count; led_idx++)
{
led keyboard_led;
@@ -593,28 +547,6 @@ void RGBController_Debug::SetupZones()
led_alt_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
}
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["layout"]["title"] = "Layout";
configuration_json["zones"][zone_idx]["schema"]["layout"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][0] = "Default",
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][1] = "ANSI QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][2] = "ISO QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][3] = "ISO QWERTZ";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][4] = "ISO AZERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][5] = "JIS";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["layout"] = "Default";
}
configuration = configuration_json.dump();
zone_idx++;
}
@@ -742,13 +674,3 @@ void RGBController_Debug::DeviceUpdateMode()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificConfiguration()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificZoneConfiguration(int zone)
{
SetupZones();
}
@@ -33,9 +33,6 @@ public:
void DeviceUpdateMode();
void DeviceUpdateDeviceSpecificConfiguration();
void DeviceUpdateDeviceSpecificZoneConfiguration(int zone);
private:
json debug_settings;
bool custom_controller;
@@ -235,7 +235,8 @@ void RGBController_E131::SetupZones()
led_zone.leds_count = devices[zone_idx].num_leds;
led_zone.flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS
| ZONE_FLAG_MANUALLY_CONFIGURABLE_COLOR_ORDER;
zones.push_back(led_zone);
}
@@ -53,7 +53,7 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id
| If this is running with TRACE or higher loglevel |
| then dump the entire Feature list to log |
\*-------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
if(LogManager::get()->getLoglevel() >= LL_TRACE)
{
LOG_TRACE("[ENE SMBus] ENE config table for 0x%02X:", dev);
LOG_TRACE(" %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", config_table[0], config_table[1], config_table[2], config_table[3],
@@ -154,7 +154,7 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
{
int address_list_idx = -1;
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
LOG_DEBUG("[ENE SMBus DRAM] Remapping ENE SMBus RAM modules on 0x77");
@@ -220,9 +220,9 @@ DetectedControllers DetectENESMBusMotherboardControllers(std::vector<i2c_smbus_i
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
// Add ENE (ASUS Aura) motherboard controllers
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == ASUS_SUB_VEN || buses[bus]->info.pci_subsystem_vendor == 0 || buses[bus]->info.pci_subsystem_vendor == 0xFFFF)
if(buses[bus]->pci_subsystem_vendor == ASUS_SUB_VEN || buses[bus]->pci_subsystem_vendor == 0 || buses[bus]->pci_subsystem_vendor == 0xFFFF)
{
for(unsigned int address_list_idx = 0; address_list_idx < AURA_MOBO_ADDRESS_COUNT; address_list_idx++)
{
@@ -302,7 +302,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3060TI_O8G_OC_V2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_WHITE, 0x67);
@@ -410,8 +409,7 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE_2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG MATRIX PLATINUM GeForce RTX 4090", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_MATRIX_PLATINUM_RTX_4090_24G, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5060 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5060_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_5070TI_O16G_GAMING_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5080 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5080_O16G_GAMING, 0x67);
@@ -450,7 +448,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7700 XT Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING_0606, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming White OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_WHITE_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 GRE Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900GRE_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XT_020G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XTX Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XTX_O24G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 9070 Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_9070_016G_GAMING, 0x67);
@@ -28,7 +28,7 @@ ene_interface_type ENESMBusInterface_i2c_smbus::GetInterfaceType()
std::string ENESMBusInterface_i2c_smbus::GetLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
return("I2C: " + return_string);
}
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAAmpereGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv3Controller* controller;
RGBController_EVGAGPUv3* rgb_controller;
@@ -26,7 +26,7 @@ EVGAGPUv3Controller::~EVGAGPUv3Controller()
std::string EVGAGPUv3Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -25,7 +25,7 @@ EVGAGP102Controller::~EVGAGP102Controller()
std::string EVGAGP102Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", zi.dev_addr);
return_string.append(", address ");
@@ -21,7 +21,7 @@ DetectedControllers DetectEVGAGP102GPUControllers(i2c_smbus_interface* bus, uint
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
std::vector<EVGAGP102Controller*> controllers;
@@ -25,7 +25,7 @@ EVGAGPUv1Controller::~EVGAGPUv1Controller()
std::string EVGAGPUv1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAPascalGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv1Controller* controller = new EVGAGPUv1Controller(bus, address, name);
RGBController_EVGAGPUv1* rgb_controller = new RGBController_EVGAGPUv1(controller);
@@ -32,7 +32,7 @@ EVGAACX30SMBusController::~EVGAACX30SMBusController()
std::string EVGAACX30SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -46,9 +46,9 @@ DetectedControllers DetectAcx30SMBusControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == EVGA_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == EVGA_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, EVGA_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for ACX 30 controller at 0x28
@@ -25,7 +25,7 @@ EVGAGPUv2Controller::~EVGAGPUv2Controller()
std::string EVGAGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -19,7 +19,7 @@ DetectedControllers DetectEVGATuringGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv2Controller* controller = new EVGAGPUv2Controller(bus, address, name);
RGBController_EVGAGPUv2* rgb_controller = new RGBController_EVGAGPUv2(controller);
@@ -13,9 +13,8 @@
#include <sstream>
#include <thread>
#include <vector>
#include <nlohmann/json.hpp>
#include "ElgatoLightStripController.h"
#include "JsonUtils.h"
#include <nlohmann/json.hpp>
#include "LogManager.h"
using json = nlohmann::json;
@@ -59,8 +58,7 @@ ElgatoLightStripController::ElgatoLightStripController(std::string ip)
}
std::string result = recv_list[5];
json elgato_lightstrip_data;
JsonUtils::JsonParse(result, elgato_lightstrip_data);
json elgato_lightstrip_data = json::parse(result);
firmware_version = elgato_lightstrip_data["firmwareVersion"];
serialnumber = elgato_lightstrip_data["serialNumber"];
@@ -44,7 +44,7 @@ FnaticStreakController::~FnaticStreakController()
std::string FnaticStreakController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string FnaticStreakController::GetNameString()
@@ -26,7 +26,7 @@ GainwardGPUv1Controller::~GainwardGPUv1Controller()
std::string GainwardGPUv1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -23,7 +23,7 @@ GainwardGPUv2Controller::~GainwardGPUv2Controller() = default;
std::string GainwardGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -26,7 +26,7 @@ GalaxGPUv1Controller::~GalaxGPUv1Controller()
std::string GalaxGPUv1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -26,7 +26,7 @@ GalaxGPUv2Controller::~GalaxGPUv2Controller()
std::string GalaxGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -30,7 +30,7 @@ RGBFusion2BlackwellGPUController::~RGBFusion2BlackwellGPUController()
std::string RGBFusion2BlackwellGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -20,7 +20,7 @@
bool TestForGigabyteRGBFusion2BlackwellGPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -48,7 +48,7 @@ unsigned int RGBFusion2DRAMController::GetLEDCount()
std::string RGBFusion2DRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -54,7 +54,7 @@ DetectedControllers DetectGigabyteRGBFusion2DRAMControllers(std::vector<i2c_smbu
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
// Check for RGB Fusion 2 DRAM controller at 0x67
if(TestForGigabyteRGBFusion2DRAMController(buses[bus], 0x67))
@@ -28,7 +28,7 @@ RGBFusion2GPUController::~RGBFusion2GPUController()
std::string RGBFusion2GPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -20,7 +20,7 @@
bool TestForGigabyteRGBFusion2GPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -44,7 +44,7 @@ std::string RGBFusion2SMBusController::GetDeviceName()
std::string RGBFusion2SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -114,16 +114,16 @@ DetectedControllers DetectGigabyteRGBFusion2SMBusControllers(std::vector<i2c_smb
LOG_DEBUG(GIGABYTE_FOUND_MB_MESSAGE_EN, DETECTOR_NAME, dmi.getMainboard().c_str());
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == GIGABYTE_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == GIGABYTE_SUB_VEN)
{
/*-------------------------------------*\
| TODO - Is this necessary? Or an |
| artifact of my own system? Skip dmcd |
| devices |
\*-------------------------------------*/
std::string device_name = std::string(buses[bus]->info.device_name);
std::string device_name = std::string(buses[bus]->device_name);
if(device_name.find("dmdc") == std::string::npos)
{
@@ -42,7 +42,7 @@ std::string RGBFusionController::GetDeviceName()
std::string RGBFusionController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -49,9 +49,9 @@ DetectedControllers DetectGigabyteRGBFusionControllers(std::vector<i2c_smbus_int
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == GIGABYTE_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == GIGABYTE_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
@@ -25,7 +25,7 @@ RGBFusionGPUController::~RGBFusionGPUController()
std::string RGBFusionGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -98,7 +98,6 @@ DetectedControllers DetectGigabyteRGBFusionGPUControllers(i2c_smbus_interface* b
return(detected_controllers);
}
REGISTER_I2C_PCI_DETECTOR("Gigabyte GTX 1050 G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050_G1_GAMING_SUB_DEV, 0x47);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1050 Ti G1 Gaming Rev A1", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050TI_G1_GAMING_SUB_DEV, 0x47);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1050 Ti G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050TI_G1_GAMING_SUB_DEV, 0x48);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1060 G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1060_G1_GAMING_SUB_DEV, 0x48);
@@ -13,7 +13,6 @@
#include <nlohmann/json.hpp>
#include "base64.hpp"
#include "GoveeController.h"
#include "JsonUtils.h"
using json = nlohmann::json;
using namespace std::chrono_literals;
@@ -107,8 +106,7 @@ void GoveeController::ReceiveBroadcast(char* recv_buf, int size)
/*-----------------------------------------------------*\
| Convert null-terminated response to JSON |
\*-----------------------------------------------------*/
json response;
JsonUtils::JsonParse(recv_buf, response);
json response = json::parse(recv_buf);
/*-----------------------------------------------------*\
| Check if the response contains the method name |
@@ -40,7 +40,7 @@ HyperXDRAMController::~HyperXDRAMController()
std::string HyperXDRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -55,7 +55,7 @@ DetectedControllers DetectHyperXDRAMControllers(i2c_smbus_interface* bus, std::v
unsigned char slots_valid = 0x00;
// Check for HyperX controller at 0x27
LOG_DEBUG("[%s] Testing bus %d at address 0x27", HYPERX_CONTROLLER_NAME, bus->info.port_id);
LOG_DEBUG("[%s] Testing bus %d at address 0x27", HYPERX_CONTROLLER_NAME, bus->port_id);
if(TestForHyperXDRAMController(bus, 0x27))
{
@@ -15,14 +15,12 @@
#include "HyperXAlloyOriginsController.h"
#include "HyperXAlloyOriginsCoreController.h"
#include "HyperXAlloyOrigins60and65Controller.h"
#include "HyperXOrigins2_65Controller.h"
#include "RGBController_HyperXAlloyElite.h"
#include "RGBController_HyperXAlloyElite2.h"
#include "RGBController_HyperXAlloyFPS.h"
#include "RGBController_HyperXAlloyOrigins.h"
#include "RGBController_HyperXAlloyOriginsCore.h"
#include "RGBController_HyperXAlloyOrigins60and65.h"
#include "RGBController_HyperXOrigins2_65.h"
/*---------------------------------------------------------*\
| HyperX keyboard vendor and product IDs |
@@ -46,7 +44,6 @@
#define HYPERX_ALLOY_ORIGINS_65_HP_PID 0x038F
#define HYPERX_ALLOY_ORIGINS_CORE_HP_PID 0x098F
#define HYPERX_ALLOY_ORIGINS_HP_PID 0x0591
#define HYPERX_ORIGINS_2_65_HP_PID 0x0CC2
AlloyOrigins60and65MappingLayoutType GetAlloyOrigins60and65MappingLayoutType(int pid)
{
@@ -173,32 +170,12 @@ DetectedControllers DetectHyperXAlloyOrigins60and65(hid_device_info* info, const
return(detected_controllers);
}
DetectedControllers DetectHyperXOrigins2_65(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
HyperXOrigins2_65Controller* controller = new HyperXOrigins2_65Controller(dev, info->path, name);
RGBController_HyperXOrigins2_65* rgb_controller = new RGBController_HyperXOrigins2_65(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite RGB", DetectHyperXAlloyElite, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("HyperX Alloy FPS RGB", DetectHyperXAlloyFPS, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_FPS_RGB_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core", DetectHyperXAlloyOriginsCore, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_PID, 2);
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core (HP)", DetectHyperXAlloyOriginsCore, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_HP_PID, 2);
REGISTER_HID_DETECTOR_I("HyperX Origins 2 65 (HP)", DetectHyperXOrigins2_65, HP_KEYBOARD_VID, HYPERX_ORIGINS_2_65_HP_PID, 3);
#ifdef _WIN32
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins", DetectHyperXAlloyOrigins, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 3);
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite 2", DetectHyperXAlloyElite2, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_PID, 3, 0xFF90);
@@ -1,151 +0,0 @@
/*---------------------------------------------------------*\
| HyperXOrigins2_65Controller.cpp |
| |
| Driver for HyperX Origins 2 65 keyboard |
| |
| Ricardo Amorim 28 Mar 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include "HyperXOrigins2_65Controller.h"
#include "StringUtils.h"
HyperXOrigins2_65Controller::HyperXOrigins2_65Controller(hid_device* dev_handle, const char* path, std::string dev_name)
{
dev = dev_handle;
location = path;
name = dev_name;
}
HyperXOrigins2_65Controller::~HyperXOrigins2_65Controller()
{
hid_close(dev);
}
std::string HyperXOrigins2_65Controller::GetDeviceLocation()
{
return("HID: " + location);
}
std::string HyperXOrigins2_65Controller::GetNameString()
{
return(name);
}
std::string HyperXOrigins2_65Controller::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return ("");
}
return(StringUtils::wstring_to_string(serial_string));
}
void HyperXOrigins2_65Controller::SetLEDsDirect(std::vector<RGBColor> colors)
{
/*-----------------------------------------------------*\
| Set up variables to track progress of color transmit |
| Do this after inserting blanks |
\*-----------------------------------------------------*/
int colors_to_send = (int)colors.size();
int colors_sent = 0;
SendDirectInitialization();
for(int pkt_idx = 0; pkt_idx < 4; pkt_idx++)
{
if(colors_to_send > 20)
{
SendDirectColorPacket(&colors[colors_sent], 20, pkt_idx);
colors_sent += 20;
colors_to_send -= 20;
}
else if(colors_to_send > 0)
{
SendDirectColorPacket(&colors[colors_sent], colors_to_send, pkt_idx);
colors_sent += colors_to_send;
colors_to_send -= colors_to_send;
}
else
{
RGBColor temp = 0x00000000;
SendDirectColorPacket(&temp, 1, pkt_idx);
}
}
}
void HyperXOrigins2_65Controller::SendDirectInitialization()
{
unsigned char buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(buf, 0x00, sizeof(buf));
/*-----------------------------------------------------*\
| Set up Direct Initialization packet |
\*-----------------------------------------------------*/
buf[0x00] = 0x44;
buf[0x01] = 0x01;
buf[0x02] = 0x04;
buf[0x03] = 0x00;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, buf, 65);
}
void HyperXOrigins2_65Controller::SendDirectColorPacket
(
RGBColor* color_data,
unsigned int color_count,
unsigned int seq
)
{
unsigned char buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(buf, 0x00, sizeof(buf));
/*-----------------------------------------------------*\
| Set up Direct Initialization packet |
\*-----------------------------------------------------*/
buf[0x00] = 0x44;
buf[0x01] = 0x02;
buf[0x02] = (unsigned char)seq;
buf[0x03] = 0x00;
/*-----------------------------------------------------*\
| The maximum number of colors per packet is 20 |
\*-----------------------------------------------------*/
if(color_count > 20)
{
color_count = 20;
}
/*-----------------------------------------------------*\
| Copy in color data |
\*-----------------------------------------------------*/
for(unsigned int color_idx = 0; color_idx < color_count; color_idx++)
{
buf[4 + (color_idx * 3)] = RGBGetRValue(color_data[color_idx]);
buf[4 + (color_idx * 3) + 1] = RGBGetGValue(color_data[color_idx]);
buf[4 + (color_idx * 3) + 2] = RGBGetBValue(color_data[color_idx]);
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, buf, 65);
}
@@ -1,43 +0,0 @@
/*---------------------------------------------------------*\
| HyperXOrigins2_65Controller.h |
| |
| Driver for HyperX Origins 2 65 keyboard |
| |
| Ricardo Amorim 28 Mar 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include <hidapi.h>
#include "RGBController.h"
class HyperXOrigins2_65Controller
{
public:
HyperXOrigins2_65Controller(hid_device* dev_handle, const char* path, std::string dev_name);
~HyperXOrigins2_65Controller();
std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
void SetLEDsDirect(std::vector<RGBColor> colors);
private:
hid_device* dev;
std::string location;
std::string name;
void SendDirectInitialization();
void SendDirectColorPacket
(
RGBColor* color_data,
unsigned int color_count,
unsigned int seq
);
};
@@ -1,234 +0,0 @@
/*---------------------------------------------------------*\
| RGBController_HyperXOrigins2_65.cpp |
| |
| RGBController for HyperX Origins 2 65 keyboard |
| |
| Ricardo Amorim 28 Mar 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_HyperXOrigins2_65.h"
using namespace std::chrono_literals;
//0xFFFFFFFF indicates an unused entry in matrix
#define NA 0xFFFFFFFF
static unsigned int matrix_map[5][15] =
{ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
{ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, NA, 29 },
{ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },
{ 45, 61, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59 },
{ 60, 62, 63, 65, NA, NA, 66, NA, NA, 68, 69, 70, 71, 72, 73 } };
static const char* zone_names[] =
{
ZONE_EN_KEYBOARD,
};
static zone_type zone_types[] =
{
ZONE_TYPE_MATRIX,
};
static const unsigned int zone_sizes[] =
{
74,
};
static const char *led_names[] =
{
KEY_EN_ESCAPE,
KEY_EN_1,
KEY_EN_2,
KEY_EN_3,
KEY_EN_4,
KEY_EN_5,
KEY_EN_6,
KEY_EN_7,
KEY_EN_8,
KEY_EN_9,
KEY_EN_0,
KEY_EN_MINUS,
KEY_EN_EQUALS,
KEY_EN_BACKSPACE,
KEY_EN_DELETE,
KEY_EN_TAB,
KEY_EN_Q,
KEY_EN_W,
KEY_EN_E,
KEY_EN_R,
KEY_EN_T,
KEY_EN_Y,
KEY_EN_U,
KEY_EN_I,
KEY_EN_O,
KEY_EN_P,
KEY_EN_LEFT_BRACKET,
KEY_EN_RIGHT_BRACKET,
KEY_EN_UNUSED,
KEY_EN_HOME,
KEY_EN_CAPS_LOCK,
KEY_EN_A,
KEY_EN_S,
KEY_EN_D,
KEY_EN_F,
KEY_EN_G,
KEY_EN_H,
KEY_EN_J,
KEY_EN_K,
KEY_EN_L,
KEY_EN_SEMICOLON,
KEY_EN_QUOTE,
KEY_EN_POUND,
KEY_EN_ISO_ENTER,
KEY_EN_PAGE_UP,
KEY_EN_LEFT_SHIFT,
KEY_EN_Z,
KEY_EN_X,
KEY_EN_C,
KEY_EN_V,
KEY_EN_B,
KEY_EN_N,
KEY_EN_M,
KEY_EN_COMMA,
KEY_EN_PERIOD,
KEY_EN_FORWARD_SLASH,
KEY_EN_RIGHT_SHIFT,
KEY_EN_UP_ARROW,
KEY_EN_UNUSED,
KEY_EN_PAGE_DOWN,
KEY_EN_LEFT_CONTROL,
KEY_EN_ISO_BACK_SLASH,
KEY_EN_LEFT_WINDOWS,
KEY_EN_LEFT_ALT,
KEY_EN_UNUSED,
"Left Space",
KEY_EN_SPACE,
"Right Space",
KEY_EN_UNUSED,
KEY_EN_RIGHT_ALT,
KEY_EN_RIGHT_FUNCTION,
KEY_EN_LEFT_ARROW,
KEY_EN_DOWN_ARROW,
KEY_EN_RIGHT_ARROW
};
/**------------------------------------------------------------------*\
@name HyperX Origins 2 65
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectHyperXOrigins2_65
@comment
\*-------------------------------------------------------------------*/
RGBController_HyperXOrigins2_65::RGBController_HyperXOrigins2_65(HyperXOrigins2_65Controller* controller_ptr)
{
controller = controller_ptr;
name = controller->GetNameString();
vendor = "HyperX";
type = DEVICE_TYPE_KEYBOARD;
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0xFFFF;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
keepalive_thread_run = 1;
keepalive_thread = new std::thread(&RGBController_HyperXOrigins2_65::KeepaliveThread, this);
}
RGBController_HyperXOrigins2_65::~RGBController_HyperXOrigins2_65()
{
Shutdown();
keepalive_thread_run = 0;
keepalive_thread->join();
delete keepalive_thread;
delete controller;
}
void RGBController_HyperXOrigins2_65::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
unsigned int total_led_count = 0;
for(unsigned int zone_idx = 0; zone_idx < 1; zone_idx++)
{
zone new_zone;
new_zone.name = zone_names[zone_idx];
new_zone.type = zone_types[zone_idx];
new_zone.leds_min = zone_sizes[zone_idx];
new_zone.leds_max = zone_sizes[zone_idx];
new_zone.leds_count = zone_sizes[zone_idx];
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
{
new_zone.matrix_map.Set(5, 15, (unsigned int *)&matrix_map);
}
zones.push_back(new_zone);
total_led_count += zone_sizes[zone_idx];
}
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
{
led new_led;
new_led.name = led_names[led_idx];
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_HyperXOrigins2_65::DeviceUpdateLEDs()
{
controller->SetLEDsDirect(colors);
}
void RGBController_HyperXOrigins2_65::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_HyperXOrigins2_65::DeviceUpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_HyperXOrigins2_65::DeviceUpdateMode()
{
}
void RGBController_HyperXOrigins2_65::KeepaliveThread()
{
while(keepalive_thread_run.load())
{
if(active_mode == 0)
{
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(50))
{
UpdateLEDs();
}
}
std::this_thread::sleep_for(10ms);;
}
}
@@ -1,40 +0,0 @@
/*---------------------------------------------------------*\
| RGBController_HyperXOrigins2_65.h |
| |
| RGBController for HyperX Origins 2 65 keyboard |
| |
| Ricardo Amorim 28 Mar 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <chrono>
#include "RGBController.h"
#include "HyperXOrigins2_65Controller.h"
class RGBController_HyperXOrigins2_65 : public RGBController
{
public:
RGBController_HyperXOrigins2_65(HyperXOrigins2_65Controller* controller_ptr);
~RGBController_HyperXOrigins2_65();
void SetupZones();
void DeviceUpdateLEDs();
void DeviceUpdateZoneLEDs(int zone);
void DeviceUpdateSingleLED(int led);
void DeviceUpdateMode();
void KeepaliveThread();
private:
HyperXOrigins2_65Controller* controller;
std::thread* keepalive_thread;
std::atomic<bool> keepalive_thread_run;
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
};
@@ -10,9 +10,8 @@
\*---------------------------------------------------------*/
#include <cstdint>
#include <nlohmann/json.hpp>
#include "JsonUtils.h"
#include "KasaSmartController.h"
#include <nlohmann/json.hpp>
#include "hsv.h"
using json = nlohmann::json;
@@ -65,7 +64,11 @@ bool KasaSmartController::Initialize()
}
json system_information;
if(!JsonUtils::JsonParse(system_info_json, system_information))
try
{
system_information = json::parse(system_info_json);
}
catch (json::parse_error&)
{
/*-----------------------*\
| Can't parse system info |
@@ -28,7 +28,7 @@ KingstonFuryDRAMController::KingstonFuryDRAMController(i2c_smbus_interface* bus,
std::string KingstonFuryDRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
return_string.append(", addresses [");
for(std::size_t idx = 0; idx < slots.size(); idx++)
{
@@ -104,7 +104,7 @@ void LEDStripController::InitializeI2C(char* i2cname)
{
for(unsigned int i2c_idx = 0; i2c_idx < ResourceManager::get()->GetI2CBuses().size(); i2c_idx++)
{
if(ResourceManager::get()->GetI2CBuses()[i2c_idx]->info.device_name == std::string(i2cname))
if(ResourceManager::get()->GetI2CBuses()[i2c_idx]->device_name == std::string(i2cname))
{
if(i2c_addr < 128)
{
@@ -155,7 +155,7 @@ std::string LEDStripController::GetLocation()
}
else if(i2cport != NULL)
{
return("I2C: " + std::string(i2cport->info.device_name) + ", Address " + std::to_string(i2c_addr));
return("I2C: " + std::string(i2cport->device_name) + ", Address " + std::to_string(i2c_addr));
}
else
{
@@ -74,7 +74,7 @@ RGBController_LenovoUSB::RGBController_LenovoUSB(LenovoUSBController* controller
type = DEVICE_TYPE_KEYBOARD;
vendor = "Lenovo";
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
if(LogManager::get()->getLoglevel() >= LL_TRACE)
{
DumpControllerInformation();
}
@@ -172,7 +172,7 @@ void logitech_device::initialiseDevice()
| If this is running with DEBUG or higher loglevel then |
| dump the entire Feature list to log |
\*-----------------------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_DEBUG)
if(LogManager::get()->getLoglevel() > 4)
{
getDeviceFeatureList(); //This will populate the feature list
}
@@ -24,7 +24,7 @@ MSIGPUController::~MSIGPUController()
std::string MSIGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -18,7 +18,7 @@ DetectedControllers DetectMSIGPUControllers(i2c_smbus_interface* bus, uint8_t i2
{
DetectedControllers detected_controllers;
if((bus->info.pci_vendor != NVIDIA_VEN || bus->info.port_id == 1) && (bus->info.pci_vendor != AMD_GPU_VEN || is_amd_gpu_i2c_bus(bus)))
if((bus->pci_vendor != NVIDIA_VEN || bus->port_id == 1) && (bus->pci_vendor != AMD_GPU_VEN || is_amd_gpu_i2c_bus(bus)))
{
MSIGPUController* controller = new MSIGPUController(bus, i2c_addr, name);
RGBController_MSIGPU* rgb_controller = new RGBController_MSIGPU(controller);
@@ -29,7 +29,7 @@ MSIGPUv2Controller::~MSIGPUv2Controller()
std::string MSIGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -19,9 +19,9 @@ DetectedControllers DetectMSIGPUv2Controllers(i2c_smbus_interface* bus, uint8_t
{
DetectedControllers detected_controllers;
if(bus->info.pci_vendor != NVIDIA_VEN || bus->info.port_id == 1)
if(bus->pci_vendor != NVIDIA_VEN || bus->port_id == 1)
{
int msi_gpu_id = bus->info.pci_subsystem_device | bus->info.pci_device << 16;
int msi_gpu_id = bus->pci_subsystem_device | bus->pci_device << 16;
MSIGPUv2Controller* controller = new MSIGPUv2Controller(bus, i2c_addr, name);
RGBController_MSIGPUv2* rgb_controller = new RGBController_MSIGPUv2(controller, msi_gpu_id);
@@ -62,13 +62,11 @@ REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 4090 Gaming X Trio",
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 4090 Gaming X Slim", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, MSI_SUB_VEN, MSI_RTX4090_GAMING_X_SLIM_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 4090 Suprim Liquid X", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, MSI_SUB_VEN, MSI_RTX4090_SUPRIM_LIQUID_X_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 4090 Suprim X", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, MSI_SUB_VEN, MSI_RTX4090_SUPRIM_X_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5070 Gaming Trio", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, MSI_SUB_VEN, MSI_RTX5070_GAMING_TRIO_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5070 Ti Gaming Trio OC Plus", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, MSI_SUB_VEN, MSI_RTX5070TI_GAMING_TRIO_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5070 Ti VANGUARD SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, MSI_SUB_VEN, MSI_RTX5070TI_VANGUARD_SOC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5080 Gaming Trio OC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, MSI_SUB_VEN, MSI_RTX5080_GAMING_TRIO_OC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5080 VANGUARD OC SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, MSI_SUB_VEN, MSI_RTX5080_VANGUARD_SOC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5080 SUPRIM SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, MSI_SUB_VEN, MSI_RTX5080_SUPRIM_SOC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5080 SUPRIM LIQUID SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, MSI_SUB_VEN, MSI_RTX5080_SUPRIM_LIQUID_SOC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5090 Gaming Trio OC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, MSI_SUB_VEN, MSI_RTX5090_GAMING_TRIO_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5090 VANGUARD SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, MSI_SUB_VEN, MSI_RTX5090_VANGUARD_SOC_SUB_DEV, 0x68);
REGISTER_I2C_PCI_DETECTOR("MSI GeForce RTX 5090 SUPRIM SOC", DetectMSIGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, MSI_SUB_VEN, MSI_RTX5090_SUPRIM_SOC_SUB_DEV, 0x68);
@@ -478,7 +478,7 @@ void RGBController_MSIMysticLight185::GetDeviceConfig()
if(zones[i].colors != nullptr)
{
for(size_t j = 0; j < LEDsInZone((unsigned int)i); ++j)
for(size_t j = 0; j < GetLEDsInZone((unsigned int)i); ++j)
{
zones[i].colors[j] = color;
}
@@ -67,10 +67,7 @@ static const std::string board_names[] =
"MSI MAG B850 TOMAHAWK MAX WIFI (MS-7E62)",
"MSI PRO B850M-P WIFI (MS-7E71)",
"MSI MAG Z890 TOMAHAWK WIFI (MS-7E32)",
"MSI MPG B850 EDGE TI WIFI (MS-7E62)",
"MSI PRO B850M-VC WIFI6E (MS-7E71)",
"MSI MAG B850 TOMAHAWK WIFI (MS-7E53)",
"MSI MEG Z890 UNIFY-X (MS-7E20)",
"MSI MPG B850 EDGE TI WIFI (MS-7E62)"
};
static const mystic_light_761_config board_configs[] =
@@ -96,9 +93,6 @@ static const mystic_light_761_config board_configs[] =
{ &(board_names[18]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI PRO B850M-P WIFI (MS-7E71)
{ &(board_names[19]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MAG Z890 TOMAHAWK WIFI (MS-7E32)
{ &(board_names[20]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MPG B850 EDGE TI WIFI (MS-7E62)
{ &(board_names[21]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI PRO B850M-VC WIFI6E (MS-7E71)
{ &(board_names[22]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MAG B850 TOMAHAWK WIFI (MS-7E53)
{ &(board_names[23]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MEG Z890 UNIFY-X (MS-7E20)
};
enum MSI_ZONE setup_map [] =
@@ -414,7 +414,7 @@ void RGBController_MSIMysticLight761::GetDeviceConfig()
if(zones[i].colors != nullptr)
{
for(size_t j = 0; j < LEDsInZone((unsigned int)i); ++j)
for(size_t j = 0; j < GetLEDsInZone((unsigned int)i); ++j)
{
zones[i].colors[j] = color;
}
@@ -244,7 +244,6 @@ REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E80", DetectMSIMysticLightCont
REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E81", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E81, 0x0001, 0x00);
REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E34", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E34, 0x0001, 0x00);
REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E32", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E32, 0x0001, 0x00);
REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E20", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E20, 0x0001, 0x00);
// Detector for the set of common boards
REGISTER_HID_DETECTOR_PU("MSI Mystic Light Common", DetectMSIMysticLightControllers, MSI_USB_VID_COMMON, MSI_USB_PID_COMMON, 0x0001, 0x00);
REGISTER_HID_DETECTOR_PU("MSI Mystic Light X870", DetectMSIMysticLightControllers, MSI_USB_VID_COMMON, MSI_USB_PID_COMMON, 0xFF00, 0x01);
@@ -30,7 +30,7 @@ ManliGPUController::~ManliGPUController()
std::string ManliGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -12,7 +12,6 @@
#include "NanoleafController.h"
#include "LogManager.h"
#include "httplib.h"
#include "JsonUtils.h"
long APIRequest(std::string method, std::string location, std::string URI, json* request_data = nullptr, json* response_data = nullptr)
{
@@ -92,7 +91,7 @@ long APIRequest(std::string method, std::string location, std::string URI, json*
{
if(response_data)
{
JsonUtils::JsonParse(body, *response_data);
*response_data = json::parse(body);
}
}
else
@@ -27,7 +27,7 @@ PNYARGBEpicXGPUController::~PNYARGBEpicXGPUController()
std::string PNYARGBEpicXGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", i2c_addr);
return_string.append(", address ");
@@ -21,7 +21,7 @@ DetectedControllers DetectPNYARGBEpicXGPUSmallControllers(i2c_smbus_interface* b
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
PNYARGBEpicXGPUController* controller = new PNYARGBEpicXGPUController(bus, i2c_addr, name, false);
RGBController_PNYARGBEpicXGPU* rgb_controller = new RGBController_PNYARGBEpicXGPU(controller);
@@ -36,7 +36,7 @@ DetectedControllers DetectPNYARGBEpicXGPULargeControllers(i2c_smbus_interface* b
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
PNYARGBEpicXGPUController* controller = new PNYARGBEpicXGPUController(bus, i2c_addr, name, true);
RGBController_PNYARGBEpicXGPU* rgb_controller = new RGBController_PNYARGBEpicXGPU(controller);
@@ -47,7 +47,6 @@ DetectedControllers DetectPNYARGBEpicXGPULargeControllers(i2c_smbus_interface* b
return(detected_controllers);
}
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5060Ti ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, PNY_SUB_VEN, PNY_RTX_5060TI_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5070 ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, PNY_SUB_VEN, PNY_RTX_5070_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5070Ti ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PNY_SUB_VEN, PNY_RTX_5070TI_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5080 ARGB Epic-X OC", DetectPNYARGBEpicXGPULargeControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PNY_SUB_VEN, PNY_RTX_5080_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
@@ -30,7 +30,7 @@ std::string PNYGPUController::GetDeviceName()
std::string PNYGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -19,7 +19,7 @@ DetectedControllers DetectPNYGPUControllers(i2c_smbus_interface* bus, uint8_t i2
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
PNYGPUController* controller = new PNYGPUController(bus, i2c_addr, name);
RGBController_PNYGPU* rgb_controller = new RGBController_PNYGPU(controller);
@@ -25,7 +25,7 @@ PNYLovelaceGPUController::~PNYLovelaceGPUController()
std::string PNYLovelaceGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -19,7 +19,7 @@ DetectedControllers DetectPNYLovelaceGPUControllers(i2c_smbus_interface* bus, ui
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
PNYLovelaceGPUController* controller = new PNYLovelaceGPUController(bus, i2c_addr, name);
RGBController_PNYLovelaceGPU* rgb_controller = new RGBController_PNYLovelaceGPU(controller);
@@ -25,7 +25,7 @@ PalitGPUController::~PalitGPUController()
std::string PalitGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -21,7 +21,7 @@ DetectedControllers DetectPalitGPUControllers(i2c_smbus_interface* bus, uint8_t
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
/*-----------------------------------------------------*\
| Check for PALIT string |
@@ -46,7 +46,7 @@ std::string PatriotViperController::GetDeviceName()
std::string PatriotViperController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -45,7 +45,7 @@ DetectedControllers DetectPatriotViperControllers(i2c_smbus_interface* bus, std:
/*-----------------------------------------------------*\
| Check for Patriot Viper controller at 0x77 |
\*-----------------------------------------------------*/
LOG_DEBUG("[%s] Testing bus %d at address 0x77", PATRIOT_CONTROLLER_NAME, bus->info.port_id);
LOG_DEBUG("[%s] Testing bus %d at address 0x77", PATRIOT_CONTROLLER_NAME, bus->port_id);
if(TestForPatriotViperController(bus, 0x77))
{
@@ -31,7 +31,7 @@ std::string PatriotViperSteelController::GetDeviceName()
std::string PatriotViperSteelController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -43,7 +43,7 @@ DetectedControllers DetectPatriotViperSteelControllers(i2c_smbus_interface* bus,
/*-----------------------------------------------------*\
| Check for Patriot Viper controller at 0x77 |
\*-----------------------------------------------------*/
LOG_DEBUG("[%s] Testing bus %d at address 0x77", PATRIOT_CONTROLLER_NAME, bus->info.port_id);
LOG_DEBUG("[%s] Testing bus %d at address 0x77", PATRIOT_CONTROLLER_NAME, bus->port_id);
if(TestForPatriotViperSteelController(bus, 0x77))
{
@@ -9,9 +9,8 @@
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <nlohmann/json.hpp>
#include "JsonUtils.h"
#include "PhilipsWizController.h"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace std::chrono_literals;
@@ -195,8 +194,7 @@ void PhilipsWizController::ReceiveThreadFunction()
/*-----------------------------------------------------------------*\
| Convert null-terminated response to JSON |
\*-----------------------------------------------------------------*/
json response;
JsonUtils::JsonParse(recv_buf, response);
json response = json::parse(recv_buf);
/*-----------------------------------------------------------------*\
| Check if the response contains the method name |
@@ -20,7 +20,7 @@ PowerColorRedDevilV1Controller::PowerColorRedDevilV1Controller(i2c_smbus_interfa
this->dev = dev;
this->name = dev_name;
if(bus->info.pci_device > AMD_NAVI10_DEV) // Only Navi 2 cards have this mode
if(bus->pci_device > AMD_NAVI10_DEV) // Only Navi 2 cards have this mode
{
this->has_sync_mode = true;
}
@@ -33,7 +33,7 @@ PowerColorRedDevilV1Controller::~PowerColorRedDevilV1Controller()
std::string PowerColorRedDevilV1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -27,7 +27,7 @@ PowerColorRedDevilV2Controller::~PowerColorRedDevilV2Controller()
std::string PowerColorRedDevilV2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -164,4 +164,4 @@ int PowerColorRedDevilV2Controller::RegisterWrite(unsigned char reg, unsigned ch
int ret = bus->i2c_smbus_write_i2c_block_data(dev, reg, 3, data);
std::this_thread::sleep_for(std::chrono::milliseconds(50));
return ret;
}
}
@@ -27,7 +27,7 @@ enum
bool TestForSapphireGPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -25,7 +25,7 @@ SapphireNitroGlowV1Controller::~SapphireNitroGlowV1Controller()
std::string SapphireNitroGlowV1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -25,7 +25,7 @@ SapphireNitroGlowV3Controller::~SapphireNitroGlowV3Controller()
std::string SapphireNitroGlowV3Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -25,7 +25,7 @@ TForceXtreemController::~TForceXtreemController()
std::string TForceXtreemController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -29,7 +29,7 @@ ZotacBlackwellGPUController::~ZotacBlackwellGPUController()
std::string ZotacBlackwellGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");

Some files were not shown because too many files have changed in this diff Show More