3.0 specific patch: fix build error
[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
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #define CONNMAN_DBUS_NAME "net.connman"
37 #define CONNMAN_BLUETOOTH_TECHNOLOGY_PATH "/net/connman/technology/bluetooth"
38 #define CONNMAN_BLUETOTOH_TECHNOLOGY_INTERFACE "net.connman.Technology"
39
40 #define BT_CORE_NAME "org.projectx.bt_core"
41 #define BT_CORE_PATH "/org/projectx/bt_core"
42
43 #define BT_CORE_TYPE (bt_core_get_type())
44
45 typedef enum {
46         BT_DEACTIVATED,
47         BT_ACTIVATED,
48         BT_ACTIVATING,
49         BT_DEACTIVATING,
50 } bt_status_t;
51
52 typedef enum {
53         BT_LE_DEACTIVATED,
54         BT_LE_ACTIVATED,
55         BT_LE_ACTIVATING,
56         BT_LE_DEACTIVATING,
57 } bt_le_status_t;
58
59 typedef enum {
60         BT_POWER_SAVING_MODE,
61         BT_FLIGHT_MODE,
62         BT_RECOVERY_MODE,
63         BT_MODE_MAX
64 } bt_mode_e;
65
66 bt_status_t _bt_core_get_status(void);
67 bt_le_status_t _bt_core_get_le_status(void);
68 int _bt_core_get_bt_status(bt_mode_e mode);                     /* Get the status of BT before passed mode */
69 int _bt_core_get_bt_le_status(bt_mode_e mode);                  /* Get the status of BT LE before passed mode */
70 void _bt_core_set_bt_status(bt_mode_e mode, int status);        /* Set the status of BT before passed mode */
71 void _bt_core_set_bt_le_status(bt_mode_e mode, int status);     /* Set the status of BT LE before passed mode */
72
73 gboolean _bt_core_is_recovery_mode(void);
74 gboolean _bt_core_is_flight_mode_enabled(void);
75
76 int _bt_enable_adapter(void);
77 int _bt_disable_adapter(void);
78 int _bt_enable_adapter_le(void);
79 int _bt_disable_adapter_le(void);
80 int _bt_core_service_request_adapter(int service_function);
81
82 void _bt_core_adapter_added_cb(void);
83 void _bt_core_adapter_removed_cb(void);
84
85 gboolean _bt_core_enable_adapter(void);
86 gboolean _bt_core_disable_adapter(void);
87 gboolean _bt_core_recover_adapter(void);
88 gboolean _bt_core_enable_adapter_le(void);
89 gboolean _bt_core_disable_adapter_le(void);
90 gboolean __bt_core_reset_adapter(void);
91 gboolean _bt_core_enable_core(void);
92 gboolean _bt_core_factory_test_mode(const char *type, const char *arg);
93
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97 #endif /*_BT_CORE_ADAPTER_H_*/