Merge "Add BT_SET_LE_STATIC_RANDOM_ADDRESS function" into tizen
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / include / bt-service-core-adapter.h
1 /*
2  * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Contact:  Anupam Roy <anupam.r@samsung.com>
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
21 #ifndef _BT_SERVICE_CORE_ADAPTER_H_
22 #define _BT_SERVICE_CORE_ADAPTER_H_
23
24 #include <sys/types.h>
25 #ifdef TIZEN_FEATURE_BT_OBEX
26 #include "alarm.h"
27 #endif
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 typedef enum {
33         ADAPTER_DISCOVERY_STOPPED,
34         ADAPTER_DISCOVERY_STARTED,
35         ADAPTER_DISCOVERY_STARTING,
36         ADAPTER_DISCOVERY_STOPPING,
37 } bt_adapter_discovery_state_t;
38
39 typedef enum {
40         BT_DEACTIVATED,
41         BT_ACTIVATED,
42         BT_ACTIVATING,
43         BT_DEACTIVATING,
44 } bt_status_t;
45
46 int _bt_enable_adapter(void);
47
48 int _bt_disable_adapter(void);
49
50 int _bt_reset_adapter(void);
51
52 int _bt_check_adapter(int *status);
53
54 int _bt_enable_core(void);
55
56 int _bt_recover_adapter(void);
57
58 int _bt_start_discovery(unsigned short max_response,
59                 unsigned short duration, unsigned int cod_mask);
60
61 int _bt_start_custom_discovery(bt_discovery_role_type_t role);
62
63 int _bt_cancel_discovery(void);
64
65 void _bt_service_register_vconf_handler(void);
66
67 void _bt_service_register_vconf_handler(void);
68
69 gboolean _bt_is_discovering(void);
70
71 int _bt_stack_init(void);
72
73 int _bt_get_local_address(void);
74
75 int _bt_get_local_version(void);
76
77 int _bt_get_local_name(void);
78
79 int _bt_set_local_name(char *local_name);
80
81 int _bt_get_discoverable_mode(int *mode);
82
83 int _bt_get_timeout_value(int *timeout);
84
85 int _bt_set_discoverable_mode(int discoverable_mode, int timeout);
86
87 gboolean _bt_is_connectable(void);
88
89 int _bt_is_service_used(void);
90
91 int _bt_set_connectable(gboolean connectable);
92
93 int _bt_adapter_get_bonded_devices(void);
94
95 int _bt_get_profile_connected_devices(char *profile_uuid, GArray **addr_list);
96
97 int _bt_init_profiles();
98
99 int _bt_cleanup_profiles(void);
100
101 void _bt_adapter_set_status(bt_status_t status);
102
103 bt_status_t _bt_adapter_get_status(void);
104
105 void _bt_set_disabled(int result);
106
107 int _bt_set_adapter_request_state(int enable);
108
109 int _bt_set_le_request_state(int enable);
110
111 #ifdef __cplusplus
112 }
113 #endif /* __cplusplus */
114 #endif /*_BT_SERVICE_CORE_ADAPTER_H_*/
115