Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "CgSDK.x64_2015.h"
- #include <iostream>
- #include <cstdint>
- const char* toString(CorsairError error)
- {
- switch (error){
- case CE_Success:
- return "CE_Success";
- case CE_ServerNotFound:
- return "CE_ServerNotFound";
- case CE_NoControl:
- return "CE_NoControl";
- case CE_ProtocolHandshakeMissing:
- return "CE_ProtocolHandshakeMissing";
- case CE_IncompatibleProtocol:
- return "CE_IncompatibleProtocol";
- case CE_InvalidArguments:
- return "CE_InvalidArguments";
- default:
- return "unknown error";
- }
- }
- int main()
- {
- CorsairProtocolDetails details = CgSdkPerformProtocolHandshake();
- std::cout << "SDK Version: " << details.sdkVersion << std::endl;
- std::cout << "SDK Protocol Version: " << details.sdkProtocolVersion << std::endl;
- std::cout << "Server Version: " << details.serverVersion << std::endl;
- std::cout << "Server Protocol Version: " << details.serverProtocolVersion << std::endl << std::endl;
- if (const auto error = CgSdkGetLastError())
- {
- std::cout << "Handshake failed: " << toString(error) << "\nPress any key tro quit." << std::endl;
- std::cin.get();
- return -1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement