]> rtime.felk.cvut.cz Git - tiny-bt.git/blob - src/hil2cap.h
part of support functions was added
[tiny-bt.git] / src / hil2cap.h
1 //
2 // C++ Interface: hil2cap
3 //
4 // Description: 
5 //
6 //
7 // Author: root <root@ubuntu>, (C) 2008
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef __HIL2CAP
13 #define __HIL2CAP
14
15 #include"hcidriver.h"
16 #include<asm/types.h>
17 #include<sys/socket.h>
18 #include<errno.h>
19
20 /* Connection states */
21 #define DISCONNECTED    0
22 #define CONNECTED       1
23 #define PENDING         2
24
25 /* CMD request states*/
26 #define FREE            0
27 #define ESTABLISHED     1
28 #define PENDING         2
29 #define DONE            3
30
31 /* CMD ocf and ogf */
32
33 #define INQUIRY_CMD_OP                  0x0104
34 #define INQUIRY_CANCEL_CMD_OP           0x0204
35 #define CREATE_CONNECTION_CMD_OP        0x0504
36 #define DISCONNECT_CMD_OP               0x0604
37 #define REMOTE_NAME_REQUEST_CMD_OP      0x1904
38 #define RESET_CMD_OP                    0x030C
39 #define WRITE_LOCAL_NAME_CMD_OP         0x130C
40 #define READ_LOCAL_NAME_CMD_OP          0x140C
41 #define READ_BD_ADDR_CMD_OP             0x0910
42
43
44 #define MAX_CMD_STATE_REQUEST 0x0F
45 typedef struct{
46         __u8 actual_status;
47         __u8 id;
48         __u16 req_opcode;
49         __u16 evt_code;  // code of expected ansver event , command status event will be accepted everytime
50         void *p_serv_rutine;
51
52 } __attribute__((packed)) cmd_state_request;
53
54 typedef struct{
55         __u16 con_id;
56         __u8 con_state;
57         int socket_fd;
58 }connection_hci;
59
60
61
62
63 //extern void show_all_local_dev(connection_hci *connection, bt_device *p_device);
64 //extern void call_hci_inquiry_cmd(dev_lap lap,__u8 inq_length,__u8 resp_count);
65 //extern void call_hci_create_connection(bt_address *dev_adress,unsigned short pkt_type,__u8 sc_mod);
66 //extern void call_hci_read_bd_addr_cmd(bt_device *p_device);
67 //extern void call_hci_read_local_name_cmd(bt_device *p_device);
68 //extern void create_BTsocket_connection(connection_hci *connection, bt_device *p_device);
69
70
71
72 #endif