Add the feature check logic in launching bt-service
[platform/core/connectivity/bluetooth-frwk.git] / include / bt-internal-types.h
index 7814056..35ec41a 100644 (file)
@@ -673,6 +673,8 @@ typedef struct {
 #define HEADED_PLUGIN_FILEPATH64 "/usr/lib64/bt-plugin-headed.so"
 #define FILEPATH_ARCH_64 "/usr/lib64"
 
+#define BT_FEATURE_COMMON "http://tizen.org/feature/network.bluetooth"
+
 struct bluetooth_headed_plugin_t {
        int (*bt_launch_dpmpopup) (char *mode);
        int (*bt_launch_system_popup)(int event_type,
@@ -721,6 +723,7 @@ extern bt_plugin_info_t *headed_plugin_info;
 
 /* Accessing system info */
 int system_info_get_platform_string(const char *key, char **value);
+bool system_info_get_platform_bool(const char *key, bool *value);
 
 void bluetooth_plugin_init();
 void bluetooth_plugin_deinit();
@@ -802,6 +805,15 @@ static inline tizen_model_t get_tizen_model(void)
        return model;
 }
 
+static inline bool get_tizen_feature_supported(char *feature)
+{
+       bool is_supported = false;
+
+       system_info_get_platform_bool(feature, &is_supported);
+
+       return is_supported ? true : false;
+}
+
 #define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
 #define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
 #define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
@@ -812,6 +824,7 @@ static inline tizen_model_t get_tizen_model(void)
 #define TIZEN_FEATURE_FLIGHTMODE_ENABLED (get_tizen_profile() & (_PROFILE_MOBILE | _PROFILE_WEARABLE))
 #define TIZEN_FEATURE_BT_USB_DONGLE (get_tizen_profile() & (_PROFILE_TV))
 #define TIZEN_FEATURE_BLUEZ_SPEAKER_REFERENCE ((get_tizen_model()) == _MODEL_RPI3 && (get_tizen_profile()) == _PROFILE_COMMON)
+#define TIZEN_FEATURE_BT_SUPPORTED (get_tizen_feature_supported(BT_FEATURE_COMMON) == true)
 
 #ifdef __cplusplus
 }