-
-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathNuPhyKeyboardController.h
More file actions
47 lines (39 loc) · 1.56 KB
/
Copy pathNuPhyKeyboardController.h
File metadata and controls
47 lines (39 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*---------------------------------------------------------*\
| NuPhyKeyboardController.h |
| |
| Driver for NuPhy QMK/VIA RGB Matrix keyboards |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <hidapi.h>
#include <string>
class NuPhyKeyboardController
{
public:
NuPhyKeyboardController(hid_device* dev_handle, const char* path, const std::string& device_name);
~NuPhyKeyboardController();
std::string GetLocation();
std::string GetName();
std::string GetSerial();
std::string GetVersion();
bool GetSupported();
unsigned char GetBrightness();
unsigned char GetEffect();
unsigned char GetSpeed();
void GetColor(unsigned char* hue, unsigned char* saturation);
void SetBrightness(unsigned char brightness);
void SetEffect(unsigned char effect);
void SetSpeed(unsigned char speed);
void SetColor(unsigned char hue, unsigned char saturation);
void Save();
private:
hid_device* dev;
std::string location;
std::string name;
std::string serial;
bool supported;
unsigned short via_protocol_version;
bool SendCommand(unsigned char command, unsigned char channel, unsigned char value_id, unsigned char* value, unsigned char value_size);
};