4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Girishashok Joshi <girish.joshi@samsung.com>
8 * Chanyeol Park <chanyeol.park@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
25 #ifndef _BT_SERVICE_ADAPTER_LE_H_
26 #define _BT_SERVICE_ADAPTER_LE_H_
29 #include <sys/types.h>
30 #include "bluetooth-api.h"
36 #define BT_LE_SCAN_INTERVAL_MIN 2.5
37 #define BT_LE_SCAN_INTERVAL_MAX 10240
38 #define BT_LE_SCAN_WINDOW_MIN 2.5
39 #define BT_LE_SCAN_WINDOW_MAX 10240
42 BT_LE_AD_TYPE_INCOMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x02,
43 BT_LE_AD_TYPE_COMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x03,
44 BT_LE_AD_TYPE_INCOMP_LIST_128_BIT_SERVICE_CLASS_UUIDS = 0x06,
45 BT_LE_AD_TYPE_COMP_LIST_128_BIT_SERVICE_CLASS_UUIDS = 0x07,
46 BT_LE_AD_TYPE_SHORTENED_LOCAL_NAME = 0x08,
47 BT_LE_AD_TYPE_COMPLETE_LOCAL_NAME = 0x09,
48 BT_LE_AD_TYPE_LIST_16_BIT_SERVICE_SOLICITATION_UUIDS = 0x14,
49 BT_LE_AD_TYPE_LIST_128_BIT_SERVICE_SOLICITATION_UUIDS = 0x15,
50 BT_LE_AD_TYPE_SERVICE_DATA = 0x16,
51 BT_LE_AD_TYPE_MANUFACTURER_SPECIFIC_DATA = 0xFF,
52 } bt_le_advertising_data_type_e;
55 BT_LE_PASSIVE_SCAN = 0x00,
65 int _bt_service_adapter_le_init(void);
67 void _bt_service_adapter_le_deinit(void);
69 gboolean _bt_update_le_feature_support(const char *item, const char *value);
71 const char* _bt_get_adv_slot_owner(int slot_id);
73 int _bt_get_adv_slot_adv_handle(int slot_id);
75 void _bt_set_advertising_status(int slot_id, gboolean mode);
77 gboolean _bt_is_advertising(void);
79 void _bt_stop_advertising_by_terminated_process(const char* terminated_name);
81 int _bt_set_advertising(const char *sender, int adv_handle, gboolean enable, gboolean use_reserved_slot);
83 int _bt_set_custom_advertising(const char *sender, int adv_handle, gboolean enable, bluetooth_advertising_params_t *params, gboolean use_reserved_slot);
85 int _bt_get_advertising_data(bluetooth_advertising_data_t *adv, int *length);
87 int _bt_set_advertising_data(const char *sender, int adv_handle, bluetooth_advertising_data_t *data, int length, gboolean use_reserved_slot);
89 int _bt_get_scan_response_data(bluetooth_scan_resp_data_t *response, int *length);
91 int _bt_set_scan_response_data(const char *sender, int adv_handle, bluetooth_scan_resp_data_t *response, int length, gboolean use_reserved_slot);
93 int _bt_set_scan_parameters(bluetooth_le_scan_params_t *params);
95 int _bt_register_scan_filter(const char *sender, bluetooth_le_scan_filter_t *filter, int *slot_id);
97 int _bt_unregister_scan_filter(const char *sender, int slot_id);
99 int _bt_unregister_all_scan_filters(const char *sender);
101 int _bt_start_le_scan(const char *sender);
103 int _bt_stop_le_scan(const char *sender);
105 void _bt_disable_all_scanner_status(void);
107 void _bt_set_le_scan_status(gboolean mode);
109 gboolean _bt_is_le_scanning(void);
111 void _bt_set_le_scan_type(bt_le_scan_type_t type);
113 bt_le_scan_type_t _bt_get_le_scan_type(void);
115 void _bt_send_scan_result_event(const bt_remote_le_dev_info_t *le_dev_info, const bt_le_adv_info_t *adv_info);
117 int _bt_add_white_list(bluetooth_device_address_t *device_address, bluetooth_device_address_type_t address_type);
119 int _bt_remove_white_list(bluetooth_device_address_t *device_address, bluetooth_device_address_type_t address_type);
121 int _bt_clear_white_list(void);
125 #endif /* __cplusplus */
126 #endif /*_BT_SERVICE_ADAPTER_LE_H_*/