Files
OpenRGB/Controllers/HyperXMouseController/HyperXPulsefireDartController.h
Santeri Pikarinen e7e311d931 HyperX Pulsefire Dart: Various fixes, feature additions and clean up
* Fixed payload missing the Report ID (caused issues with Windows, issue #1069)
* Fixed an invalid usage page value for wired mode
* Fixed a potential memory leak when rescanning devices (issue #1007)
* Fixed an issue where multiple color changes were sent too fast
* Renamed "Trigger Fade" mode to the [standardized mode name](https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/Common-Modes#common-openrgb-modes) "Reactive"
* Added proper brightness control
* Added manual saving functionality
* Cleaned up some indentations
2021-08-02 01:15:07 +00:00

64 lines
2.0 KiB
C++

/*-------------------------------------------*\
| HyperXPulsefireDartController.h |
| |
| Definitions and types for HyperX |
| Pulsefire Dart lighting controller |
| |
| Santeri Pikarinen (santeri3700) 12/26/2020 |
\*-------------------------------------------*/
#include "RGBController.h"
#include <string>
#include <hidapi/hidapi.h>
#pragma once
enum
{
HYPERX_PULSEFIRE_DART_PACKET_ID_DIRECT = 0xd2, /* Direct control packet */
HYPERX_PULSEFIRE_DART_PACKET_SIZE = 65, /* Report ID padding + 64 byte payload */
HYPERX_PULSEFIRE_DART_MODE_STATIC = 0x00, /* Static color mode */
HYPERX_PULSEFIRE_DART_MODE_CYCLE = 0x12, /* Spectrum cycle mode */
HYPERX_PULSEFIRE_DART_MODE_BREATHING = 0x20, /* Single color breathing mode */
HYPERX_PULSEFIRE_DART_MODE_REACTIVE = 0x30, /* Reactive/Trigger fade mode */
HYPERX_PULSEFIRE_DART_SPEED_MIN = 0x64,
HYPERX_PULSEFIRE_DART_SPEED_MAX = 0x00,
HYPERX_PULSEFIRE_DART_SPEED_MED = 0x32,
HYPERX_PULSEFIRE_DART_SPEED_NONE = 0x00, /* For static color mode */
HYPERX_PULSEFIRE_DART_BRIGHTNESS_MIN = 0x00,
HYPERX_PULSEFIRE_DART_BRIGHTNESS_MAX = 0x64,
HYPERX_PULSEFIRE_DART_LED_LOGO = 0x00,
HYPERX_PULSEFIRE_DART_LED_SCROLL = 0x10,
HYPERX_PULSEFIRE_DART_LED_ALL = 0x20
};
class HyperXPulsefireDartController
{
public:
HyperXPulsefireDartController(hid_device* dev_handle, const char* path);
~HyperXPulsefireDartController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SendDirect
(
RGBColor color_data,
int led,
int mode,
int brightness,
int speed
);
void Save();
private:
hid_device* dev;
std::string location;
};