2 * Samsung Ukraine R&D Center (SRK under a contract between)
3 * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
8 * @brief System information collector
9 * @date Created Feb 26, 2018
10 * @author Mail to: <A HREF="mailto:d.lomtev@samsung.com">Dmytro Lomtev, d.lomtev@samsung.com</A>
14 #include <system/system_info.h>
20 * @brief getStringSystemProperty returns system property as std::string
21 * @param prop the requested system property key
22 * @return requested system property on success and "undefined" otherwise
24 std::string getStringSystemProperty(system_info_key_e prop)
26 std::string property{"undefined"};
29 if (0 == system_info_get_value_string(prop, &val)) {
38 * @brief getStringPlatformProperty returns platform property as std::string
39 * @param prop the requested platform property key
40 * @return requested platform property on success and "undefined" otherwise
42 std::string getStringPlatformProperty(const char* prop)
44 std::string property{"undefined"};
47 if (0 == system_info_get_platform_string(prop, &val)) {
57 namespace NetworkManager
60 std::string SysInfo::model()
62 return getStringSystemProperty(SYSTEM_INFO_KEY_MODEL);
65 std::string SysInfo::type()
67 return getStringPlatformProperty("com.samsung/build_config/product_type");
70 std::string SysInfo::osVersion()
72 return getStringPlatformProperty("tizen.org/feature/platform.version");
75 std::string SysInfo::osName()
77 return getStringSystemProperty(SYSTEM_INFO_KEY_PLATFORM_NAME);
80 std::string SysInfo::swVersion()
82 return getStringSystemProperty(SYSTEM_INFO_KEY_TIZEN_VERSION);