Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / include / bt-core-adapter.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef _BT_CORE_ADAPTER_H_
25 #define _BT_CORE_ADAPTER_H_
26
27 #include <sys/types.h>
28 #include <sys/wait.h>
29 #include <dlog.h>
30 #include <glib.h>
31 #include <glib-object.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define BT_CORE_TYPE (bt_core_get_type())
38
39 typedef enum {
40         BT_DEACTIVATED,
41         BT_ACTIVATED,
42         BT_ACTIVATING,
43         BT_DEACTIVATING,
44 } bt_status_t;
45
46 typedef enum {
47         BT_LE_DEACTIVATED,
48         BT_LE_ACTIVATED,
49         BT_LE_ACTIVATING,
50         BT_LE_DEACTIVATING,
51 } bt_le_status_t;
52
53 typedef enum {
54         BT_POWER_SAVING_MODE,
55         BT_FLIGHT_MODE,
56         BT_RECOVERY_MODE,
57         BT_MODE_MAX
58 } bt_mode_e;
59
60 bt_status_t _bt_core_get_status(void);
61 bt_le_status_t _bt_core_get_le_status(void);
62 int _bt_core_get_bt_status(bt_mode_e mode);                     /* Get the status of BT before passed mode */
63 int _bt_core_get_bt_le_status(bt_mode_e mode);                  /* Get the status of BT LE before passed mode */
64 void _bt_core_set_bt_status(bt_mode_e mode, int status);        /* Set the status of BT before passed mode */
65 void _bt_core_set_bt_le_status(bt_mode_e mode, int status);     /* Set the status of BT LE before passed mode */
66
67 gboolean _bt_core_is_recovery_mode(void);
68 gboolean _bt_core_is_flight_mode_enabled(void);
69
70 int _bt_enable_adapter(void);
71 int _bt_disable_adapter(void);
72 int _bt_enable_adapter_le(void);
73 int _bt_disable_adapter_le(void);
74 int _bt_core_service_request_adapter(int service_function);
75
76 void _bt_core_adapter_added_cb(void);
77 void _bt_core_adapter_removed_cb(void);
78 GType bt_core_get_type (void);
79 #ifdef __cplusplus
80 }
81 #endif /* __cplusplus */
82 #endif /*_BT_CORE_ADAPTER_H_*/