1787cc57948108d2e243700c2fba79769f771e97
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-adapter.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *              http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19 #ifndef _BT_SERVICE_ADAPTER_H_
20 #define _BT_SERVICE_ADAPTER_H_
21
22 #include <glib.h>
23 #include <sys/types.h>
24 #include "bluetooth-api.h"
25 #include "alarm.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef enum {
32         BT_DEACTIVATED,
33         BT_ACTIVATED,
34         BT_ACTIVATING,
35         BT_DEACTIVATING,
36 } bt_status_t;
37
38 typedef enum {
39         BT_LE_DEACTIVATED,
40         BT_LE_ACTIVATED,
41         BT_LE_ACTIVATING,
42         BT_LE_DEACTIVATING,
43 } bt_le_status_t;
44
45 int _bt_adapter_request_delayed(int function);
46
47 int _bt_enable_adapter_check_status(void);
48
49 int _bt_enable_adapter(void);
50
51 int _bt_disable_adapter_check_status(void);
52
53 void _bt_keep_bt_status_vconf(void);
54
55 int _bt_disable_adapter(void);
56
57 int _bt_recover_adapter(void);
58
59 int _bt_enable_adapter_le(void);
60
61 int _bt_disable_adapter_le(void);
62
63 int _bt_reset_adapter(void);
64
65 void _bt_set_bluetooth_status(void);
66
67 int _bt_enable_core(void);
68
69 void _bt_handle_adapter_added(void);
70
71 void _bt_handle_adapter_removed(void);
72
73 int _bt_check_adapter(int *status);
74
75 void *_bt_get_adapter_agent(void);
76
77 void _bt_service_register_vconf_handler(void);
78
79 void _bt_service_unregister_vconf_handler(void);
80
81 gboolean _bt_is_deactivated_by_flight_ps_mode(void);
82
83 void _bt_set_discovery_status(gboolean mode);
84
85 int _bt_get_local_address(bluetooth_device_address_t *local_address);
86
87 int _bt_get_local_version(bluetooth_version_t *local_version);
88
89 int _bt_get_local_name(bluetooth_device_name_t *local_name);
90
91 int _bt_set_local_name(char *local_name);
92
93 int _bt_is_service_used(char *service_uuid, gboolean *used);
94
95 int _bt_get_discoverable_mode(int *mode);
96
97 int _bt_set_discoverable_mode(int discoverable_mode, int timeout);
98
99 gboolean _bt_is_connectable(void);
100
101 int _bt_set_connectable(gboolean connectable);
102
103 int _bt_start_discovery(void);
104
105 int _bt_start_custom_discovery(bt_discovery_role_type_t role);
106
107 int _bt_cancel_discovery(void);
108
109 int _bt_get_bonded_devices(GArray **dev_list);
110
111 int _bt_get_profile_connected_devices(char *profile_uuid, GArray **addr_list);
112
113 int _bt_get_bonded_device_info(bluetooth_device_address_t *device_address,
114                                 bluetooth_device_info_t *dev_info);
115
116 int _bt_is_alias_set(bluetooth_device_address_t *device_address, gboolean *is_alias_set);
117
118 int _bt_get_timeout_value(int *timeout);
119
120 gboolean _bt_is_discovering(void);
121
122 int _bt_enable_rssi(bluetooth_device_address_t *bd_addr, int link_type,
123                 int low_threshold, int in_range_threshold, int high_threshold);
124
125 int _bt_get_rssi_strength(bluetooth_device_address_t *bd_addr,
126                 int link_type);
127
128 gboolean _bt_get_advertising_params(bluetooth_advertising_params_t *params);
129
130 gboolean _bt_get_cancel_by_user(void);
131
132 void _bt_set_cancel_by_user(gboolean value);
133
134 gboolean _bt_get_discovering_property(bt_discovery_role_type_t discovery_type);
135
136 unsigned int _bt_get_discoverable_timeout_property(void);
137
138 void _bt_adapter_set_status(bt_status_t status);
139
140 bt_status_t _bt_adapter_get_status(void);
141
142 void _bt_adapter_set_le_status(bt_le_status_t status);
143
144 bt_le_status_t _bt_adapter_get_le_status(void);
145
146 void _bt_adapter_set_vconf_status(gboolean enable);
147
148 void _bt_set_booting_time_flag(gboolean flag);
149
150 void _bt_set_le_intended_status(gboolean value);
151
152 void _bt_adapter_start_enable_timer(void);
153
154 void _bt_adapter_start_le_enable_timer(void);
155
156 void _bt_set_disabled(int result);
157
158 void _bt_set_le_disabled(int result);
159
160 int _bt_set_le_privacy(gboolean set_privacy);
161
162 int _bt_set_le_static_random_address(gboolean is_enable);
163
164 int _bt_set_manufacturer_data(bluetooth_manufacturer_data_t *m_data);
165
166 void _bt_start_log_dump(const char *path);
167
168 int _bt_disable_cb(void);
169
170 int _bt_get_enable_timer_id(void);
171
172 void _bt_force_hci_dump(int timeout);
173
174 typedef int (*bt_set_alarm_cb) (alarm_id_t alarm_id, void* user_param);
175
176 int _bt_service_set_alarm(int timeout, bt_set_alarm_cb call_back,
177                                 void *user_data, alarm_id_t *alarm_id);
178
179 int _bt_service_remove_alarm(alarm_id_t alarm_id);
180
181 gint compare_alarm(gconstpointer list_data, gconstpointer data);
182 #ifdef __cplusplus
183 }
184 #endif /* __cplusplus */
185 #endif /*_BT_SERVICE_ADAPTER_H_*/
186