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