CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-IF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
+# For bluetooth-agent-profile.h
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
ADD_SUBDIRECTORY(hf-agent)
-ELSE (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
ADD_SUBDIRECTORY(map-agent)
ADD_SUBDIRECTORY(pb-agent)
-IF (TIZEN_FEATURE_BT_HFP_AG)
ADD_SUBDIRECTORY(ag-agent)
-ENDIF (TIZEN_FEATURE_BT_HFP_AG)
-ENDIF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
-
ADD_SUBDIRECTORY(bt-ipsp)
\ No newline at end of file
SET(SRCS bluetooth-ag-agent.c
bluetooth-ag-handler.c
- bluetooth-ag-manager.c)
+ bluetooth-ag-manager.c
+ ../include/bluetooth-agent-profile.c)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
#include <bundle_internal.h>
#include "bluetooth-ag-agent.h"
#include "bluetooth-ag-handler.h"
+#include "bluetooth-agent-profile.h"
#include <TapiUtility.h>
#include <ITapiSim.h>
#define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
#endif
#define DEFAULT_ADAPTER_OBJECT_PATH "/org/bluez/hci0"
-
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
#define VCONF_KEY_BT_LUNAR_ENABLED "db/wms/bt_loop_device_hfp_connected"
-#endif
#if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_FEATURE_BT_HFP_AG)
#define CALL_APP_ID "org.tizen.call-ui"
#endif
}
-#if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_TELEPHONY_ENABLED)
static gboolean __bt_ag_agent_launch_call_app(const char *number)
{
FN_START;
FN_END;
return TRUE;
}
-#endif
static void *__bt_ag_agent_launch_call_req(void *arg)
{
{
FN_START;
-#if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_FEATURE_BT_HFP_AG)
- FN_END;
- return __bt_ag_agent_launch_call_app(number);
-#else
char telnum[BT_MAX_TEL_NUM_STRING];
bundle *b;
pthread_t thread_id;
+ if (TIZEN_PROFILE_WEARABLE)
+ return __bt_ag_agent_launch_call_app(number);
+
if (call_launch_requested == TRUE) {
DBG("Launch request is in progress");
return TRUE;
FN_END;
return TRUE;
-#endif
}
static gboolean __bt_ag_agent_make_video_call(const char *mo_number)
uint32_t codec;
struct ag_codec *data = NULL;;
-#ifdef TIZEN_FEATURE_BT_KIRAN_DEVICE
- codec = BT_CVSD_CODEC_ID;
-#else
if (hs->codec_info.remote_codecs & BT_MSBC_CODEC_MASK)
codec = BT_MSBC_CODEC_ID;
else
codec = BT_CVSD_CODEC_ID;
-#endif
if (wbs_opts.wbs_enable == FALSE)
codec = BT_CVSD_CODEC_ID;
_bt_hfp_set_property_value("SignalBarsChanged", signal_bar);
}
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
static void __bt_ag_agent_lunar_connection_status_cb(keynode_t *node)
{
gboolean status = vconf_keynode_get_bool(node);
}
}
}
-#endif
static void __bt_ag_agent_network_register_status_cb(keynode_t *node)
{
if (0 != ret)
ERR("Subsrciption to network failed err = [%d]\n", ret);
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
- ret = vconf_notify_key_changed(VCONF_KEY_BT_LUNAR_ENABLED,
- (void *)__bt_ag_agent_lunar_connection_status_cb, NULL);
- if (0 != ret)
- ERR("Subsrciption to lunar connection failed err = [%d]\n", ret);
-
-#endif
+ if (TIZEN_PROFILE_WEARABLE) {
+ ret = vconf_notify_key_changed(VCONF_KEY_BT_LUNAR_ENABLED,
+ (void *)__bt_ag_agent_lunar_connection_status_cb, NULL);
+ if (0 != ret)
+ ERR("Subsrciption to lunar connection failed err = [%d]\n", ret);
+ }
}
static void __bt_ag_agent_release_vconf_updates(void)
BT_AG_FEATURE_REJECT_CALL |
BT_AG_FEATURE_ENHANCED_CALL_STATUS |
BT_AG_FEATURE_THREE_WAY_CALL |
-#ifndef TIZEN_FEATURE_BT_KIRAN_DEVICE
BT_AG_FEATURE_VOICE_RECOGNITION |
-#endif
BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES;
wbs_en = TRUE;
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(bt-ipsp C)
-SET(SRCS bt-ipsp.c)
+SET(SRCS bt-ipsp.c
+ ../include/bluetooth-agent-profile.c)
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release")
bluetooth-api
gio-2.0
dlog
+ capi-system-info
)
INCLUDE(FindPkgConfig)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(bluetooth-hf-agent C)
-SET(SRCS bluetooth-hf-agent.c)
+SET(SRCS bluetooth-hf-agent.c
+ ../include/bluetooth-agent-profile.c)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
pkg_check_modules(pkgs_hf_agent
REQUIRED
dlog aul bluetooth-api alarm-service capi-appfw-app-manager
- glib-2.0 gio-2.0 gio-unix-2.0 capi-system-device vconf)
+ glib-2.0 gio-2.0 gio-unix-2.0 capi-system-device vconf
+ capi-system-info)
FOREACH(flag ${pkgs_hf_agent_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#include <bundle_internal.h>
#include "bluetooth-hf-agent.h"
+#include "bluetooth-agent-profile.h"
#define BT_AGENT_SYSPOPUP_MAX_ATTEMPT 3
#define CALL_APP_ID "org.tizen.call-ui"
BT_HF_FEATURE_REMOTE_VOLUME_CONTROL |
BT_HF_FEATURE_ENHANCED_CALL_STATUS;
-#ifdef TIZEN_PROFILE_WEARABLE
- feature = feature | BT_HF_FEATURE_CODEC_NEGOTIATION;
-#endif
+ if (TIZEN_PROFILE_WEARABLE)
+ feature = feature | BT_HF_FEATURE_CODEC_NEGOTIATION;
snprintf(cmd_buf, sizeof(cmd_buf), BT_HF_FEATURES, feature);
ret = __bt_hf_send_and_read(bt_hf_info, cmd_buf, buf,
return FALSE;
INFO("Gateway supported features are 0x%X", bt_hf_info->ag_features);
-#ifdef TIZEN_PROFILE_WEARABLE
- if (bt_hf_info->ag_features & BT_AG_FEATURE_CODEC_NEGOTIATION) {
- ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_MSBC);
- if (ret != BT_HF_AGENT_ERROR_NONE)
- ERR("Unable to set the default WBC codec");
+ if (TIZEN_PROFILE_WEARABLE) {
+ if (bt_hf_info->ag_features & BT_AG_FEATURE_CODEC_NEGOTIATION) {
+ ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_MSBC);
+ if (ret != BT_HF_AGENT_ERROR_NONE)
+ ERR("Unable to set the default WBC codec");
- ret = __bt_hf_send_available_codec(bt_hf_info, 0);
- if (!ret)
- return FALSE;
- } else
-#endif
- {
+ ret = __bt_hf_send_available_codec(bt_hf_info, 0);
+ if (!ret)
+ return FALSE;
+ }
+ } else {
/* Default codec is NB */
ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_CVSD);
if (ret != BT_HF_AGENT_ERROR_NONE)
BT_HF_FEATURE_ENHANCED_CALL_STATUS |
BT_HF_FEATURE_CODEC_NEGOTIATION;
-#ifdef TIZEN_PROFILE_WEARABLE
- hf_features = hf_features | BT_HF_FEATURE_CODEC_NEGOTIATION;
-#endif
+ if (TIZEN_PROFILE_WEARABLE)
+ hf_features = hf_features | BT_HF_FEATURE_CODEC_NEGOTIATION;
hf_ver = HFP_VERSION_1_6;
--- /dev/null
+/*
+ * Bluetooth-agent-common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Hocheol Seo <hocheol.seo@samsung.com>
+ * Girishashok Joshi <girish.joshi@samsung.com>
+ * Chanyeol Park <chanyeol.park@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "bluetooth-agent-profile.h"
+
+tizen_profile_t profile = _PROFILE_UNKNOWN;
--- /dev/null
+/*
+ * Bluetooth-agent-common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Hocheol Seo <hocheol.seo@samsung.com>
+ * Girishashok Joshi <girish.joshi@samsung.com>
+ * Chanyeol Park <chanyeol.park@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __DEF_BT_AGENT_PROFILE_H_
+#define __DEF_BT_AGENT_PROFILE_H_
+
+#include <sys/types.h>
+#include <libintl.h>
+#include <stdlib.h>
+#include <system_info.h>
+
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+
+/* For optimization, make this extern and define in a shared C file */
+extern tizen_profile_t profile;
+
+/* Accessing system info */
+int system_info_get_platform_string(const char *key, char **value);
+
+static inline tizen_profile_t get_tizen_profile()
+{
+ char *profileName = NULL;
+
+ if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+
+ /* To pass the checking of g_ir */
+ if (!profileName)
+ return _PROFILE_UNKNOWN;
+
+ 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;
+}
+
+#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)
+#define TIZEN_PROFILE_MOBILE (get_tizen_profile() == _PROFILE_MOBILE)
+
+#endif /* __DEF_BT_AGENT_PROFILE_H_ */
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(bluetooth-map-agent C)
-SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c map_bmessage.c)
+SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c
+ map_bmessage.c ../include/bluetooth-agent-profile.c)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs_map_agent
REQUIRED
- dlog msg-service email-service tapi vconf gio-2.0)
+ dlog msg-service email-service tapi vconf gio-2.0
+ capi-system-info)
FOREACH(flag ${pkgs_map_agent_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
export CFLAGS_DEFAULT="$CFLAGS"
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-
-# Build Wearable
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_PROFILE_WEARABLE"
-export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_LUNAR_DEVICE"
-mkdir -p wearable_build
-pushd wearable_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr/wearable -DTIZEN_PROFILE_WEARABLE=1 -DTIZEN_FEATURE_BT_HFP_AG=1
-make VERBOSE=1
-popd
-
-
-# Build IVI
-# TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
-export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
-mkdir -p ivi_build
-pushd ivi_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ivi -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_PROFILE_IVI=1 -DTIZEN_FEATURE_BT_HFP_AG=1
-make VERBOSE=1
-popd
-
-%endif
-
-
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-# Original: common, mobile, tv. Added: "undefined"
-
-# Build All Others (common/tv/mobile)
-# TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
-mkdir -p common_build
-pushd common_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_FEATURE_BT_HFP_AG=1
+# Build All (wearalbe/ivi/common/tv/mobile)
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_FEATURE_BT_HFP_AG=1
make VERBOSE=1
-popd
-
-%endif
%install
rm -rf %{buildroot}
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-pushd wearable_build
-%make_install
-popd
-pushd ivi_build
-%make_install
-popd
-%endif
-
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-# Original: common, mobile, tv. Added: "undefined"
-pushd common_build
%make_install
-popd
-%endif
install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
+#%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
# Original: wearable, ivi. Added: common, "undefined"
-mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
-mkdir -p %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/wearable/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/wearable/bin/bt-ipsp %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/ivi/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/ivi/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/bluetooth-hf-agent.ivi
-install -D -m 0644 %{buildroot}/usr/ivi/bin/bt-ipsp %{buildroot}%{_bindir}/
-rm -Rf %{buildroot}/usr/ivi
-rm -Rf %{buildroot}/usr/wearable
-%endif
+#mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
+#mkdir -p %{buildroot}%{_bindir}/
+#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
+#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
+#install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
+#install -D -m 0644 %{buildroot}/usr/bin/bt-ipsp %{buildroot}%{_bindir}/
+#%endif
install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
%post
%endif
ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-%post profile_ivi
-ln -sf bluetooth-hf-agent.ivi %{_bindir}/bluetooth-hf-agent
-%preun profile_ivi
-rm %{_bindir}/bluetooth-hf-agent
-%endif
-
%files
%manifest %{name}.manifest
%license LICENSE
%{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
+%endif
%files profile_ivi
%license LICENSE
-%{_bindir}/bluetooth-hf-agent.ivi
+%{_bindir}/bluetooth-hf-agent
%{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
-%endif
# This usage of profile macro does NOT conflict 4.0 configurability.
%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(bluetooth-pb-agent C)
-SET(SRCS bluetooth_pb_agent.c bluetooth_pb_vcard.c)
+SET(SRCS bluetooth_pb_agent.c bluetooth_pb_vcard.c
+ ../include/bluetooth-agent-profile.c)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs_pb_agent
REQUIRED
- gio-2.0 dlog contacts-service2 tapi vconf capi-media-image-util libexif)
+ gio-2.0 dlog contacts-service2 tapi vconf capi-media-image-util libexif
+ capi-system-info)
FOREACH(flag ${pkgs_pb_agent_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")