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>
34 _PROFILE_MOBILE = 0x1,
35 _PROFILE_WEARABLE = 0x2,
38 _PROFILE_COMMON = 0x10,
41 /* For optimization, make this extern and define in a shared C file */
42 extern tizen_profile_t profile;
44 /* Accessing system info */
45 int system_info_get_platform_string(const char *key, char **value);
47 static inline tizen_profile_t get_tizen_profile()
49 char *profileName = NULL;
51 if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
54 system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
56 /* To pass the checking of g_ir */
58 return _PROFILE_UNKNOWN;
60 switch (*profileName) {
63 profile = _PROFILE_MOBILE;
67 profile = _PROFILE_WEARABLE;
71 profile = _PROFILE_TV;
75 profile = _PROFILE_IVI;
77 default: // common or unknown ==> ALL ARE COMMON.
78 profile = _PROFILE_COMMON;
85 #define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
86 #define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
87 #define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
88 #define TIZEN_PROFILE_MOBILE (get_tizen_profile() == _PROFILE_MOBILE)
90 #endif /* __DEF_BT_AGENT_PROFILE_H_ */