#include <vconf.h>
#include <vconf-keys.h>
+#include <vconf-internal-radio-keys.h>
#include <bundle.h>
#include <eventsystem.h>
/* Forcely terminate */
#ifdef USB_BLUETOOTH
char *argv_down[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "down", NULL};
- if (__execute_command("/usr/bin/hciconfig", argv_down) < 0) {
-#else
- if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0) {
-#endif
+ if (__execute_command("/usr/bin/hciconfig", argv_down) < 0)
BT_ERR("running script failed");
+#else
+
+#ifdef TIZEN_FEATURE_RADIO
+ int radio_status = VCONFKEY_RADIO_STATUS_OFF;
+
+ /* Check if radio status on or off */
+ if (vconf_get_int(VCONFKEY_RADIO_STATUS, &radio_status) < 0)
+ BT_ERR("Fail to get radio status");
+
+ BT_DBG("Radio status: %d", radio_status);
+
+ if (radio_status == VCONFKEY_RADIO_STATUS_ON) {
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down-with-radio.sh", NULL) < 0)
+ BT_ERR("running script failed");
+ } else {
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0)
+ BT_ERR("running script failed");
}
+#else
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0)
+ BT_ERR("running script failed");
+#endif
+#endif
_bt_core_terminate();
return 0;
} else if (status != BT_ACTIVATED) {
#ifdef USB_BLUETOOTH
char *argv_down[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "down", NULL};
if (__execute_command("/usr/bin/hciconfig", argv_down) < 0) {
-#else
- if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0) {
-#endif
BT_ERR("running script failed");
__bt_core_set_status(BT_ACTIVATED);
return -1;
}
+#else
+#ifdef TIZEN_FEATURE_RADIO
+ int radio_status = VCONFKEY_RADIO_STATUS_OFF;
+
+ /* Check if radio status on or off */
+ if (vconf_get_int(VCONFKEY_RADIO_STATUS, &radio_status) < 0)
+ BT_ERR("Fail to get radio status");
+
+ BT_DBG("Radio status: %d", radio_status);
+
+ if (radio_status == VCONFKEY_RADIO_STATUS_ON) {
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down-with-radio.sh", NULL) < 0) {
+ BT_ERR("running script failed");
+ __bt_core_set_status(BT_ACTIVATED);
+ return -1;
+ }
+ } else {
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0) {
+ BT_ERR("running script failed");
+ __bt_core_set_status(BT_ACTIVATED);
+ return -1;
+ }
+ }
+#else
+ if (__execute_command("/usr/etc/bluetooth/bt-stack-down.sh", NULL) < 0) {
+ BT_ERR("running script failed");
+ __bt_core_set_status(BT_ACTIVATED);
+ return -1;
+ }
+#endif
+#endif
return 0;
}
Name: bluetooth-frwk
Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
-Version: 0.2.151
+Version: 0.2.152
Release: 1
Group: Network & Connectivity/Bluetooth
License: Apache-2.0
export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
%endif
+
+%if "%{?tizen_target_name}" == "TM1"
+export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_RADIO"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_RADIO"
+export FFLAGS="$FFLAGS -DTIZEN_FEATURE_RADIO"
+%endif
+
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_LIB_DIR=%{_libdir} \
-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \