X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-core%2Fbt-core-main.c;h=ea8748ac13cecc2ba6aed55200ad2eb9c9d620ba;hb=9c4f5a830815e5dba0184a2ef3ecfe4bb7bdd40f;hp=5c399c31a500f3d3b58174324c6ca1ee81beea5f;hpb=7640de5c091be29285bd031bcbd591aa14cf0d3e;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-core/bt-core-main.c b/bt-core/bt-core-main.c index 5c399c3..ea8748a 100644 --- a/bt-core/bt-core-main.c +++ b/bt-core/bt-core-main.c @@ -1,11 +1,5 @@ /* - * Bluetooth-frwk - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Hocheol Seo - * Girishashok Joshi - * Chanyeol Park + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,13 +85,13 @@ static gboolean __bt_check_bt_core(void *data) le_status = _bt_core_get_le_status(); BT_DBG("State: %d, LE State: %d", status, le_status); - if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0) { + if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0) BT_DBG("no bluetooth device info, so BT was disabled at previous session"); - } - if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) { +#ifdef ENABLE_TIZEN_2_4 + if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) BT_ERR("no bluetooth le info, so BT LE was disabled at previous session"); - } +#endif if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0) BT_ERR("Fail to get the flight_mode_deactivation value"); @@ -111,13 +105,15 @@ static gboolean __bt_check_bt_core(void *data) if ((bt_status != VCONFKEY_BT_STATUS_OFF || bt_off_due_to_timeout) && (status == BT_DEACTIVATED)) { BT_DBG("Previous session was enabled."); - +#if 0 /* Enable the BT */ _bt_core_service_request_adapter(BT_ENABLE_ADAPTER); - _bt_enable_adapter(); + if (!TIZEN_FEATURE_BT_USB_DONGLE) + _bt_enable_adapter(); +#endif } else if (bt_status == VCONFKEY_BT_STATUS_OFF && (flight_mode_deactivation == 1 || ps_mode_deactivation > 0)) { - _bt_core_handle_flight_mode_noti(); + //_bt_core_handle_flight_mode_noti(); _bt_core_handle_power_saving_mode_noti(); _bt_core_set_bt_status(BT_FLIGHT_MODE, flight_mode_deactivation); @@ -126,10 +122,12 @@ static gboolean __bt_check_bt_core(void *data) if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) { BT_DBG("Previous session was le enabled. Turn BT LE on automatically."); - +#if 0 /* Enable the BT LE */ _bt_core_service_request_adapter(BT_ENABLE_ADAPTER_LE); - _bt_enable_adapter_le(); + if (!TIZEN_FEATURE_BT_USB_DONGLE) + _bt_enable_adapter_le(); +#endif } else { status = _bt_core_get_status(); le_status = _bt_core_get_le_status(); @@ -148,9 +146,10 @@ int main(void) gboolean ret; struct sigaction sa; - g_type_init(); BT_INFO_C("Starting bt-core daemeon"); + _bt_core_update_status(); + ret = _bt_core_register_dbus(); if (!ret) { BT_ERR("_bt_core_register_dbus failed");