mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Add Windows OS version
This commit is contained in:
parent
f4ad8ed3d8
commit
3259bdcbe8
@ -52,7 +52,7 @@ void Win32Device::set_hostname(const char* hostname)
|
|||||||
}
|
}
|
||||||
const char* Win32Device::get_core_version()
|
const char* Win32Device::get_core_version()
|
||||||
{
|
{
|
||||||
return "win32";
|
return _core_version.c_str();
|
||||||
}
|
}
|
||||||
const char* Win32Device::get_display_driver()
|
const char* Win32Device::get_display_driver()
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,17 @@ class Win32Device : public BaseDevice {
|
|||||||
_hostname = "localhost";
|
_hostname = "localhost";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the Windows version.
|
||||||
|
DWORD dwBuild = 0;
|
||||||
|
DWORD dwVersion = GetVersion();
|
||||||
|
DWORD dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
|
||||||
|
DWORD dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
|
||||||
|
if(dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion));
|
||||||
|
|
||||||
|
char version[128];
|
||||||
|
snprintf(version, sizeof(version), "Windows %d.%d-%d", dwMajorVersion, dwMinorVersion, dwBuild);
|
||||||
|
_core_version = version;
|
||||||
|
|
||||||
// _backlight_pin = -1;
|
// _backlight_pin = -1;
|
||||||
_backlight_power = 1;
|
_backlight_power = 1;
|
||||||
_backlight_level = 100;
|
_backlight_level = 100;
|
||||||
@ -63,6 +74,7 @@ class Win32Device : public BaseDevice {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _hostname;
|
std::string _hostname;
|
||||||
|
std::string _core_version;
|
||||||
|
|
||||||
uint8_t _backlight_pin;
|
uint8_t _backlight_pin;
|
||||||
uint8_t _backlight_level;
|
uint8_t _backlight_level;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user