2 * Bluetooth-agent-common
4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Girishashok Joshi <girish.joshi@samsung.com>
8 * Chanyeol Park <chanyeol.park@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #ifndef __DEF_BT_AGENT_PROFILE_H_
25 #define __DEF_BT_AGENT_PROFILE_H_
27 #include <sys/types.h>
30 #include <system_info.h>
35 _PROFILE_MOBILE = 0x1,
36 _PROFILE_WEARABLE = 0x2,
39 _PROFILE_COMMON = 0x10,
42 /* For optimization, make this extern and define in a shared C file */
43 extern tizen_profile_t profile;
45 /* Accessing system info */
46 int system_info_get_platform_string(const char *key, char **value);
48 static inline tizen_profile_t get_tizen_profile()
50 char *profileName = NULL;
52 if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
55 system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
57 /* To pass the checking of g_ir */
59 return _PROFILE_UNKNOWN;
61 switch (*profileName) {
64 profile = _PROFILE_MOBILE;
68 profile = _PROFILE_WEARABLE;
72 profile = _PROFILE_TV;
76 profile = _PROFILE_IVI;
78 default: // common or unknown ==> ALL ARE COMMON.
79 profile = _PROFILE_COMMON;
94 extern tizen_model_name_t model_name;
96 static inline tizen_model_name_t get_tizen_model_name()
98 char *modelName = NULL;
100 if (__builtin_expect(model_name != _MODEL_UNKNOWN, 1))
103 system_info_get_platform_string("http://tizen.org/system/model_name", &modelName);
105 /* To pass the checking of g_ir */
107 return _MODEL_UNKNOWN;
109 if (g_strcmp0(modelName, "TM1") == 0) {
110 model_name = _MODEL_TM1;
111 } else if (g_strcmp0(modelName, "TM2") == 0) {
112 model_name = _MODEL_TM2;
113 } else if (g_strcmp0(modelName, "TW1") == 0) {
114 model_name = _MODEL_TW1;
115 } else if (g_strcmp0(modelName, "TW2") == 0) {
116 model_name = _MODEL_TW2;
118 model_name = _MODEL_UNKNOWN;
126 #define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
127 #define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
128 #define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
129 #define TIZEN_PROFILE_MOBILE (get_tizen_profile() == _PROFILE_MOBILE)
131 #define TIZEN_MODEL_NAME_TM1 (get_tizen_model_name() == _MODEL_TM1)
132 #define TIZEN_MODEL_NAME_TM2 (get_tizen_model_name() == _MODEL_TM2)
133 #define TIZEN_MODEL_NAME_TW1 (get_tizen_model_name() == _MODEL_TW1)
134 #define TIZEN_MODEL_NAME_TW2 (get_tizen_model_name() == _MODEL_TW2)
136 #endif /* __DEF_BT_AGENT_PROFILE_H_ */