%description profile_tv
Bluez modified service script for Tizen TV
-%ifarch %{ix86} || %{arm}
-%package -n libbluetooth-extension-TM1
-Summary: Extension for mobile TM1
-Requires: libbluetooth = %{version}-%{release}
-%description -n libbluetooth-extension-TM1
-Bluez default service script for Tizen mobile TM1
-When you want to uninstall this while keeping libbluetooth, you need
-to reinstall libbluetooth after uninstalling this because this package
-overwrites some contents of libbluetooth.
-%endif
-
%prep
%setup -q
cp %{SOURCE1001} .
export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
export CFLAGS_DEFAULT="$CFLAGS"
-%ifarch %{ix86} || %{arm}
-# extension-TM1
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN"
-# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c
-# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c
+# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
+# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c ==> RUNTIME! (profile.h)
-%reconfigure --disable-static \
- --sysconfdir=%{_sysconfdir} \
- --localstatedir=%{_localstatedir} \
- --with-systemdsystemunitdir=%{_libpath}/systemd/system \
- --with-systemduserunitdir=%{_libpath}/systemd/user \
- --libexecdir=%{_libexecdir} \
- --enable-debug \
- --enable-pie \
- --enable-serial \
- --enable-input \
- --enable-usb=no \
- --enable-tools \
- --disable-bccmd \
- --enable-pcmcia=no \
- --enable-hid2hci=no \
- --enable-alsa=no \
- --enable-gstreamer=no \
- --disable-dfutool \
- --disable-cups \
- --enable-health=yes \
- --enable-proximity=yes \
- --enable-tds=yes \
- --enable-dbusoob \
- --enable-test \
- --with-telephony=tizen \
- --enable-obex \
- --enable-library \
- --enable-gatt \
- --enable-experimental \
- --enable-autopair=no \
- --enable-hid=yes \
- --enable-tizenunusedplugin=no
-
-
-make %{?_smp_mflags} all V=1
-
-mkdir -p tm1
-
-%make_install
-cp -a %{buildroot}%{_libdir}/libbluetooth.so* tm1/
-%endif
-
-# non-extension-TM1
export CFLAGS="$CFLAGS_DEFAULT"
%reconfigure --disable-static \
%install
%make_install
-%ifarch %{ix86} || %{arm}
-pushd tm1
-for FILE in libbluetooth.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tm1"; done
-popd
-%endif
# bluez-test
rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
%postun -n libbluetooth -p /sbin/ldconfig
-%ifarch %{ix86} || %{arm}
-%post -n libbluetooth-extension-TM1
-pushd %{_libdir}
-for FILE in libbluetooth.so*.tm1; do mv "$FILE" "${FILE%.tm1}"; done
-popd
-/sbin/ldconfig
-%endif
-
%files
%manifest %{name}.manifest
%defattr(-, root, root)
%manifest %{name}.manifest
%defattr(-, root, root)
%{_libdir}/libbluetooth.so.*
-%exclude %{_libdir}/libbluetooth.so*.tm1
%license COPYING
-%ifarch %{ix86} || %{arm}
-%files -n libbluetooth-extension-TM1
-%manifest %{name}.manifest
-%defattr(-, root, root)
-%{_libdir}/libbluetooth.so*.tm1
-%endif
-
%files -n obexd
%manifest %{name}.manifest
%defattr(-,root,root,-)
TIZEN_PROFILE_COMMON = 0x10,
} tizen_profile_t;
+typedef enum {
+ TIZEN_MODEL_UNKNOWN = 0,
+ TIZEN_MODEL_COMMON = 0x1,
+ TIZEN_MODEL_TM1 = 0x2,
+ TIZEN_MODEL_TM2 = 0x4,
+ TIZEN_MODEL_TW1 = 0x8,
+ TIZEN_MODEL_TW2 = 0x10,
+} tizen_model_t;
+
static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+static tizen_model_t model = TIZEN_MODEL_UNKNOWN;
static inline int __get_profile_from_model_config_xml(const char *field, char **value)
{
return profile;
}
+static inline tizen_model_t _get_tizen_model(void)
+{
+ char *model_name = NULL;
+
+ if (__builtin_expect(model != TIZEN_MODEL_UNKNOWN, 1))
+ return model;
+
+ if (__get_profile_from_model_config_xml("tizen.org/system/model_name",
+ &model_name) < 0) {
+ model = TIZEN_MODEL_COMMON;
+ return model;
+ }
+
+ if (model_name == NULL) {
+ model = TIZEN_MODEL_COMMON;
+ return model;
+ }
+
+ if (!strcasecmp(model_name, "TM1"))
+ model = TIZEN_MODEL_TM1;
+ else if (!strcasecmp(model_name, "TM2"))
+ model = TIZEN_MODEL_TM2;
+ else if (!strcasecmp(model_name, "TW1"))
+ model = TIZEN_MODEL_TW1;
+ else if (!strcasecmp(model_name, "TW2"))
+ model = TIZEN_MODEL_TW2;
+ else
+ model = TIZEN_MODEL_COMMON;
+
+ free(model_name);
+
+ return model;
+}
+
#define TIZEN_FEATURE_BLUEZ_BRCM_CHIP ((_get_tizen_profile()) == TIZEN_PROFILE_IVI)
#define TIZEN_FEATURE_BLUEZ_SMS_ONLY ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE)
#define TIZEN_FEATURE_BLUEZ_BRCM_QOS ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE)
#define TIZEN_FEATURE_BLUEZ_ROLE_CHANGE ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE)
#define TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE)
-
+#define TIZEN_FEATURE_BLUEZ_SPRD_QOS ((_get_tizen_model()) == TIZEN_MODEL_TM1)
+#define TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN ((_get_tizen_model()) == TIZEN_MODEL_TM1)
#endif /* __TIZEN_PROFILE_H__ */
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#include "src/service.h"
+#include "../../profile.h"
#endif
#include "avdtp.h"
#include "sink.h"
#include "source.h"
-#include "../../profile.h"
#define AVDTP_PSM 25
return TRUE;
}
-#ifdef TIZEN_FEATURE_BLUEZ_SPRD_QOS
static gboolean send_sprd_a2dp_qos(bdaddr_t *dst, gboolean qos_high)
{
int dd;
return TRUE;
}
-#endif /* TIZEN_FEATURE_BLUEZ_SPRD_QOS */
static gboolean fix_role_to_master(const bdaddr_t *dst, gboolean fix_to_master)
{
struct avdtp_stream *stream = sep->stream;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
const bdaddr_t *dst;
-#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS)
- dst = device_get_address(session->device);
-#else
- if (TIZEN_FEATURE_BLUEZ_BRCM_QOS || TIZEN_FEATURE_BLUEZ_ROLE_CHANGE)
+ if (TIZEN_FEATURE_BLUEZ_SPRD_QOS)
+ dst = device_get_address(session->device);
+ else if (TIZEN_FEATURE_BLUEZ_BRCM_QOS || TIZEN_FEATURE_BLUEZ_ROLE_CHANGE)
dst = device_get_address(session->device);
-#endif
#endif
avdtp_state_t old_state;
struct avdtp_error err, *err_ptr = NULL;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (TIZEN_FEATURE_BLUEZ_BRCM_QOS) {
send_broadcom_a2dp_qos(dst, FALSE);
- } else {
-#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS)
+ } else if (TIZEN_FEATURE_BLUEZ_SPRD_QOS) {
if (old_state == AVDTP_STATE_STREAMING)
send_sprd_a2dp_qos(dst, FALSE);
-#endif
}
+
if (TIZEN_FEATURE_BLUEZ_ROLE_CHANGE)
fix_role_to_master(dst, FALSE);
#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */
-
break;
case AVDTP_STATE_STREAMING:
if (stream->start_timer) {
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (TIZEN_FEATURE_BLUEZ_BRCM_QOS) {
send_broadcom_a2dp_qos(dst, TRUE);
- } else {
-#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS)
+ } else if (TIZEN_FEATURE_BLUEZ_SPRD_QOS) {
if (old_state == AVDTP_STATE_OPEN)
send_sprd_a2dp_qos(dst, TRUE);
-#endif
}
if (TIZEN_FEATURE_BLUEZ_ROLE_CHANGE)
fix_role_to_master(dst, TRUE);
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#include "adapter_le_vsc_features.h"
+#include "../profile.h"
#endif
#define ADAPTER_INTERFACE "org.bluez.Adapter1"
}
#endif
-#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#define OCF_PAGE_SCAN_TIMEOUT 0x0018
#define OGF_PAGE_SCAN_TIMEOUT 0x03
if (adapter->current_settings & MGMT_SETTING_POWERED) {
adapter_start(adapter);
-#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN
- /* Approx 6.4 Seconds of timeout */
- /* This Added because Z3 device was not able to connect with
- * some device as it was getting Page Timeout
- * (LG HBS800, sony carkit) etc. So, Increasing Page timeout value
- * from 5.12 Sec (which is default) to ~6.4sec*/
- DBG("Setting value");
- send_sprd_page_scan_timeout(10240);
-#endif /* TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN */
+
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN) {
+ /* Approx 6.4 Seconds of timeout */
+ /* This Added because Z3 device was not able to connect with
+ * some device as it was getting Page Timeout
+ * (LG HBS800, sony carkit) etc. So, Increasing Page timeout value
+ * from 5.12 Sec (which is default) to ~6.4sec*/
+ DBG("Setting value");
+ send_sprd_page_scan_timeout(10240);
+ }
+#endif
} else {
adapter_stop(adapter);