Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-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
25 #ifndef _BT_SERVICE_ADAPTER_H_
26 #define _BT_SERVICE_ADAPTER_H_
27
28 #include <glib.h>
29 #include <sys/types.h>
30 #include "bluetooth-api.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #define BT_LE_SCAN_INTERVAL_MIN 2.5
37 #define BT_LE_SCAN_INTERVAL_MAX 10240
38 #define BT_LE_SCAN_WINDOW_MIN 2.5
39 #define BT_LE_SCAN_WINDOW_MAX 10240
40
41 typedef enum {
42         BT_DEACTIVATED,
43         BT_ACTIVATED,
44         BT_ACTIVATING,
45         BT_DEACTIVATING,
46 } bt_status_t;
47
48 typedef enum {
49         BT_LE_DEACTIVATED,
50         BT_LE_ACTIVATED,
51         BT_LE_ACTIVATING,
52         BT_LE_DEACTIVATING,
53 } bt_le_status_t;
54
55 typedef enum {
56         BT_LE_PASSIVE_SCAN = 0x00,
57         BT_LE_ACTIVE_SCAN
58 } bt_le_discovery_type_t;
59
60 int _bt_enable_adapter(void);
61
62 int _bt_disable_adapter(void);
63
64 int _bt_recover_adapter(void);
65
66 int _bt_enable_adapter_le(void);
67
68 int _bt_disable_adapter_le(void);
69
70 int _bt_reset_adapter(void);
71
72 int _bt_enable_core(void);
73
74 void _bt_handle_adapter_added(void);
75
76 void _bt_handle_adapter_removed(void);
77
78 int _bt_check_adapter(int *status);
79
80 void *_bt_get_adapter_agent(void);
81
82 void _bt_service_register_vconf_handler(void);
83
84 void _bt_service_unregister_vconf_handler(void);
85
86 void _bt_set_discovery_status(gboolean mode);
87
88 void _bt_set_le_discovery_status(gboolean mode);
89
90 void _bt_set_le_discovery_type(bt_le_discovery_type_t type);
91
92 bt_le_discovery_type_t _bt_get_le_discovery_type(void);
93
94 int _bt_get_local_address(bluetooth_device_address_t *local_address);
95
96 int _bt_get_local_version(bluetooth_version_t *local_version);
97
98 int _bt_get_local_name(bluetooth_device_name_t *local_name);
99
100 int _bt_set_local_name(char *local_name);
101
102 int _bt_is_service_used(char *service_uuid, gboolean *used);
103
104 int _bt_get_discoverable_mode(int *mode);
105
106 int _bt_set_discoverable_mode(int discoverable_mode, int timeout);
107
108 gboolean _bt_is_connectable(void);
109
110 int _bt_set_connectable(gboolean connectable);
111
112 int _bt_start_discovery(void);
113
114 int _bt_start_custom_discovery(bt_discovery_role_type_t role);
115
116 int _bt_cancel_discovery(void);
117
118 int _bt_start_le_discovery(void);
119
120 int _bt_stop_le_discovery(void);
121
122 int _bt_get_bonded_devices(GArray **dev_list);
123
124 int _bt_get_bonded_device_info(bluetooth_device_address_t *device_address,
125                                 bluetooth_device_info_t *dev_info);
126
127 int _bt_get_timeout_value(int *timeout);
128
129 gboolean _bt_is_discovering(void);
130
131 gboolean _bt_is_le_discovering(void);
132
133 int _bt_enable_rssi(bluetooth_device_address_t *bd_addr, int link_type,
134                 int low_threshold, int in_range_threshold, int high_threshold);
135
136 int _bt_get_rssi_strength(bluetooth_device_address_t *bd_addr,
137                 int link_type);
138
139 gboolean _bt_get_advertising_params(bluetooth_advertising_params_t *params);
140
141 gboolean _bt_get_cancel_by_user(void);
142
143 void _bt_set_cancel_by_user(gboolean value);
144
145 gboolean _bt_get_discovering_property(bt_discovery_role_type_t discovery_type);
146
147 unsigned int _bt_get_discoverable_timeout_property(void);
148
149 void _bt_adapter_set_status(bt_status_t status);
150
151 bt_status_t _bt_adapter_get_status(void);
152
153 void _bt_adapter_set_le_status(bt_le_status_t status);
154
155 bt_le_status_t _bt_adapter_get_le_status(void);
156
157 void _bt_adapter_start_enable_timer(void);
158
159 void _bt_adapter_start_le_enable_timer(void);
160
161 void _bt_set_disabled(int result);
162
163 void _bt_set_le_disabled(int result);
164
165 int _bt_set_le_privacy(gboolean set_privacy);
166
167 int _bt_set_manufacturer_data(bluetooth_manufacturer_data_t *m_data);
168
169 #ifdef __cplusplus
170 }
171 #endif /* __cplusplus */
172 #endif /*_BT_SERVICE_ADAPTER_H_*/
173