Commit Graph
103 Commits
Author SHA1 Message Date
Adam Honse 1fb75b66dd Limit maximum SDK packet size to 8MB 2026-08-12 18:17:51 -05:00
Adam Honse 71cd411ffc Fix active profile initialization during initial local client connection as well as local client reconnections 2026-08-05 01:20:06 -05:00
Adam Honse 1be9097852 Do not reinitialize client flags upon disconnect, this prevented local client from being re-requested upon local server restart 2026-08-05 00:25:38 -05:00
Adam Honse 2e09228568 SDK6 PROTOCOL CHANGE: Add client and server hostname set packets 2026-08-04 11:52:54 -05:00
Ken Sanislo 2a9889b194 NetworkClient: break the listener/GUI deadlock structurally 2026-08-01 11:16:20 -05: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 2dab17f5dc Error out if setting RGBController description parsing fails in NetworkClient 2026-07-30 19:14:49 -05:00
Ken Sanislo fb0e4f3ad9 Tear down lost and closed client connections safely
When a connection dropped, the listener thread deleted all of that
server's controllers immediately, before anything else was notified, so
the GUI, ResourceManager, and plugins kept dereferencing freed
controllers. Clicking Disconnect had the same problem and also ran the
teardown inline on the GUI thread, where UpdateDeviceList's
DEVICE_LIST_UPDATED is a BlockingQueuedConnection back to that thread,
so the device pages were not torn down before the controllers were
freed and a later queued onDetectionEnded dereferenced them.

Neither path frees controllers inline now. NetworkClient moves them to
an orphaned list and a dedicated teardown thread frees them: plugins
are warned first, then the same DETECTION_STARTED, UpdateDeviceList,
DETECTION_COMPLETE sequence a rescan runs tears down the device pages
that still reference the controllers, and only then are they freed, so
a controller always outlives its page. Both the connection-loss path
and the disconnect button queue to that thread, so the blocking handler
runs on the GUI thread while the controllers are still alive, and
StopClient's join stays off the GUI and listener threads.
2026-07-29 23:36:02 -07:00
Ken Sanislo 2687ff57aa NetworkClient: initialize client_active and profilemanager_thread
StopClient guards profilemanager_thread and nulls it after the delete,
but nothing ever set it, so destroying a client that never started
read an uninitialized pointer. client_active was unset until
StartClient and is read on the same path.
2026-07-29 11:25:06 -05:00
Adam Honse 358fc7b007 Implement a response queue to prevent a NetworkClient deadlock when multiple packets are waited on 2026-07-27 23:33:40 -05:00
isJuhn 3b2466ba10 Fix use after free in NetworkClient and NetworkServer 2026-07-26 22:03:43 -05:00
Adam Honse 21009cdc45 Don't send RGBController packets that are too new for the current protocol in NetworkClient 2026-07-11 14:20:43 -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 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 44641ca8a6 NetworkClient 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 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 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 92f397544b Rework list handling in ResourceManager by having NetworkClient own its own list rather than sharing ResourceManager's list 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 d09c66900d Set TCP_QUICKACK on Linux to improve responsiveness when using client/service configuration 2026-01-06 00:23:52 -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 2affb6d1e7 Add missing send_in_progress locks around send groups in NetworkClient.cpp 2025-07-04 23:32:16 -05:00
Adam Honse 4cc6a28e73 Rework NetworkClient server initialization to allow interruption and restarting of server list request process when server sends a device list updated notification 2025-07-04 04:24:37 -05:00
Adam Honse 5aaadf4e5a Require protocol version 5 to send rescan devices packet and to show rescan button in clients list 2025-07-04 04:24:37 -05:00
Adam Honse 80dee91ab9 Add client functionality to send rescan request and add rescan button for each client in client list 2025-07-04 04:24:37 -05:00
Adam Honse bb79fbfc07 Add controller flags field with flags for controller location and update behavior 2025-02-06 20:00:27 -06:00
Adam Honse 012cb5e62d Fix segment creation and modification over the network protocol 2025-02-06 20:00:27 -06:00
Adam Honse 9d3956c168 Fix warnings in NetworkClient.cpp 2024-11-26 00:37:30 -06:00
Adam Honse 8a36717842 Remove LogManager dependency from NetworkClient.cpp
NetworkClient/Server code should have minimal internal dependencies as it is intended to be includable in external applications, pulling in only the absolutely necessary files so that it may be used in third party SDK applications.  LogManager is not a necessary dependency.
2024-09-27 11:25:55 -05:00
Dmitry Kychanov d612b8b8de Network shutdown optimization 2024-09-27 16:15:14 +00:00
Adam Honse e2126b9d29 Fix resizing zones over the network 2024-07-27 17:56:12 -05:00