5d1275d08802ffd8f144b9f49693a46479399979
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-adapter.h
1 /*
2  * bluetooth-frwk
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef _BT_SERVICE_ADAPTER_H_
21 #define _BT_SERVICE_ADAPTER_H_
22
23 #include <glib.h>
24 #include <sys/types.h>
25 #include "bluetooth-api.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 int _bt_enable_adapter(void);
39
40 int _bt_disable_adapter(void);
41
42 int _bt_reset_adapter(void);
43
44 void _bt_handle_adapter_added(void);
45
46 void _bt_handle_adapter_removed(void);
47
48 int _bt_check_adapter(int *status);
49
50 void _bt_set_enabled(void);
51
52 void _bt_set_disabled(void);
53
54 void *_bt_get_adapter_agent(void);
55
56 void _bt_set_discovery_status(gboolean mode);
57
58 int _bt_get_local_address(bluetooth_device_address_t *local_address);
59
60 int _bt_get_local_name(bluetooth_device_name_t *local_name);
61
62 int _bt_set_local_name(char *local_name);
63
64 int _bt_is_service_used(char *service_uuid, gboolean *used);
65
66 int _bt_get_discoverable_mode(int *mode);
67
68 int _bt_set_discoverable_mode(int discoverable_mode, int timeout);
69
70 int _bt_start_discovery(void);
71
72 int _bt_cancel_discovery(void);
73
74 int _bt_get_bonded_devices(GArray **dev_list);
75
76 int _bt_get_bonded_device_info(bluetooth_device_address_t *device_address,
77                                 bluetooth_device_info_t *dev_info);
78
79 int _bt_get_timeout_value(int *timeout);
80
81 gboolean _bt_is_discovering(void);
82
83 gboolean _bt_get_cancel_by_user(void);
84
85 void _bt_set_cancel_by_user(gboolean value);
86
87 gboolean _bt_get_discovering_property(void);
88
89 unsigned int _bt_get_discoverable_timeout_property(void);
90
91 void _bt_adapter_set_status(bt_status_t status);
92
93 bt_status_t _bt_adapter_get_status(void);
94
95 void _bt_handle_flight_mode_noti(void);
96
97 int _bt_get_remote_found_devices(GArray **dev_list);
98
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102 #endif /*_BT_SERVICE_ADAPTER_H_*/
103