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>
19 const std::string UNDEFINED_VAL{"undefined"};
22 * @brief getStringSystemProperty returns system property as std::string
23 * @param prop the requested system property key
24 * @return requested system property on success and "undefined" otherwise
26 bool getStringSystemProperty(system_info_key_e prop, std::string& property)
30 if (0 == system_info_get_value_string(prop, &val)) {
40 * @brief getStringPlatformProperty returns platform property as std::string
41 * @param prop the requested platform property key
42 * @return requested platform property on success and "undefined" otherwise
44 bool getStringPlatformProperty(const char* prop, std::string& property)
48 if (0 == system_info_get_platform_string(prop, &val)) {
59 namespace NetworkManager
62 std::string SysInfo::model()
65 if (!getStringSystemProperty(SYSTEM_INFO_KEY_MODEL, prop)
66 && !getStringPlatformProperty("tizen.org/system/model_name", prop)) {
72 std::string SysInfo::type()
75 if (!getStringPlatformProperty("com.samsung/build_config/product_type", prop)
76 && !getStringPlatformProperty("tizen.org/feature/profile", prop)) {
82 std::string SysInfo::osVersion()
85 if (!getStringPlatformProperty("tizen.org/feature/platform.version", prop)) {
91 std::string SysInfo::osName()
94 if (!getStringSystemProperty(SYSTEM_INFO_KEY_PLATFORM_NAME, prop)
95 && !getStringPlatformProperty("tizen.org/system/platform.name", prop)) {
101 std::string SysInfo::swVersion()
104 if (!getStringSystemProperty(SYSTEM_INFO_KEY_TIZEN_VERSION, prop)
105 && !getStringPlatformProperty("tizen.org/system/build.string", prop)) {
106 prop = UNDEFINED_VAL;