mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-07-13 14:51:43 -04:00
Get Keychron firmware version
This commit is contained in:
@@ -88,6 +88,11 @@ QMKKeychronController::QMKKeychronController(hid_device* dev_handle, const char
|
||||
\*-----------------------------------------------------*/
|
||||
CmdGetKeychronProtocolVersion(&kc_protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get Keychron firmware version |
|
||||
\*-----------------------------------------------------*/
|
||||
kc_firmware_version = CmdGetKeychronFirmwareVersion();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get supported Keychron features |
|
||||
\*-----------------------------------------------------*/
|
||||
@@ -172,7 +177,8 @@ std::string QMKKeychronController::GetVersion()
|
||||
\*-----------------------------------------------------*/
|
||||
return("VIA: " + std::to_string(via_protocol_version) + "\r\n" +
|
||||
"Keychron: " + std::to_string(kc_protocol_version) + "\r\n" +
|
||||
"Keychron RGB: " + std::to_string(kc_rgb_protocol_version));
|
||||
"Keychron RGB: " + std::to_string(kc_rgb_protocol_version) + "\r\n" +
|
||||
"Keychron FW: " + kc_firmware_version);
|
||||
}
|
||||
|
||||
bool QMKKeychronController::GetSupported()
|
||||
@@ -256,6 +262,21 @@ unsigned short QMKKeychronController::CmdGetKeycode
|
||||
return(keycode);
|
||||
}
|
||||
|
||||
|
||||
std::string QMKKeychronController::CmdGetKeychronFirmwareVersion()
|
||||
{
|
||||
char response[30];
|
||||
|
||||
ViaSendCommand(KC_GET_FIRMWARE_VERSION, NULL, 0, (unsigned char*)response, sizeof(response));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Ensure response null termination |
|
||||
\*-----------------------------------------------------*/
|
||||
response[29] = 0;
|
||||
|
||||
return(std::string(response));
|
||||
}
|
||||
|
||||
void QMKKeychronController::CmdGetKeychronProtocolVersion
|
||||
(
|
||||
unsigned char* kc_protocol_version
|
||||
|
||||
Reference in New Issue
Block a user