mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 01:06:11 +00:00
Expose SupportedKeyboards var in LedKeyboard class
This commit is contained in:
parent
2e5519260f
commit
ac8ce20fff
@ -21,15 +21,6 @@ LedKeyboard::~LedKeyboard() {
|
||||
}
|
||||
|
||||
|
||||
bool LedKeyboard::overrideKeyboard(uint16_t vendorID, uint16_t productID, KeyboardModel model) {
|
||||
if(model==KeyboardModel::unknown) return false;
|
||||
SupportedKeyboards = {
|
||||
{ vendorID, productID, (u_int16_t)model }
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
vector<LedKeyboard::DeviceInfo> LedKeyboard::listKeyboards() {
|
||||
vector<LedKeyboard::DeviceInfo> deviceList;
|
||||
|
||||
|
@ -16,17 +16,6 @@ class LedKeyboard {
|
||||
|
||||
private:
|
||||
|
||||
std::vector<std::vector<uint16_t>> SupportedKeyboards = {
|
||||
{ 0x46d, 0xc336, (u_int16_t)KeyboardModel::g213 },
|
||||
{ 0x46d, 0xc330, (u_int16_t)KeyboardModel::g410 },
|
||||
{ 0x46d, 0xc333, (u_int16_t)KeyboardModel::g610 },
|
||||
{ 0x46d, 0xc338, (u_int16_t)KeyboardModel::g610 },
|
||||
{ 0x46d, 0xc331, (u_int16_t)KeyboardModel::g810 },
|
||||
{ 0x46d, 0xc337, (u_int16_t)KeyboardModel::g810 },
|
||||
{ 0x46d, 0xc32b, (u_int16_t)KeyboardModel::g910 },
|
||||
{ 0x46d, 0xc335, (u_int16_t)KeyboardModel::g910 }
|
||||
};
|
||||
|
||||
enum class KeyAddressGroup : uint8_t {
|
||||
logo = 0x00,
|
||||
indicators,
|
||||
@ -38,6 +27,17 @@ class LedKeyboard {
|
||||
|
||||
public:
|
||||
|
||||
std::vector<std::vector<uint16_t>> SupportedKeyboards = {
|
||||
{ 0x46d, 0xc336, (u_int16_t)KeyboardModel::g213 },
|
||||
{ 0x46d, 0xc330, (u_int16_t)KeyboardModel::g410 },
|
||||
{ 0x46d, 0xc333, (u_int16_t)KeyboardModel::g610 },
|
||||
{ 0x46d, 0xc338, (u_int16_t)KeyboardModel::g610 },
|
||||
{ 0x46d, 0xc331, (u_int16_t)KeyboardModel::g810 },
|
||||
{ 0x46d, 0xc337, (u_int16_t)KeyboardModel::g810 },
|
||||
{ 0x46d, 0xc32b, (u_int16_t)KeyboardModel::g910 },
|
||||
{ 0x46d, 0xc335, (u_int16_t)KeyboardModel::g910 }
|
||||
};
|
||||
|
||||
enum class KeyboardModel : uint8_t {
|
||||
unknown = 0x00,
|
||||
g213,
|
||||
@ -134,8 +134,6 @@ class LedKeyboard {
|
||||
~LedKeyboard();
|
||||
|
||||
|
||||
bool overrideKeyboard(uint16_t vendorID, uint16_t productID, KeyboardModel model);
|
||||
|
||||
std::vector<DeviceInfo> listKeyboards();
|
||||
|
||||
bool isOpen();
|
||||
|
@ -283,13 +283,13 @@ int main(int argc, char **argv) {
|
||||
if (! utils::parseUInt8(argv[argIndex + 1], kbdProtocol)) return 1;
|
||||
switch(kbdProtocol) {
|
||||
case 1:
|
||||
kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g810);
|
||||
kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g810 } };
|
||||
break;
|
||||
case 2:
|
||||
kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g910);
|
||||
kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g910 } };
|
||||
break;
|
||||
case 3:
|
||||
kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g213);
|
||||
kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g213 } };
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user