summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoHyun Pyun <dh79.pyun@samsung.com>2016-09-02 11:37:46 +0900
committerDoHyun Pyun <dh79.pyun@samsung.com>2016-09-02 11:41:25 +0900
commitc5bd6393fded8aa4ea2953c403e2265da707387a (patch)
treec6ca00b66cb551ae32cb9a5648fd62116687ba98
parent08e64c40bdb6bac3752a5fe71999b7b27a46a7cf (diff)
downloadbluetooth-c5bd6393fded8aa4ea2953c403e2265da707387a.tar.gz
bluetooth-c5bd6393fded8aa4ea2953c403e2265da707387a.tar.bz2
bluetooth-c5bd6393fded8aa4ea2953c403e2265da707387a.zip
Modify the audio supported check logic Change-Id: I9cb17f2a267b11c4307cebc0d27366c296c42a74 Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r--include/bluetooth_private.h24
-rw-r--r--src/bluetooth-audio.c5
2 files changed, 26 insertions, 3 deletions
diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h
index 8ce9e5e..1ed5df5 100644
--- a/include/bluetooth_private.h
+++ b/include/bluetooth_private.h
@@ -621,6 +621,30 @@ do { \
} \
} while (0)
+#define BT_CHECK_SUPPORTED_FEATURES(feature_name1, feature_name2) \
+do { \
+ bool is_supported = false; \
+ if (!system_info_get_platform_bool(feature_name1, &is_supported)) { \
+ if (is_supported == true) { \
+ LOGE("[%s] SUPPORTED", __FUNCTION__); \
+ break; \
+ } \
+ } else { \
+ LOGE("[%s] Fail to get the system feature: [%s]", __FUNCTION__, feature_name1); \
+ } \
+ if (!system_info_get_platform_bool(feature_name2, &is_supported)) { \
+ if (is_supported == true) { \
+ LOGE("[%s] SUPPORTED", __FUNCTION__); \
+ break; \
+ } else {\
+ LOGE("[%s] NOT_SUPPORTED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_SUPPORTED); \
+ return BT_ERROR_NOT_SUPPORTED; \
+ } \
+ } else { \
+ LOGE("[%s] Fail to get the system feature: [%s]", __FUNCTION__, feature_name2); \
+ } \
+} while (0)
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
* @brief Enumerations of the authentication event types.
diff --git a/src/bluetooth-audio.c b/src/bluetooth-audio.c
index 7feebe6..a7a2850 100644
--- a/src/bluetooth-audio.c
+++ b/src/bluetooth-audio.c
@@ -39,9 +39,8 @@ static bool is_audio_ag_initialized = false;
#define BT_CHECK_AUDIO_SUPPORT() \
{ \
BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \
- BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_AUDIO_CALL); \
- BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_AUDIO_MEDIA); \
-}
+ BT_CHECK_SUPPORTED_FEATURES(BT_FEATURE_AUDIO_CALL, BT_FEATURE_AUDIO_MEDIA); \
+ }
#define BT_CHECK_HFP_SUPPORT() \
{ \