mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
50 lines
1.0 KiB
Plaintext
50 lines
1.0 KiB
Plaintext
Ok so with the following code:
|
|
|
|
```cpp
|
|
bool errorCheck(const std::string &msg) {
|
|
auto error = CorsairGetLastError();
|
|
if (error != CorsairError::CE_Success) {
|
|
std::cerr << msg << " (Error: " << toString(error) << ')' << std::endl;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
CorsairPerformProtocolHandshake();
|
|
if (errorCheck("Handshake error")) {
|
|
getchar();
|
|
return -1;
|
|
}
|
|
|
|
const auto devicesCount = CorsairGetDeviceCount();
|
|
for (int i = 0; i < devicesCount; ++i) {
|
|
const auto info = CorsairGetDeviceInfo(i);
|
|
if (!info) {
|
|
errorCheck("Get device info error");
|
|
continue;
|
|
}
|
|
|
|
std::cout << "Model: " << info->model << "Logical layout: " << info->logicalLayout << std::endl;
|
|
}
|
|
|
|
getchar();
|
|
return 0;
|
|
}
|
|
```
|
|
|
|
I'm getting this output, which is as expected:
|
|
```
|
|
Model: K95 RGB PLATINUMLogical layout: 13
|
|
```
|
|
|
|
Then when I put the PC to full stand-by and wake it up again the code returns the following:
|
|
```
|
|
Model: K95 RGB PLATINUMLogical layout: 0
|
|
```
|
|
|
|
Windows 10 Home 1903
|
|
iCUE v. 3.22.74
|
|
SDK: 3.0.301 |