Commit Graph
124 Commits
Author SHA1 Message Date
Adam Honse dc0e9b2fd3 SDK6 PROTOCOL CHANGE: Update missing timestamp field to Log Message packet on server side, type is actually 32-bit so update documentation, fix issue where log console was enabled based on local settings rather than remote settings 2026-08-28 19:00:10 -05:00
Mathias Grün-Drebes d9a726d97f Fix skip_generic_detectors scope and a headless-server plugin-list crash 2026-08-27 07:41:58 -05:00
Adam Honse 5c8baf47f8 Add missing condition in per-zone mode sanity check to handle active mode -1 (follow device mode) 2026-08-26 20:16:33 -05:00
Adam Honse f9897ef99a Implement settings schema filtering
* Filter settings that have a registered schema so that only keys matching the schema get saved
  * Allow settings that do not have a registered schema (manually added devices, device-specific, plugins, client)
  * Update schema registration to allow marking a settings group as local only, which means it modifies the local instance's settings, not the remote
  * Deny setting local only settings when the update comes from the network server
2026-08-15 17:41:29 -05:00
Adam Honse 1fb75b66dd Limit maximum SDK packet size to 8MB 2026-08-12 18:17:51 -05:00
Adam Honse 2e09228568 SDK6 PROTOCOL CHANGE: Add client and server hostname set packets 2026-08-04 11:52:54 -05:00
Diogo Trindade c7140baa33 Fix device IDs in worker thread acknowledgements 2026-08-01 18:56:59 +01:00
Adam Honse 8be6aba43a SDK6 PROTOCOL CHANGE - Change from 32-bit to 16-bit device/bus/port count size on the device info network packets for consistency with other array packets 2026-07-31 11:45:51 -05:00
Adam Honse 578c81784b Fixups around hiding/unhiding controllers, create a new function that only handles showing and hiding for SignalUpdate callbacks, fix pointer dereference in NetworkServer, fix same-thread method invoke 2026-07-30 18:49:06 -05:00
Ken Sanislo 52138b4cbd NetworkServer: initialize profilemanager_thread
StopServer guards the pointer and nulls it after the delete, but
nothing ever set it, so destroying a server that never started read an
uninitialized pointer.
2026-07-29 11:25:06 -05:00
Ken Sanislo b3a2cccfed NetworkServer: per-client send thread for SignalUpdate notifications
RGBController_UpdateCallback sent the SignalUpdate packet synchronously
via SendRequest_RGBController_SignalUpdate, which runs inside
RGBController::SignalUpdate. A blocking send there (slow client) keeps
SignalCalls > 0, so WaitSignalCalls -- the callback drain that
Unregister/ClearCallbacks/Shutdown run while tearing callbacks down on a
rescan -- waits forever. That is the client/server rescan deadlock.

Each client now owns an outbound queue and a dedicated send thread. The
signal path builds the packet (brief AccessMutex, as before) and queues
it; the client's own thread does the blocking send. A slow client backs
up only its own queue and blocks only its own thread, so the signal path
and the callback drain are never blocked.

UPDATELEDS packets coalesce per controller (a newer frame replaces the
pending one), so a stalled client's queue stays bounded to one packet
per controller instead of growing without bound; non-coalescable events
fall back to a hard cap with drop-oldest. The client destructor stops
the thread with shutdown(SD_BOTH), which unblocks an in-flight send, so
the join at teardown cannot hang. A queue entry owns its packet header
and data buffer; the send thread frees the buffer after the send, so
there is no copy and the packet outlives the controller safely.

Follow-up: the send still takes the shared send_in_progress, so a slow
client can still stall sends to others; routing response sends through
the same per-client path would make that a per-client lock.

net_port: add SD_BOTH (SHUT_RDWR) for the POSIX socket shims.
2026-07-29 11:25:06 -05:00
isJuhn 3b2466ba10 Fix use after free in NetworkClient and NetworkServer 2026-07-26 22:03:43 -05:00
Eder Sanchez 33ec03d129 NetworkServer: reject SDK index == element count (off-by-one)
The SDK LED/zone update handlers checked the client-supplied index with '>'
instead of '>=', so an index equal to the element count passed the check and
reached an out-of-bounds access:

- UpdateSingleLED: out-of-bounds write to colors[led_idx]
- UpdateZoneLEDs / UpdateZoneMode: out-of-bounds read/write on zones[zone_idx]

