Files
OpenRGB/Controllers/DRGBController/DRGBController.h
Adam Honse 02b9f3b299 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-03 16:22:50 -05:00

59 lines
2.2 KiB
C++

/*---------------------------------------------------------*\
| DRGBController.h |
| |
| Driver for DRGBmods |
| |
| Zhi Yan 25 Jun 2024 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <chrono>
#include <vector>
#include <hidapi.h>
#include "DRGBDevices.h"
#include "RGBController.h"
#define DRGB_V4_ONE_PACKAGE_SIZE 316
#define DRGB_V4_PACKAGE_SIZE 340
#define DRGB_V3_PACKAGE_SIZE 21
#define DRGB_V2_PACKAGE_SIZE 20
class DRGBController
{
public:
DRGBController(hid_device* dev_handle, const char* path, unsigned short pid, std::string dev_name);
~DRGBController();
std::string GetFirmwareString();
std::string GetLocationString();
std::string GetNameString();
std::string GetSerialString();
unsigned short GetDevicePID();
unsigned char GetNumChannels();
unsigned short GetLEDsPerChannel();
unsigned short GetVersion();
std::string GetChannelName(unsigned char channel);
void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors);
void SendPacket(unsigned char* colors, unsigned int buf_packets, unsigned int LEDtotal);
void SendPacketFS(unsigned char* colors, unsigned int buf_packets, unsigned int Array);
void KeepaliveThread();
private:
hid_device* dev;
std::string location;
std::string name;
std::thread* keepalive_thread;
std::atomic<bool> keepalive_thread_run;
std::chrono::time_point<std::chrono::steady_clock> last_commit_time;
unsigned char version[4] = {0, 0, 0,0};
unsigned int device_index;
};