2 * Copyright (c) 2015 -2016 Samsung Electronics Co., Ltd All Rights Reserved.
4 * Contact: Anupam Roy <anupam.r@samsung.com>
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #ifndef _BT_HAL_MSG_H_
22 #define _BT_HAL_MSG_H_
24 #define HAL_MINIMUM_EVENT 0x81
25 /*TODO: More events to be added in subsequent patches */
27 /* HAL Global Macros */
28 #define HAL_POWER_OFF 0x00
29 #define HAL_POWER_ON 0x01
31 #define HAL_PROP_ADAPTER_NAME 0x01
32 #define HAL_PROP_ADAPTER_ADDR 0x02
33 #define HAL_PROP_ADAPTER_UUIDS 0x03
34 #define HAL_PROP_ADAPTER_CLASS 0x04
35 #define HAL_PROP_ADAPTER_TYPE 0x05
36 #define HAL_PROP_ADAPTER_SERVICE_REC 0x06
37 #define HAL_PROP_ADAPTER_SCAN_MODE 0x07
38 #define HAL_PROP_ADAPTER_BONDED_DEVICES 0x08
39 #define HAL_PROP_ADAPTER_DISC_TIMEOUT 0x09
42 #define HAL_PROP_DEVICE_NAME 0x01
43 #define HAL_PROP_DEVICE_ADDR 0x02
44 #define HAL_PROP_DEVICE_UUIDS 0x03
45 #define HAL_PROP_DEVICE_CLASS 0x04
46 #define HAL_PROP_DEVICE_TYPE 0x05
47 #define HAL_PROP_DEVICE_SERVICE_REC 0x06
49 /* Tizen specific HAL Adapter and Device property types.
50 These properties have to added to HAL bt_property_type_t enums */
52 struct hal_prop_device_service_rec {
57 } __attribute__((packed));
59 #define HAL_PROP_DEVICE_FRIENDLY_NAME 0x0a
60 #define HAL_PROP_DEVICE_RSSI 0x0b
61 #define HAL_PROP_DEVICE_VERSION_INFO 0x0c
63 * Tizen specific HAL Adapter and Device property types.
64 * These properties have to added to HAL bt_property_type_t enums
66 #define HAL_PROP_DEVICE_PAIRED 0x0d
67 #define HAL_PROP_DEVICE_CONNECTED 0x0e
68 #define HAL_PROP_DEVICE_TRUSTED 0x0f
69 #define HAL_PROP_ADAPTER_PAIRABLE 0x10
70 #define HAL_PROP_ADAPTER_PAIRABLE_TIMEOUT 0x11
71 #define HAL_PROP_ADAPTER_VERSION 0x12
72 #define HAL_PROP_ADAPTER_IPSP_INITIALIZED 0x13
73 #define HAL_PROP_ADAPTER_MODALIAS 0x14
75 #define HAL_PROP_DEVICE_MANUFACTURER_DATA_LEN 0x15
76 #define HAL_PROP_DEVICE_MANUFACTURER_DATA 0x16
77 #define HAL_PROP_DEVICE_BLE_ADV_DATA 0x18
78 #define HAL_PROP_ADAPTER_LOCAL_LE_FEAT 0x19
80 struct hal_prop_device_info {
83 uint16_t manufacturer;
84 } __attribute__((packed));
86 #define HAL_PROP_DEVICE_TIMESTAMP 0xFF
88 #define HAL_EV_ADAPTER_STATE_CHANGED 0x00
89 struct hal_ev_adapter_state_changed {
91 } __attribute__((packed));
98 } __attribute__((packed));
100 #define HAL_EV_ADAPTER_PROPS_CHANGED 0x01
101 struct hal_ev_adapter_props_changed {
104 struct hal_property props[0];
105 } __attribute__((packed));
108 #define HAL_DISCOVERY_STATE_STOPPED 0x00
109 #define HAL_DISCOVERY_STATE_STARTED 0x01
111 #define HAL_EV_DISCOVERY_STATE_CHANGED 0x85
112 struct hal_ev_discovery_state_changed {
114 } __attribute__((packed));
116 #define HAL_EV_REMOTE_DEVICE_PROPS 0x83
117 struct hal_ev_remote_device_props {
121 struct hal_property props[0];
122 } __attribute__((packed));
124 #define HAL_EV_DEVICE_FOUND 0x84
125 struct hal_ev_device_found {
127 struct hal_property props[0];
128 } __attribute__((packed));
131 /* Device callbacks */
132 #define HAL_EV_PIN_REQUEST 0x86
133 struct hal_ev_pin_request {
136 uint32_t class_of_dev;
137 } __attribute__((packed));
139 #define HAL_EV_SSP_REQUEST 0x87
140 struct hal_ev_ssp_request {
143 uint32_t class_of_dev;
144 uint8_t pairing_variant;
146 } __attribute__((packed));
148 #define HAL_BOND_STATE_NONE 0
149 #define HAL_BOND_STATE_BONDING 1
150 #define HAL_BOND_STATE_BONDED 2
152 #define HAL_EV_BOND_STATE_CHANGED 0x88
153 struct hal_ev_bond_state_changed {
157 } __attribute__((packed));
159 #define HAL_ACL_STATE_CONNECTED 0x00
160 #define HAL_ACL_STATE_DISCONNECTED 0x01
162 #define HAL_EV_ACL_STATE_CHANGED 0x8A
163 struct hal_ev_acl_state_changed {
167 } __attribute__((packed));
169 #define BT_TRANSPORT_UNKNOWN 0x00
170 #define BT_TRANSPORT_BR_EDR 0x01
171 #define BT_TRANSPORT_LE 0x02
173 /* HID host events */
174 #define HAL_HIDHOST_STATE_CONNECTED 0x00
175 #define HAL_HIDHOST_STATE_CONNECTING 0x01
176 #define HAL_HIDHOST_STATE_DISCONNECTED 0x02
177 #define HAL_HIDHOST_STATE_DISCONNECTING 0x03
178 #define HAL_HIDHOST_STATE_NO_HID 0x07
179 #define HAL_HIDHOST_STATE_FAILED 0x08
180 #define HAL_HIDHOST_STATE_UNKNOWN 0x09
182 #define HAL_EV_HIDHOST_CONN_STATE 0x81
183 struct hal_ev_hidhost_conn_state {
186 } __attribute__((packed));
188 #define HAL_EV_HIDHOST_INFO 0x82
189 struct hal_ev_hidhost_info {
200 } __attribute__((packed));
202 #define HAL_EV_HIDHOST_PROTO_MODE 0x83
203 struct hal_ev_hidhost_proto_mode {
207 } __attribute__((packed));
209 #define HAL_EV_HIDHOST_IDLE_TIME 0x84
210 struct hal_ev_hidhost_idle_time {
214 } __attribute__((packed));
216 #define HAL_EV_HIDHOST_GET_REPORT 0x85
217 struct hal_ev_hidhost_get_report {
222 } __attribute__((packed));
224 #define HAL_EV_HIDHOST_VIRTUAL_UNPLUG 0x86
225 struct hal_ev_hidhost_virtual_unplug {
228 } __attribute__((packed));
230 #define HAL_EV_HIDHOST_HANDSHAKE 0x87
231 struct hal_ev_hidhost_handshake {
234 } __attribute__((packed));
236 #endif //_BT_HAL_MSG_H_