UpdateMode had the same off-by-one (currently harmless due to a later check),
fixed for consistency. The num_colors check stays '>' since num_colors ==
leds_count is a valid "all LEDs" request.
2026-07-10 14:44:44 -05:00
Adam Honse a122ccdc37 Add network packet for requesting USB serial ports 2026-07-07 21:00:46 -05:00
Adam Honse 86a6a130e7 Add network packet for getting list of serial ports 2026-07-07 17:13:59 -05:00
Adam Honse d9b51e4a02 Update SDK documentation and add a server flag to indicate if the server supports the device info requests 2026-07-07 17:13:45 -05:00
Adam Honse 387fed4f79 Add network request for requesting list of USB devices in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse df0137c2b0 Add network request for requesting list of HID devices in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse 7c059fa3e3 Fix RGBController callback registration in NetworkServer 2026-07-07 01:35:35 -05:00
Adam Honse 962754f379 Perform validity checking on received modes when UpdateMode/UpdateZoneMode/SaveMode are called from a network client 2026-07-07 01:35:35 -05:00
Adam Honse 9182d1e566 Add ConfigureDevice and the ability to configure device name 2026-07-07 01:35:35 -05:00
Adam Honse 893de3f076 Add SetHidden SDK packet 2026-07-07 01:35:35 -05:00
Adam Honse 7846d22bd8 Add another thread in NetworkClient for handling ProfileManager requests outside of the main listener thread, to avoid deadlocking the waiting receivers 2026-07-07 01:35:35 -05:00
Adam Honse 152f16b31c NetworkServer cleanup and internal API standardization 2026-07-07 01:35:35 -05:00
Adam Honse 831a7cf5eb Implement network request to get list of I2C buses so that the Get Hardware IDs dialog works in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse 00077347b4 Log manager SDK protocol 2026-07-07 01:35:35 -05:00
Adam Honse 103b5f27bb Settings Rework
* Add JSON string configuration field to RGBController to store device-specific configurations
    * This JSON string holds both configuration and schema
    * Add settings schema tracking to SettingsManager
    * Implement dynamic settings widget that generates a settings UI based on a JSON schema
    * Implement SettingsManager callback for notifying of settings changes and settings schema updates
    * Always enable Entire Device zone option and use it to enable Edit Device
    * Rename SaveSizes to SaveConfiguration in ProfileManager and Sizes.json to Configuration.json
    * Add zone flag for indicating that a zone's geometry may change, informing profile manager to ignore this check
    * Remove Theme setting and Theme Manager, as this didn't work on most setups anyways and Qt6 has proper Windows dark theming
2026-07-07 01:35:35 -05:00
Adam Honse 60bc375345 Close SDK connection if magic value is not correctly received 2026-07-07 01:35:35 -05:00
Adam Honse 5a2dca1ced Implement size verification on RGBController set description functions 2026-07-07 01:35:35 -05:00
Adam Honse c80f3be283 Clean up zone initialization dialog 2026-07-07 01:35:35 -05:00
Adam Honse 52f757ced2 Require local client permission for DeleteProfile, SaveProfile, UploadProfile, SetSettings, and SaveSettings operations, some general cleanup 2026-07-07 01:35:35 -05:00
Adam Honse 8c96bf03f5 Add ACK to network packets processed by NetworkServer 2026-07-07 01:35:34 -05:00
Adam Honse a306cf815b 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-07-07 01:35:34 -05:00
Adam Honse 5d20744653 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-07-07 01:35:34 -05:00
Adam Honse 35f10dfb48 [next] Active profile tracking 2026-07-07 01:35:34 -05:00
Adam Honse 04ef7a2c28 Apply profiles server-side rather than client-side, signal active profile update, forward loaded profile to local client for plugins 2026-07-07 01:35:34 -05:00
Adam Honse 3a74c85be8 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-07-07 01:35:34 -05:00
Adam Honse 112b6a2b9b [next] SDK v6: Implement client and server flags to indicate capabilities and... 2026-07-07 01:35:34 -05:00
Adam Honse b7f68379c2 Update NetworkClient to use log manager and use common name constant in server logs 2026-07-07 01:35:34 -05:00
Adam Honse 43c0fea3be 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-07-07 01:35:34 -05:00
Adam Honse 3d113dab3c SDK v6: Use unique IDs for identifying RGBControllers in SDK protocol 2026-07-07 01:35:34 -05:00
Adam Honse 464ef419e7 Detection progress SDK integration, NetworkClient callback rework 2026-07-07 01:35:34 -05:00
Adam Honse b92a8996e9 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-07-07 01:35:34 -05:00
Adam Honse c887ea94ff 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-07-07 01:35:34 -05:00
Adam Honse a86ab2955a Move plugin SDK integration from callback into plugin API and PluginManager 2026-07-07 01:35:34 -05:00
Adam Honse d09c66900d Set TCP_QUICKACK on Linux to improve responsiveness when using client/service configuration 2026-01-06 00:23:52 -06:00
Egor Vorontsov 56b75aaffc Set SO_REUSEADDR on network sockets. 2025-12-16 06:24:30 +03:00
Adam Honse a6b890a48d Use ResourceManager::RescanDevices() to initiate a rescan in places where ResourceManager::DetectDevices() was still being used 2025-11-14 20:31:10 -06:00
Adam Honse c71cc4f18a Change SPDX license identifier from GPL 2.0 only to GPL 2.0 or later, as the original LICENSE file includes an or later clause at the end so the file headers were incorrect 2025-09-28 00:47:08 -05:00
Adam Honse df73d0263a Add send_in_progress locks around send groups in NetworkServer.cpp 2025-07-04 23:37:23 -05:00