Merge "Invoke HAL_DISCOVERY_STATE_STOPPED event once" into tizen
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-internal.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_INTERNAL_H_
23 #define _BT_HAL_INTERNAL_H_
24
25 #include <glib.h>
26 #include <sys/types.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 typedef enum {
33         BT_HAL_MANAGER_EVENT = 0x01,
34         BT_HAL_ADAPTER_EVENT,
35         BT_HAL_LE_ADAPTER_EVENT,
36         BT_HAL_DEVICE_EVENT,
37         BT_HAL_HID_EVENT,
38         BT_HAL_NETWORK_EVENT,
39         BT_HAL_HEADSET_EVENT,
40         BT_HAL_AVRCP_EVENT,
41         BT_HAL_OPP_CLIENT_EVENT,
42         BT_HAL_OPP_SERVER_EVENT,
43         BT_HAL_PBAP_CLIENT_EVENT,
44         BT_HAL_RFCOMM_CLIENT_EVENT,
45         BT_HAL_RFCOMM_SERVER_EVENT,
46         BT_HAL_AGENT_EVENT,
47         BT_HAL_OBJECT_MANAGER_EVENT,
48         BT_HAL_MEDIA_TRANSFER_EVENT,
49         BT_HAL_HF_AGENT_EVENT,
50         BT_HAL_AVRCP_CONTROL_EVENT,
51         BT_HAL_A2DP_SOURCE_EVENT,
52         BT_HAL_HID_DEVICE_EVENT,
53         BT_HAL_GATT_EVENT,
54         /* Will be added */
55 } bt_hal_event_type_t;
56
57 /* Profile states matched to btd_service_state_t of bluez service.h */
58 typedef enum {
59         BT_HAL_PROFILE_STATE_UNAVAILABLE,
60         BT_HAL_PROFILE_STATE_DISCONNECTED,
61         BT_HAL_PROFILE_STATE_CONNECTING,
62         BT_HAL_PROFILE_STATE_CONNECTED,
63         BT_HAL_PROFILE_STATE_DISCONNECTING,
64 } bt_hal_profile_state_t;
65
66 /* UUIDs */
67 #define HID_UUID                "00001124-0000-1000-8000-00805f9b34fb"
68 #define HID_DEVICE_UUID         "00001124-0000-1000-8000-00805f9b43bf"
69 #define A2DP_SINK_UUID          "0000110b-0000-1000-8000-00805f9b34fb"
70 #define A2DP_SOURCE_UUID        "0000110a-0000-1000-8000-00805f9b34fb"
71 #define AVRCP_CTRL_UUID       "0000110e-0000-1000-8000-00805f9b34fb"
72 #define AVRCP_TARGET_UUID       "0000110c-0000-1000-8000-00805f9b34fb"
73 #define HFP_HF_UUID             "0000111e-0000-1000-8000-00805f9b34fb"
74 #define HFP_AG_UUID             "0000111f-0000-1000-8000-00805f9b34fb"
75
76 /**
77  * Device disconnection reasons; received from stack
78  */
79 #define BLUETOOTH_ERROR_PAGE_TIMEOUT    0x04
80 #define BLUETOOTH_ERROR_AUTH_FAILURE    0x05
81 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING      0x06
82 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT      0x08
83 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
84 #define BLUETOOTH_ERROR_REMOTE_USER_TERM        0x13
85 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES    0x14
86 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF        0x15
87 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
88 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS       0x17
89 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
90 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
91 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
92 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
93 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
94 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED     0x3e
95
96 /* TODO  More declarations to be added in subsequent patches */
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100 #endif /* _BT_HAL_INTERNAL_H_ */