Commit Graph
54 Commits
Author SHA1 Message Date
Adam Honse 2e09228568 SDK6 PROTOCOL CHANGE: Add client and server hostname set packets 2026-08-04 11:52:54 -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
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 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 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 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 5a2dca1ced Implement size verification on RGBController set description functions 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 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 112b6a2b9b [next] SDK v6: Implement client and server flags to indicate capabilities and... 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 a86ab2955a Move plugin SDK integration from callback into plugin API and PluginManager 2026-07-07 01:35:34 -05: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
Adam Honse 0cfe5ae0bb Add SDK command to rescan devices 2025-07-04 04:24:37 -05:00
Adam Honse 471f9d3e2e Add server option to disable the size check called legacy workaround, which can be enabled to allow some old SDK apps that didn't properly implement the size to still be used 2025-01-08 20:44:20 -06:00
Dmitry Kychanov b171906162 Fixed server 2024-10-05 02:47:02 +04:00
Adam Honse a7c400bc65 Update yet more file header comments to standardized new format 2024-05-03 21:56:32 -05:00
Jack 4baf19f13a SDK plugin control 2023-01-25 17:50:28 +00:00
B Horn 640eb7905c SDK Listening Options 2022-07-17 20:30:15 +00:00
k1-801 65623d3978 Autoclose updated
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-05-24 22:45:24 -05:00
k1-801 abfb6ea22d Tiny fixups (server conn info leak closed, log va leak closed, config dir optimized)
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-05-24 22:41:12 -05:00
k1-801 02ba8a799e Server freed from ResourceManager
Commit amended to revert OpenRGBInterfaces.h header (may reconsider in the future) by Adam Honse
<calcprogrammer1@gmail.com>
2021-05-13 22:10:41 -05:00
morg 79dacbaeb0 Fix crash on server stop
Commit amended to initialize listening variable by Adam Honse <calcprogrammer1@gmail.com>
2021-02-09 16:34:25 -06:00
morg e2bc1003e6 Add profile management to SDK
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-02-05 19:13:50 -06:00
Adam Honse 72da8f362c SDK protocol versioning implemented. Protocol updated to version 1 which adds vendor string to controller request. 2020-12-01 21:02:32 -06:00
k1-801 dde857dfb4 Tiny threads fixes & a little bit of safety 2020-11-15 13:28:29 -06:00
Adam Honse 60fd721586 Server sends a request to the client when the device list is updated 2020-09-27 22:12:34 +00:00
B Horn 47baeb6b6b Improving NetworkServer's memory management (#373)
This patch resolves several bugs:

* NetworkServer would allocate various instances of `NetworkClientInfo`.
  This is patched by deallocating the NetworkClientInfo when it's
  listening thread ends in the `listen_done` section.

* Memory would be allocated for threads that wouldn't be freed. This
  is resolved by detaching from the threads, so they no longer need to
  be joined to be freed, and then freeing the memory as they finish.

* Thread-Safety issues involving `ServerClients` would result in stray
  `NetworkClientInfo`'s not being removed from the list in certain
  situations. This is resolved by used a mutex to lock access to this
  from different threads.
2020-07-09 21:56:42 -05:00
Térence Clastres b79ff124e6 Replace Sleep() by std::thread::sleep_for() 2020-06-24 09:28:11 -05:00
Adam Honse 352b9928ca Add file headers to network files and some minor code cleanup 2020-05-09 15:48:16 -05:00
Adam Honse a5e9a3de05 Add mutex on updating callbacks 2020-05-09 15:48:15 -05:00
Adam Honse edf1b251c0 Send and receive client string 2020-05-09 15:48:15 -05:00
Adam Honse 9ff4314840 Add callback to NetworkServer to handle UI updates when client information changes 2020-05-09 15:48:15 -05:00
Adam Honse 3ad0986ae7 Add IP field to client information and display client IP in the server tab's connected client list 2020-05-09 15:48:15 -05:00
Adam Honse 6bfc9dd9db Create a structure to hold client information in the network server and fix i2c hanging on destructor when bus is not available. 2020-05-09 15:48:15 -05:00
Adam Honse 119741b736 Fix build on Windows 2020-05-09 15:48:15 -05:00
Adam Honse 2fe958783c Use select on accept call as well so that server closes on Linux 2020-05-09 15:48:15 -05:00
Adam Honse 9e44e4ba4f Add server information to user interface and provide buttons to start and stop server, change port 2020-05-09 15:48:15 -05:00