[bluetooth-frwk] API defines
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / bt-core-main.c
old mode 100644 (file)
new mode 100755 (executable)
index 0d70d04..e5e7197
@@ -1,11 +1,5 @@
 /*
- * Bluetooth-frwk
- *
- * 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>
+ * 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.
@@ -80,7 +74,7 @@ static void __bt_core_sigterm_handler(int signo)
 static gboolean __bt_check_bt_core(void *data)
 {
        int bt_status = VCONFKEY_BT_STATUS_OFF;
-       int bt_le_status = 0;
+       int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
        bt_status_t status = BT_DEACTIVATED;
        bt_le_status_t le_status = BT_LE_DEACTIVATED;
        int flight_mode_deactivation = 0;
@@ -91,14 +85,12 @@ 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");
-       }
 
 #ifdef ENABLE_TIZEN_2_4
-       if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
+       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)
@@ -116,7 +108,7 @@ static gboolean __bt_check_bt_core(void *data)
 
                /* Enable the BT */
                _bt_core_service_request_adapter(BT_ENABLE_ADAPTER);
-#ifndef USB_BLUETOOTH
+#ifndef TIZEN_FEATURE_BT_USB_DONGLE
                _bt_enable_adapter();
 #endif
        } else if (bt_status == VCONFKEY_BT_STATUS_OFF &&
@@ -128,12 +120,12 @@ static gboolean __bt_check_bt_core(void *data)
                _bt_core_set_bt_status(BT_POWER_SAVING_MODE, ps_mode_deactivation);
        }
 
-       if ((bt_le_status == 1) && (le_status == BT_LE_DEACTIVATED)) {
+       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.");
 
                /* Enable the BT LE */
                _bt_core_service_request_adapter(BT_ENABLE_ADAPTER_LE);
-#ifndef USB_BLUETOOTH
+#ifndef TIZEN_FEATURE_BT_USB_DONGLE
                _bt_enable_adapter_le();
 #endif
        } else {
@@ -154,7 +146,6 @@ int main(void)
        gboolean ret;
        struct sigaction sa;
 
-       g_type_init();
        BT_INFO_C("Starting bt-core daemeon");
 
        _bt_core_update_status();