Added _get_tizen_profile() API 02/150902/1
authorAtul Rai <a.rai@samsung.com>
Tue, 19 Sep 2017 05:31:17 +0000 (11:01 +0530)
committerAtul Rai <a.rai@samsung.com>
Tue, 19 Sep 2017 05:31:17 +0000 (11:01 +0530)
Change-Id: I355c0efc524e60904d59e3d42d88f3a62e3af177
Signed-off-by: Atul Rai <a.rai@samsung.com>
include/bluetooth_private.h
src/bluetooth-common.c

index c233bdb3d2c32264e922ec22c10ef77c81915f2f..538b67cf3de7c642913dbe0e171cfbf779831f73 100644 (file)
@@ -920,6 +920,17 @@ typedef void (*_bt_le_set_data_length_changed_cb)
 int bt_device_le_set_data_length_change_cb(
        _bt_le_set_data_length_changed_cb callback, void *user_data);
 
+typedef enum {
+       _PROFILE_UNKNOWN = 0,
+       _PROFILE_MOBILE = 0x1,
+       _PROFILE_WEARABLE = 0x2,
+       _PROFILE_TV = 0x4,
+       _PROFILE_IVI = 0x8,
+       _PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
+extern tizen_profile_t profile;
+
 #ifdef __cplusplus
 }
 #endif
index 954c5490def5fd52da1adf9dabb2b6d0889e2229..9bb973089c3658db30034d7b9c2fbdbdbf5945cc 100755 (executable)
@@ -3734,3 +3734,37 @@ next:
        return BT_ERROR_NONE;
 }
 /* LCOV_EXCL_STOP */
+
+tizen_profile_t profile = _PROFILE_UNKNOWN;
+tizen_profile_t _get_tizen_profile()
+{
+       char *profileName;
+
+       if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+               return profile;
+
+       system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+       switch (*profileName) {
+       case 'm':
+       case 'M':
+               profile = _PROFILE_MOBILE;
+               break;
+       case 'w':
+       case 'W':
+               profile = _PROFILE_WEARABLE;
+               break;
+       case 't':
+       case 'T':
+               profile = _PROFILE_TV;
+               break;
+       case 'i':
+       case 'I':
+               profile = _PROFILE_IVI;
+               break;
+       default: // common or unknown ==> ALL ARE COMMON.
+               profile = _PROFILE_COMMON;
+       }
+       free(profileName);
+
+       return profile;
+}