From: Wootak Jung Date: Thu, 25 Oct 2018 06:14:05 +0000 (+0900) Subject: Fix profile check logic to distinguish ivi and iot X-Git-Tag: submit/tizen/20181105.232950^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e10f7f44efde73fa0bc75c6b26a954ccd4be62a2;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fix profile check logic to distinguish ivi and iot Change-Id: I64f811bfe5211d4bdd22c724e3c4768d874ad426 --- diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index 10ea7a6..6969dd9 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -1019,7 +1019,8 @@ typedef enum { _PROFILE_WEARABLE = 0x2, _PROFILE_TV = 0x4, _PROFILE_IVI = 0x8, - _PROFILE_COMMON = 0x10, + _PROFILE_IOT = 0x10, + _PROFILE_COMMON = 0x20, } tizen_profile_t; extern tizen_profile_t _get_tizen_profile(); extern tizen_profile_t profile; diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 3e1b139..941b5ef 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -3583,12 +3583,15 @@ static void __bt_convert_lower_to_upper(char *origin) tizen_profile_t profile = _PROFILE_UNKNOWN; tizen_profile_t _get_tizen_profile() { - char *profileName; + char *profileName = NULL; if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1)) return profile; system_info_get_platform_string("http://tizen.org/feature/profile", &profileName); + if (!profileName) + return _PROFILE_UNKNOWN; + switch (*profileName) { case 'm': case 'M': @@ -3604,7 +3607,12 @@ tizen_profile_t _get_tizen_profile() break; case 'i': case 'I': - profile = _PROFILE_IVI; + if (!strncasecmp(profileName, "ivi", 3)) + profile = _PROFILE_IVI; + else if (!strncasecmp(profileName, "iot", 3)) + profile = _PROFILE_IOT; + else + profile = _PROFILE_COMMON; break; default: // common or unknown ==> ALL ARE COMMON. profile = _PROFILE_COMMON;