Re-base the codes as tizen 4.0 configurable architecture
[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 #ifdef TIZEN_FEATURE_BT_OBEX
46 typedef enum {
47         BT_LE_DEACTIVATED,
48         BT_LE_ACTIVATED,
49         BT_LE_ACTIVATING,
50         BT_LE_DEACTIVATING,
51 } bt_le_status_t;
52 #endif
53
54 int _bt_enable_adapter(void);
55
56 int _bt_disable_adapter(void);
57
58 int _bt_enable_core(void);
59
60 int _bt_enable_adapter_le(void);
61
62 int _bt_recover_adapter(void);
63
64 int _bt_start_discovery(unsigned short max_response,
65                 unsigned short duration, unsigned int cod_mask);
66
67 int _bt_cancel_discovery(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_init_profiles();
96
97 int _bt_cleanup_profiles(void);
98
99 #ifdef TIZEN_FEATURE_BT_OBEX
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_adapter_set_le_status(bt_le_status_t status);
106
107 bt_le_status_t _bt_adapter_get_le_status(void);
108
109 void _bt_set_disabled(int result);
110
111 typedef int (*bt_set_alarm_cb) (alarm_id_t alarm_id, void* user_param);
112 void *_bt_get_adapter_agent(void);
113
114 void _bt_handle_adapter_added(void);
115 #endif
116
117
118 #ifdef __cplusplus
119 }
120 #endif /* __cplusplus */
121 #endif /*_BT_SERVICE_CORE_ADAPTER_H_*/
122