[Bluetooth-Frwk] TCT Fixes over Latest Tizen branch
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / include / bt-service-core-adapter-le.h
1 /*
2  * Copyright (c) 2016 - 2017 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_LE_H_
22 #define _BT_SERVICE_CORE_ADAPTER_LE_H_
23
24 #include <glib.h>
25 #include <sys/types.h>
26 #include "bluetooth-api.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 typedef enum {
33         LE_DISCOVERY_STOPPED,
34         LE_DISCOVERY_STARTED,
35         LE_DISCOVERY_STARTING,
36         LE_DISCOVERY_STOPPING,
37 } bt_le_discovery_state_t;
38
39 typedef enum {
40         BT_LE_DEACTIVATED,
41         BT_LE_ACTIVATED,
42         BT_LE_ACTIVATING,
43         BT_LE_DEACTIVATING,
44 } bt_le_status_t;
45
46 int _bt_enable_adapter_le(void);
47
48 int _bt_disable_adapter_le(void);
49
50 int _bt_le_init(void);
51
52 void _bt_le_deinit(void);
53
54 int _bt_is_advertising(void);
55 int _bt_set_advertising(const char *sender, int adv_handle, gboolean enable, gboolean use_reserved_slot);
56
57 int _bt_set_custom_advertising(const char *sender, int adv_handle, gboolean enable, bluetooth_advertising_params_t *params, gboolean use_reserved_slot);
58
59 int _bt_set_advertising_data(const char *sender, int adv_handle, bluetooth_advertising_data_t *data, int length, gboolean use_reserved_slot);
60
61 int _bt_set_scan_response_data(const char *sender, int adv_handle, bluetooth_scan_resp_data_t *response, int length, gboolean use_reserved_slot);
62
63 int _bt_get_advertising_data(char *sender, int adv_handle, bluetooth_advertising_data_t *adv, int *length);
64
65 int _bt_get_scan_response_data(char *sender, int adv_handle, bluetooth_scan_resp_data_t *adv, int *length);
66
67 int _bt_start_le_scan(const char *sender);
68
69 int _bt_stop_le_scan(const char *sender);
70
71 int _bt_set_scan_parameters(bluetooth_le_scan_params_t *params);
72
73 gboolean _bt_is_le_scanning(void);
74
75 void _bt_check_le_scanner_app_termination(const char *sender);
76
77 void _bt_adapter_set_le_status(bt_le_status_t status);
78
79 bt_le_status_t _bt_adapter_get_le_status(void);
80
81 int _bt_service_le_init(void);
82
83 void _bt_service_le_deinit(void);
84
85 #ifdef __cplusplus
86 }
87 #endif /* __cplusplus */
88 #endif /*_BT_SERVICE_CORE_ADAPTER_LE_H_*/