__bt_core_set_status(BT_ACTIVATING);
#ifdef USB_BLUETOOTH
- char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", "pscan", NULL};
+ char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", NULL};
ret = __execute_command("/usr/bin/hciconfig", argv_up);
#else
ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
__bt_core_set_le_status(BT_LE_ACTIVATING);
BT_DBG("Activate BT");
#ifdef USB_BLUETOOTH
- char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", "pscan", NULL};
+ char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", NULL};
ret = __execute_command("/usr/bin/hciconfig", argv_up);
#else
ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
#endif
}
-//#ifdef USB_BLUETOOTH
-#if 0
-static int _bt_set_powered(gboolean is_powered)
-{
- DBusGProxy *proxy;
- GValue powered = { 0 };
- GError *error = NULL;
-
- if (__bt_is_factory_test_mode()) {
- BT_ERR("Unable to set power in factory binary !!");
- return BLUETOOTH_ERROR_NOT_SUPPORT;
- }
-
- proxy = _bt_get_adapter_properties_proxy();
-
- retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
-
- g_value_init(&powered, G_TYPE_BOOLEAN);
- g_value_set_boolean(&powered, is_powered);
-
- dbus_g_proxy_call(proxy, "Set", &error,
- G_TYPE_STRING, BT_ADAPTER_INTERFACE,
- G_TYPE_STRING, "Powered",
- G_TYPE_VALUE, &powered,
- G_TYPE_INVALID, G_TYPE_INVALID);
-
- g_value_unset(&powered);
- if (error != NULL) {
- BT_ERR("Powered set err:[%s]", error->message);
- g_error_free(error);
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- BT_INFO("Set powered [%d]", is_powered);
-
- return BLUETOOTH_ERROR_NONE;
-}
-#endif
-
void _bt_handle_adapter_added(void)
{
BT_DBG("+");
if (!proxy)
return FALSE;
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(FALSE)) {
- BT_ERR("BT adapter power down failed");
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_status(BT_DEACTIVATED);
-#else
/* Clean up the process */
result = g_dbus_proxy_call_sync(proxy,
"DisableAdapter",
}
g_variant_unref(result);
-#endif
_bt_set_disabled(BLUETOOTH_ERROR_TIMEOUT);
if (!proxy)
return FALSE;
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(FALSE)) {
- BT_ERR("BT LE adapter power down failed");
-
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_status(BT_DEACTIVATED);
-#else
/* Clean up the process */
result = g_dbus_proxy_call_sync(proxy,
"DisableAdapterLe",
}
g_variant_unref(result);
-#endif
_bt_adapter_set_le_status(BT_LE_DEACTIVATED);
}
}
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(TRUE)) {
- BT_ERR("BT adapter power up failed");
- _bt_adapter_set_status(BT_DEACTIVATED);
-#if 0
- /* Display notification */
- notification_status_message_post(BT_STR_NOT_SUPPORT);
-#endif
- /* Terminate myself */
- g_idle_add((GSourceFunc)_bt_terminate_service, NULL);
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_ON) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_status(BT_ACTIVATED);
-#else
result = g_dbus_proxy_call_sync(proxy, "EnableAdapter",
NULL,
G_DBUS_CALL_FLAGS_NONE, BT_ENABLE_TIMEOUT,
return BLUETOOTH_ERROR_INTERNAL;
}
g_variant_unref(result);
-#endif
if (le_status == BT_LE_ACTIVATED) {
__bt_set_enabled();
}
}
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(FALSE)) {
- BT_ERR("BT adapter power down failed");
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_status(BT_DEACTIVATED);
-#else
proxy = __bt_get_core_proxy();
retv_if(!proxy, BLUETOOTH_ERROR_INTERNAL);
}
g_variant_unref(result);
-#endif
return BLUETOOTH_ERROR_NONE;
}
proxy = __bt_get_core_proxy();
retv_if(!proxy, BLUETOOTH_ERROR_INTERNAL);
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(TRUE)) {
- BT_ERR("BT LE adapter power up failed");
- _bt_adapter_set_status(BT_DEACTIVATED);
-#if 0
- /* Display notification */
- notification_status_message_post(BT_STR_NOT_SUPPORT);
-#endif
- /* Terminate myself */
- g_idle_add((GSourceFunc)_bt_terminate_service, NULL);
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_le_status(BT_LE_ACTIVATED);
-#else
result = g_dbus_proxy_call_sync(proxy, "EnableAdapterLe",
NULL,
G_DBUS_CALL_FLAGS_NONE, BT_ENABLE_TIMEOUT,
if (result)
g_variant_unref(result);
-#endif
_bt_adapter_start_le_enable_timer();
if (!proxy)
return BLUETOOTH_ERROR_INTERNAL;
-//#ifdef USB_BLUETOOTH
-#if 0
- if (_bt_set_powered(FALSE)) {
- BT_ERR("BT LE adapter power down failed");
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
- if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
- BT_ERR("Set vconf failed");
-
- _bt_adapter_set_le_status(BT_LE_DEACTIVATED);
-#else
result = g_dbus_proxy_call_sync(proxy,
"DisableAdapterLe",
NULL,
}
g_variant_unref(result);
-#endif
_bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
BT_DBG("le status : %d", _bt_adapter_get_le_status());