Adapt HF Profile Connect & Disconnect to BT HAL framework
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / inc / bt-hal-msg.h
1 /*
2  * Copyright (c) 2015 -2016 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_HAL_MSG_H_
22 #define _BT_HAL_MSG_H_
23
24 #define HAL_MINIMUM_EVENT               0x81
25 /*TODO: More events to be added in subsequent patches */
26
27 /* HAL Global Macros */
28 #define HAL_POWER_OFF                   0x00
29 #define HAL_POWER_ON                    0x01
30
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
40
41
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
48
49 /* Tizen specific HAL Adapter and Device property types.
50    These properties have to added to HAL bt_property_type_t enums */
51
52 struct hal_prop_device_service_rec {
53         uint8_t uuid[16];
54         uint16_t channel;
55         uint8_t name_len;
56         uint8_t name[];
57 } __attribute__((packed));
58
59 #define HAL_PROP_DEVICE_FRIENDLY_NAME            0x0a
60 #define HAL_PROP_DEVICE_RSSI                     0x0b
61 #define HAL_PROP_DEVICE_VERSION_INFO             0x0c
62 /*
63  * Tizen specific HAL Adapter and Device property types.
64  * These properties have to added to HAL bt_property_type_t enums
65  */
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
74
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            0x17
78 #define HAL_PROP_ADAPTER_LOCAL_LE_FEAT          0x18
79 #define HAL_PROP_DEVICE_IS_ALIAS_SET            0x19
80 #define HAL_PROP_ADAPTER_LE_DISCOVERY_FINISHED  0x1a
81
82 struct hal_prop_device_info {
83         uint8_t version;
84         uint16_t sub_version;
85         uint16_t manufacturer;
86 } __attribute__((packed));
87
88 #define HAL_PROP_DEVICE_TIMESTAMP               0xFF
89
90 #define HAL_EV_ADAPTER_STATE_CHANGED    0x00
91 struct hal_ev_adapter_state_changed {
92         uint8_t state;
93 } __attribute__((packed));
94
95
96 struct hal_property {
97         uint8_t  type;
98         uint16_t len;
99         uint8_t  val[0];
100 } __attribute__((packed));
101
102 #define HAL_EV_ADAPTER_PROPS_CHANGED    0x01
103 struct hal_ev_adapter_props_changed {
104         uint8_t              status;
105         uint8_t              num_props;
106         struct  hal_property props[0];
107 } __attribute__((packed));
108
109
110 #define HAL_DISCOVERY_STATE_STOPPED     0x00
111 #define HAL_DISCOVERY_STATE_STARTED     0x01
112
113 #define HAL_EV_DISCOVERY_STATE_CHANGED  0x85
114 struct hal_ev_discovery_state_changed {
115         uint8_t state;
116 } __attribute__((packed));
117
118 #define HAL_EV_REMOTE_DEVICE_PROPS      0x83
119 struct hal_ev_remote_device_props {
120         uint8_t             status;
121         uint8_t             bdaddr[6];
122         uint8_t             num_props;
123         struct hal_property props[0];
124 } __attribute__((packed));
125
126 #define HAL_EV_DEVICE_FOUND             0x84
127 struct hal_ev_device_found {
128         uint8_t             num_props;
129         struct hal_property props[0];
130 } __attribute__((packed));
131
132
133 /* Device callbacks */
134 #define HAL_EV_PIN_REQUEST              0x86
135 struct hal_ev_pin_request {
136         uint8_t  bdaddr[6];
137         uint8_t  name[249];
138         uint32_t class_of_dev;
139 } __attribute__((packed));
140
141 #define HAL_EV_SSP_REQUEST              0x87
142 struct hal_ev_ssp_request {
143         uint8_t  bdaddr[6];
144         uint8_t  name[249];
145         uint32_t class_of_dev;
146         uint8_t  pairing_variant;
147         uint32_t passkey;
148 } __attribute__((packed));
149
150 #define HAL_BOND_STATE_NONE 0
151 #define HAL_BOND_STATE_BONDING 1
152 #define HAL_BOND_STATE_BONDED 2
153
154 #define HAL_EV_BOND_STATE_CHANGED       0x88
155 struct hal_ev_bond_state_changed {
156         uint8_t status;
157         uint8_t bdaddr[6];
158         uint8_t state;
159 } __attribute__((packed));
160
161 #define HAL_EV_AUTHORIZE_REQUEST        0x89
162 struct hal_ev_authorize_request {
163         uint8_t  bdaddr[6];
164         uint32_t service_id;
165 } __attribute__((packed));
166
167 #ifdef TIZEN_BT_HAL
168 #define HAL_EV_SOCK_AUTHORIZE_REQUEST        0x90
169 struct hal_ev_sock_conn_auth {
170         uint8_t uuid[16];
171         uint8_t bdaddr[6];
172 } __attribute__((packed));
173 #endif //TIZEN_BT_HAL
174
175 #define HAL_ACL_STATE_CONNECTED         0x00
176 #define HAL_ACL_STATE_DISCONNECTED      0x01
177
178 #define HAL_EV_ACL_STATE_CHANGED        0x8A
179 struct hal_ev_acl_state_changed {
180         uint8_t status;
181         uint8_t bdaddr[6];
182         uint8_t state;
183 } __attribute__((packed));
184
185 #define HAL_DEVICE_TRUSTED         0x00
186 #define HAL_DEVICE_UNTRUSTED       0x01
187
188 #define HAL_EV_DEVICE_TRUST_CHANGED     0x8B
189 struct hal_ev_device_trust_state_changed {
190         uint8_t bdaddr[6];
191         uint8_t trust;
192 } __attribute__((packed));
193
194 #define BT_TRANSPORT_UNKNOWN            0x00
195 #define BT_TRANSPORT_BR_EDR             0x01
196 #define BT_TRANSPORT_LE                 0x02
197
198 /* HID host events */
199 #define HAL_HIDHOST_STATE_CONNECTED     0x00
200 #define HAL_HIDHOST_STATE_CONNECTING    0x01
201 #define HAL_HIDHOST_STATE_DISCONNECTED  0x02
202 #define HAL_HIDHOST_STATE_DISCONNECTING 0x03
203 #define HAL_HIDHOST_STATE_NO_HID        0x07
204 #define HAL_HIDHOST_STATE_FAILED        0x08
205 #define HAL_HIDHOST_STATE_UNKNOWN       0x09
206
207 #define HAL_EV_HIDHOST_CONN_STATE               0x81
208 struct hal_ev_hidhost_conn_state {
209         uint8_t bdaddr[6];
210         uint8_t state;
211 } __attribute__((packed));
212
213 #define HAL_EV_HIDHOST_INFO     0x82
214 struct hal_ev_hidhost_info {
215         uint8_t  bdaddr[6];
216         uint8_t  attr;
217         uint8_t  subclass;
218         uint8_t  app_id;
219         uint16_t vendor;
220         uint16_t product;
221         uint16_t version;
222         uint8_t  country;
223         uint16_t descr_len;
224         uint8_t  descr[884];
225 } __attribute__((packed));
226
227 #define HAL_EV_HIDHOST_PROTO_MODE       0x83
228 struct hal_ev_hidhost_proto_mode {
229         uint8_t bdaddr[6];
230         uint8_t status;
231         uint8_t mode;
232 } __attribute__((packed));
233
234 #define HAL_EV_HIDHOST_IDLE_TIME        0x84
235 struct hal_ev_hidhost_idle_time {
236         uint8_t bdaddr[6];
237         uint8_t status;
238         uint32_t idle_rate;
239 } __attribute__((packed));
240
241 #define HAL_EV_HIDHOST_GET_REPORT       0x85
242 struct hal_ev_hidhost_get_report {
243         uint8_t  bdaddr[6];
244         uint8_t  status;
245         uint16_t len;
246         uint8_t  data[0];
247 } __attribute__((packed));
248
249 #define HAL_EV_HIDHOST_VIRTUAL_UNPLUG   0x86
250 struct hal_ev_hidhost_virtual_unplug {
251         uint8_t  bdaddr[6];
252         uint8_t  status;
253 } __attribute__((packed));
254
255 #define HAL_EV_HIDHOST_HANDSHAKE        0x87
256 struct hal_ev_hidhost_handshake {
257         uint8_t  bdaddr[6];
258         uint8_t  status;
259 } __attribute__((packed));
260
261 /* Bluetooth Socket HAL events */
262 struct hal_ev_sock_connect {
263         short   size;
264         uint8_t bdaddr[6];
265         int     channel;
266         int     status;
267 } __attribute__((packed));
268
269 /* A2DP (AV) Headers */
270 #define HAL_EV_A2DP_STATE_DISCONNECTED             0x00
271 #define HAL_EV_A2DP_STATE_CONNECTING               0x01
272 #define HAL_EV_A2DP_STATE_CONNECTED                0x02
273 #define HAL_EV_A2DP_STATE_DISCONNECTING            0x03
274
275 #define HAL_EV_A2DP_CONN_STATE                  0x8C
276 struct hal_ev_a2dp_conn_state {
277         uint8_t state;
278         uint8_t bdaddr[6];
279 } __attribute__((packed));
280
281 #define HAL_AUDIO_SUSPEND                       0x00
282 #define HAL_AUDIO_STOPPED                       0x01
283 #define HAL_AUDIO_STARTED                       0x02
284
285 #define HAL_EV_A2DP_AUDIO_STATE                 0x8D
286 struct hal_ev_a2dp_audio_state {
287         uint8_t state;
288         uint8_t bdaddr[6];
289 } __attribute__((packed));
290
291 #define HAL_EV_A2DP_AUDIO_CONFIG                0x8E
292 struct hal_ev_a2dp_audio_config {
293         uint8_t  bdaddr[6];
294         uint32_t sample_rate;
295         uint8_t  channel_count;
296 } __attribute__((packed));
297
298 /* A2DP Sink Role connection*/
299 #define HAL_EV_A2DP_SOURCE_CONN_STATE                   0x8F
300
301 /* HandsFree Headers */
302 #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED        0x00
303 #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTING          0x01
304 #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTED           0x02
305 #define HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED       0x03
306 #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING       0x04
307
308 #define HAL_EV_HANDSFREE_CONN_STATE             0x91
309 struct hal_ev_handsfree_conn_state {
310         uint8_t state;
311         uint8_t bdaddr[6];
312 } __attribute__((packed));
313
314 #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED       0x00
315 #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING         0x01
316 #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED          0x02
317 #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTING      0x04
318
319 #define HAL_EV_HANDSFREE_AUDIO_STATE            0x92
320 struct hal_ev_handsfree_audio_state {
321         uint8_t state;
322         uint8_t bdaddr[6];
323 } __attribute__((packed));
324
325 /* HDP HAL Events */
326 #define HAL_EV_HDP_APP_REG_STATE            0x93
327 struct hal_ev_hdp_app_reg_state {
328         uint16_t app_id;
329         uint8_t state;
330 } __attribute__((packed));
331
332 #define HAL_EV_HDP_CONN_STATE            0x94
333 struct hal_ev_hdp_conn_state {
334         uint16_t app_id;
335         uint8_t bdaddr[6];
336         uint8_t mdep_index;
337         uint16_t channel_id;
338         uint8_t channel_state;
339         int32_t data_fd;
340 } __attribute__((packed));
341
342 /* AVRCP Controller Role HAL Events */
343 #define HAL_EV_AVRCP_CTRL_CONN_STATE            0x95
344 #define HAL_AVRCP_CTRL_STATE_DISCONNECTED 0x00
345 #define HAL_AVRCP_CTRL_STATE_CONNECTED 0x01
346 struct hal_ev_avrcp_ctrl_conn_state {
347         uint8_t state;
348         uint8_t bdaddr[6];
349 } __attribute__((packed));
350
351 #define HAL_EV_AVRCP_CTRL_PASS_THROUGH_RSP      0x96
352 struct hal_ev_pass_cmd_rsp {
353         uint8_t bdaddr[6];
354         int key_code;
355         int key_state;
356 } __attribute__((packed));
357
358 #define HAL_EV_AVRCP_CTRL_SET_PLAYER_APP_SETTING_RSP    0x97
359 #define HAL_AVRCP_PLAYER_APP_SETTING_REJECTED 0x00
360 #define HAL_AVRCP_PLAYER_APP_SETTING_ACCEPTED 0x01
361 struct hal_ev_set_player_app_setting_rsp {
362         uint8_t bdaddr[6];
363         uint8_t resp;
364 } __attribute__((packed));
365
366 #define HAL_EV_AVRCP_CTRL_PLAYER_APP_SETTING_CHANGED    0x98
367 #define HAL_MAX_APP_SETTINGS 8
368 #define HAL_PLAYER_ATTR_EQUALIZER 0x01
369 #define HAL_PLAYER_ATTR_REPEAT 0x02
370 #define HAL_PLAYER_ATTR_SHUFFLE 0x03
371 #define HAL_PLAYER_ATTR_SCAN 0x04
372 struct hal_ev_player_setting {
373         uint8_t bdaddr[6];
374         uint8_t num_attr;
375         uint8_t attr_ids[HAL_MAX_APP_SETTINGS];
376         uint8_t attr_values[HAL_MAX_APP_SETTINGS];
377 } __attribute__((packed));
378
379 #define HAL_EV_AVRCP_CTRL_TRACK_CHANGED         0x99
380 #define HAL_MAX_ATTR_STR_LEN 100
381 #define HAL_MAX_ATTR_NUM 10
382 #define HAL_MEDIA_ATTR_ID_INVALID -1
383 #define HAL_MEDIA_ATTR_ID_TITLE 0x00000001
384 #define HAL_MEDIA_ATTR_ID_ARTIST 0x00000002
385 #define HAL_MEDIA_ATTR_ID_ALBUM 0x00000003
386 #define HAL_MEDIA_ATTR_ID_TRACK_NUM 0x00000004
387 #define HAL_MEDIA_ATTR_ID_NUM_TRACKS 0x00000005
388 #define HAL_MEDIA_ATTR_ID_GENRE 0x00000006
389 #define HAL_MEDIA_ATTR_ID_PLAYING_TIME 0x00000007
390 struct hal_attr_val {
391         uint32_t attr_id;
392         uint8_t text[HAL_MAX_ATTR_STR_LEN];
393 } __attribute__((packed));
394
395 struct hal_ev_track_changed {
396         uint8_t bdaddr[6];
397         uint8_t num_attr;
398         struct hal_attr_val attr[HAL_MAX_ATTR_NUM];
399 } __attribute__((packed));
400
401 #define HAL_EV_AVRCP_CTRL_PLAY_POSITION_CHANGED         0xA0
402 struct hal_ev_play_position {
403         uint8_t bdaddr[6];
404         uint32_t len;
405         uint32_t pos;
406 } __attribute__((packed));
407
408 #define HAL_EV_AVRCP_CTRL_PLAY_STATUS_CHANGED           0xA1
409 #define HAL_PLAYSTATE_STOPPED 0x00    /* Stopped */
410 #define HAL_PLAYSTATE_PLAYING 0x01    /* Playing */
411 #define HAL_PLAYSTATE_PAUSED 0x02    /* Paused  */
412 #define HAL_PLAYSTATE_FWD_SEEK 0x03    /* Fwd Seek*/
413 #define HAL_PLAYSTATE_REV_SEEK 0x04    /* Rev Seek*/
414 #define HAL_PLAYSTATE_ERROR 0xFF    /* Error   */
415 struct hal_ev_play_status_changed {
416         uint8_t bdaddr[6];
417         uint8_t status;
418 } __attribute__((packed));
419
420 /* AVRCP TG events */
421 #ifdef TIZEN_BT_HAL
422 #define HAL_EV_AVRCP_TG_CONN_STATE              0xA2
423 #define HAL_EV_AVRCP_TG_DELAY_CHANGE    0xF1
424
425 #define HAL_AVRCP_TG_STATE_DISCONNECTED 0x00
426 #define HAL_AVRCP_TG_STATE_CONNECTED    0x01
427 struct hal_ev_avrcp_tg_conn_state{
428         uint8_t bdaddr[6];
429         uint8_t state;
430 } __attribute__((packed));
431
432 struct hal_ev_avrcp_tg_delay_changed{
433         uint8_t bdaddr[6];
434         uint16_t value;
435 } __attribute__((packed));
436
437 #endif /* TIZEN_BT_HAL */
438
439 #define HAL_EV_AVRCP_TG_SET_PLAYER_PROPERTY              0xA3
440
441 #define HAL_AVRCP_TG_PLAYER_PROP_EQUALIZER      0x00
442 #define HAL_AVRCP_TG_PLAYER_PROP_REPEAT         0x01
443 #define HAL_AVRCP_TG_PLAYER_PROP_SHUFFLE        0x02
444 #define HAL_AVRCP_TG_PLAYER_PROP_SCAN           0x03
445 struct hal_ev_avrcp_tg_player_property {
446         uint8_t prop_type;
447         uint8_t value;
448 } __attribute__((packed));
449
450 /* LE-GATT */
451 #define HAL_EV_SERVER_INSTANCE_INITIALIZED      0xA4
452 struct hal_ev_server_instance_registered {
453         uint32_t status;
454         uint32_t server_instance;
455         uint8_t app_uuid[16];
456 } __attribute__((packed));
457
458 #define HAL_EV_MULTI_ADV_DATA_SET               0xA5
459 struct hal_ev_multi_adv_data_set {
460         uint8_t status;
461         uint8_t server_instance;
462 } __attribute__((packed));
463
464 #define HAL_EV_MULTI_ADV_ENABLE                 0xA6
465 struct hal_ev_multi_adv_enable {
466         uint32_t status;
467         uint32_t server_instance;
468 } __attribute__((packed));
469
470 #define HAL_EV_MULTI_ADV_DISABLE                0xA7
471 struct hal_ev_multi_adv_disable {
472         uint32_t status;
473         uint32_t server_instance;
474 } __attribute__((packed));
475
476 #define HAL_EV_MULTI_ADV_UPDATE                 0xA8
477 struct hal_ev_multi_adv_update {
478         uint32_t status;
479         uint32_t server_instance;
480 } __attribute__((packed));
481
482 #define HAL_EV_LEGACY_ADV_ENABLE                0xA9
483 struct hal_ev_legacy_adv_status {
484         uint32_t status;
485         uint32_t server_instance;
486 } __attribute__((packed));
487
488 #define HAL_EV_GATT_CLIENT_REGISTERED   0xAA
489 struct hal_ev_gatt_client_registered {
490         uint32_t status;
491         uint32_t client_if;
492         uint8_t app_uuid[16];
493 } __attribute__((packed));
494
495 #define HAL_EV_GATT_CLIENT_SCAN_RESULT  0xAC
496 struct hal_ev_gatt_client_scan_result {
497         uint8_t  bd_addr[6];
498         uint8_t  addr_type;
499         uint8_t  adv_type;
500         int32_t  rssi;
501         uint16_t len;
502         uint8_t  adv_data[0];
503 } __attribute__((packed));
504
505 #define HAL_EV_GATT_SERVICE_ADDED               0xAD
506 struct hal_ev_gatt_service_added {
507         uint32_t status;
508         uint32_t server_instance;
509         uint8_t  is_primary;
510         uint8_t svc_uuid[16];
511         uint32_t service_handle;
512 } __attribute__((packed));
513
514 #define HAL_EV_GATT_CHAR_ADDED                  0xAE
515 struct hal_ev_gatt_char_added {
516         uint32_t status;
517         uint32_t server_instance;
518         uint32_t service_handle;
519         uint32_t char_handle;
520         uint8_t char_uuid[16];
521 } __attribute__((packed));
522
523 #define HAL_EV_GATT_DESC_ADDED                  0xAF
524 struct hal_ev_gatt_desc_added {
525         uint32_t status;
526         uint32_t server_instance;
527         uint32_t service_handle;
528         uint32_t desc_handle;
529         uint8_t desc_uuid[16];
530 } __attribute__((packed));
531
532 #define HAL_EV_GATT_SERVICE_STARTED             0xB0
533 struct hal_ev_gatt_service_started {
534         uint32_t status;
535         uint32_t server_instance;
536         uint32_t service_handle;
537 } __attribute__((packed));
538
539 #define HAL_EV_GATT_SERVICE_DELETED             0xB1
540 struct hal_ev_gatt_service_deleted {
541         uint32_t status;
542         uint32_t server_instance;
543         uint32_t service_handle;
544 } __attribute__((packed));
545
546 #define HAL_EV_GATT_SERVER_CONNECTED            0xB2
547 struct hal_ev_gatt_server_connected {
548         uint32_t conn_id;
549         uint32_t server_instance;
550         uint8_t connected;
551         uint8_t bdaddr[6];
552 } __attribute__((packed));
553
554 #define HAL_EV_GATT_READ_REQUESTED              0xB3
555 struct hal_ev_gatt_server_read_req {
556         uint32_t conn_id;
557         uint32_t trans_id;
558         uint8_t bdaddr[6];
559         uint32_t att_handle;
560         uint32_t offset;
561         uint8_t is_long;
562 } __attribute__((packed));
563
564 #define HAL_EV_GATT_WRITE_REQUESTED             0xB4
565 struct hal_ev_gatt_server_write_req {
566         uint32_t conn_id;
567         uint32_t trans_id;
568         uint8_t bdaddr[6];
569         uint32_t att_handle;
570         uint32_t offset;
571         uint32_t length;
572         uint8_t need_rsp;
573         uint8_t is_prep;
574         uint8_t value[600];
575 } __attribute__((packed));
576
577 #define HAL_EV_GATT_INDICATE_CFM                0xB5
578 struct hal_ev_gatt_server_indicate_cfm {
579         uint32_t conn_id;
580         uint32_t trans_id;
581         uint32_t att_handle;
582         uint8_t bdaddr[6];
583 } __attribute__((packed));
584
585 #ifdef TIZEN_BT_HAL
586 #define HAL_EV_GATT_NOTIFICATION_CHANGE         0xB6
587 struct hal_ev_gatt_server_notifcation_change {
588         uint32_t conn_id;
589         uint32_t trans_id;
590         uint32_t att_handle;
591         uint8_t notify;
592         uint8_t bdaddr[6];
593 } __attribute__((packed));
594
595 #define HAL_EV_LE_STATE_CHANGED    0xB7
596 struct hal_ev_le_state_changed {
597         uint8_t state;
598 } __attribute__((packed));
599 #endif /* TIZEN_BT_HAL */
600
601 #define HAL_LE_STATE_CONNECTED         0x00
602 #define HAL_LE_STATE_DISCONNECTED      0x01
603
604 #define HAL_EV_LE_CONN_STATE_CHANGED        0xB8
605 struct hal_ev_le_conn_state_changed {
606         uint8_t status;
607         uint8_t bdaddr[6];
608         uint8_t state;
609 } __attribute__((packed));
610
611 #define HAL_EV_DEVICE_TRUSTED_PROFILES_CHANGED  0xB9
612 struct hal_ev_device_trusted_profiles_changed {
613         uint8_t bdaddr[6];
614         uint32_t trust_val;
615 } __attribute__((packed));
616
617 #define HAL_RSSI_MONITORING_ENABLED     0x00
618 #define HAL_RSSI_MONITORING_DISABLED    0x01
619
620 #define HAL_EV_RSSI_MONITOR_STATE_CHANGED       0xBA
621 struct hal_ev_rssi_monitor_state_changed {
622         uint8_t bdaddr[6];
623         int32_t link_type;
624         uint8_t state;
625 } __attribute__((packed));
626
627 #define HAL_EV_RSSI_ALERT_RECIEVED      0xBB
628 struct hal_ev_rssi_alert_recieved {
629         uint8_t bdaddr[6];
630         int32_t link_type;
631         int32_t alert_type;
632         int32_t rssi;
633 } __attribute__((packed));
634
635 #define HAL_EV_RAW_RSSI_RECIEVED        0xBC
636 struct hal_ev_raw_rssi_recieved {
637         uint8_t bdaddr[6];
638         int32_t link_type;
639         int32_t rssi;
640 } __attribute__((packed));
641
642 #define HAL_EV_GATT_CLIENT_CONNECTED    0xBD
643 #define HAL_EV_GATT_CLIENT_DISCONNECTED  0xBE
644 struct hal_ev_gatt_client_connected {
645         int32_t conn_id;
646         int32_t status;
647         int32_t client_if;
648         uint8_t bdaddr[6];
649 } __attribute__((packed));
650
651 #define HAL_EV_GATT_CLIENT_SEARCH_RESULT        0xBF
652 struct hal_ev_gatt_client_search_result {
653         int32_t conn_id;
654         int32_t inst_id;
655         uint8_t uuid[16];
656         int32_t is_primary;
657 } __attribute__((packed));
658
659 #define HAL_EV_GATT_CLIENT_SEARCH_COMPLETE      0xC0
660 struct hal_ev_gatt_client_search_complete {
661         int32_t conn_id;
662         int32_t status;
663 } __attribute__((packed));
664
665 #define HAL_EV_GATT_CLIENT_CHARAC_SEARCH_RESULT 0xC1
666 struct hal_ev_gatt_client_char_search_result {
667         int32_t conn_id;
668         int32_t status;
669         int32_t is_primary;
670         int32_t inst_id;
671         uint8_t svc_uuid[16];
672         uint8_t char_uuid[16];
673         int32_t char_prop;
674 } __attribute__((packed));
675
676 #define HAL_EV_GATT_CLIENT_DESC_SEARCH_RESULT 0XC2
677 struct hal_ev_gatt_client_desc_search_result {
678         int32_t conn_id;
679         int32_t status;
680         int32_t is_primary;
681         int32_t inst_id;
682         uint8_t svc_uuid[16];
683         uint8_t char_uuid[16];
684         uint8_t desc_uuid[16];
685 } __attribute__((packed));
686
687 #define HAL_EV_GATT_CLIENT_READ_CHARAC  0XC3
688 #define HAL_EV_GATT_CLIENT_READ_DESC    0XC4
689 struct hal_ev_gatt_client_read_data {
690         int32_t conn_id;
691         int32_t status;
692         int32_t is_primary;
693         int32_t inst_id;
694         uint8_t svc_uuid[16];
695         uint8_t char_uuid[16];
696         uint8_t desc_uuid[16];
697         uint8_t value[600];
698         int32_t len;
699 } __attribute__((packed));
700
701 #define HAL_EV_GATT_CLIENT_WRITE_CHARAC 0XC5
702 #define HAL_EV_GATT_CLIENT_WRITE_DESC   0XC6
703 struct hal_ev_gatt_client_write_result {
704         int32_t conn_id;
705         int32_t status;
706         int32_t is_primary;
707         int32_t inst_id;
708         uint8_t svc_uuid[16];
709         uint8_t char_uuid[16];
710         uint8_t desc_uuid[16];
711 } __attribute__((packed));
712
713 #define HAL_EV_GATT_CLIENT_WATCH_NOTIFICATION  0XC7
714 struct hal_ev_gatt_client_watch_notification {
715         int32_t client_if;
716         int32_t registered;
717         int32_t status;
718         int32_t is_primary;
719         int32_t inst_id;
720         uint8_t svc_uuid[16];
721         uint8_t char_uuid[16];
722 } __attribute__((packed));
723
724 #define HAL_EV_GATT_ACQUIRE_WRITE  0XC8
725 struct hal_ev_gatt_acquire_write {
726         int32_t fd;
727         int32_t conn_id;
728         int32_t status;
729         uint8_t svc_uuid[16];
730         uint8_t char_uuid[16];
731 } __attribute__((packed));
732
733 #define HAL_EV_GATT_SERVER_ACQUIRE_WRITE_RES  0XC9
734 struct hal_ev_gatt_server_acquire_write_res {
735         int32_t mtu;
736         int32_t trans_id;
737         int32_t conn_id;
738         int32_t char_handl;
739         uint8_t bdaddr[6];
740 } __attribute__((packed));
741
742 #define HAL_EV_GATT_SERVER_ACQUIRE_NOTIFY_RES  0XCA
743 struct hal_ev_gatt_server_acquire_notify {
744         int32_t mtu;
745         int32_t trans_id;
746         int32_t conn_id;
747         int32_t char_handl;
748         char *path;
749 } __attribute__((packed));
750
751 #define HAL_EV_GATT_CLIENT_NOTIFY_CHANGED_VALUE 0XCB
752 struct hal_ev_gatt_client_notify_changed_value {
753         int32_t conn_id;
754         uint8_t value[600];
755         int32_t len;
756         uint8_t bdaddr[6];
757         int32_t is_primary;
758         int32_t inst_id;
759         uint8_t svc_uuid[16];
760         uint8_t char_uuid[16];
761         uint8_t is_notify;
762 } __attribute__((packed));
763
764 #define HAL_EV_GATT_SERVER_MTU_CHANGED 0XCC
765 struct hal_ev_gatt_server_mtu_changed {
766         int32_t conn_id;
767         int32_t mtu;
768 } __attribute__((packed));
769
770 /* HF Client Headers */
771 #define HAL_EV_HF_CLIENT_CONN_STATE_DISCONNECTED        0x00
772 #define HAL_EV_HF_CLIENT_CONN_STATE_CONNECTING          0x01
773 #define HAL_EV_HF_CLIENT_CONN_STATE_CONNECTED           0x02
774 #define HAL_EV_HF_CLIENT_CONN_STATE_SLC_CONNECTED       0x03
775 #define HAL_EV_HF_CLIENT_CONN_STATE_DISCONNECTING       0x04
776
777 #define HAL_EV_HF_CLIENT_CONN_STATE             0xCD
778 struct hal_ev_hf_client_conn_state {
779         uint8_t state;
780         uint8_t bdaddr[6];
781 } __attribute__((packed));
782 #endif //_BT_HAL_MSG_H_