mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-02 04:07:48 -05:00
71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
/*-----------------------------------------*\
|
|
| RedragonM711Controller.h |
|
|
| |
|
|
| Definitions and types for Redragon M711 |
|
|
| Cobra mouse lighting controller |
|
|
| |
|
|
| Adam Honse (CalcProgrammer1) 3/15/2020 |
|
|
\*-----------------------------------------*/
|
|
|
|
#include "RGBController.h"
|
|
|
|
#include <string>
|
|
#include <hidapi/hidapi.h>
|
|
|
|
#pragma once
|
|
|
|
enum
|
|
{
|
|
REDRAGON_M711_MODE_WAVE = 0x00,
|
|
REDRAGON_M711_MODE_RANDOM_BREATHING = 0x01,
|
|
REDRAGON_M711_MODE_STATIC = 0x02,
|
|
REDRAGON_M711_MODE_BREATHING = 0x04,
|
|
REDRAGON_M711_MODE_RAINBOW = 0x08,
|
|
REDRAGON_M711_MODE_FLASHING = 0x10,
|
|
};
|
|
|
|
class RedragonM711Controller
|
|
{
|
|
public:
|
|
RedragonM711Controller(hid_device* dev_handle, const char* path);
|
|
~RedragonM711Controller();
|
|
|
|
std::string GetDeviceLocation();
|
|
std::string GetSerialString();
|
|
|
|
void SendMouseApply();
|
|
|
|
void SendMouseColor
|
|
(
|
|
unsigned char red,
|
|
unsigned char green,
|
|
unsigned char blue
|
|
);
|
|
|
|
void SendMouseMode
|
|
(
|
|
unsigned char mode,
|
|
unsigned char speed
|
|
);
|
|
|
|
void SendMouseMode
|
|
(
|
|
unsigned char mode,
|
|
unsigned char speed,
|
|
unsigned char red,
|
|
unsigned char green,
|
|
unsigned char blue
|
|
);
|
|
|
|
private:
|
|
hid_device* dev;
|
|
std::string location;
|
|
|
|
void SendWritePacket
|
|
(
|
|
unsigned short address,
|
|
unsigned char data_size,
|
|
unsigned char * data
|
|
);
|
|
};
|