29ce3b3043c35505ef8f212c6bc984d215d87a7d
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-event-receiver.h
1 /*
2  * BLUETOOTH HAL
3  *
4  * Copyright (c) 2015 -2016 Samsung Electronics Co., Ltd All Rights Reserved.
5  *
6  * Contact: Anupam Roy <anupam.r@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *              http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef _BT_HAL_EVENT_RECEIVER_H_
23 #define _BT_HAL_EVENT_RECEIVER_H_
24
25 #include <glib.h>
26 #include <sys/types.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define DBUS_TIMEOUT 20 * 1000 /* 20 Sec */
33 #define BT_HAL_MAX_PROPERTY_BUF_SIZE 1024
34 #define BT_HAL_STACK_UUID_SIZE 16
35 #define MAX_UUID_COUNT 50
36 #define BT_HAL_DISCOVERY_FINISHED_DELAY 200
37
38 /* This is the callback method which handles events from stack */
39 typedef void (*handle_stack_msg) (int message, void *buf, uint16_t len);
40
41 int _bt_hal_initialize_event_receiver(handle_stack_msg cb);
42
43 typedef enum {
44         HAL_HIDHOST,
45         HAL_A2DP_SRC,
46         HAL_A2DP_SNK,
47         HAL_HF_AG,
48         HAL_AVRCP_TG,
49         HAL_AVRCP_CTRL,
50         HAL_GATT,
51 } bt_hal_module_e;
52
53 void _bt_hal_register_event_handler_cb(bt_hal_module_e module, handle_stack_msg cb);
54
55 void _bt_hal_unregister_event_handler_cb(bt_hal_module_e module);
56
57 handle_stack_msg _bt_hal_get_stack_message_handler(void);
58
59 int __bt_insert_hal_properties(void *buf, uint8_t type, uint16_t len, const void *val);
60
61 bool _bt_hal_get_adapter_request_state(void);
62
63 bool _bt_hal_get_le_request_state(void);
64
65 void _bt_hal_set_adapter_request_state(bool enable);
66
67 void _bt_hal_set_le_request_state(bool enable);
68
69 #ifdef __cplusplus
70 }
71 #endif /* __cplusplus */
72 #endif /* _BT_HAL_EVENT_RECEIVER_H_ */