Disable IPSP feature
[platform/upstream/bluez.git] / emulator / phy.h
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2011-2012  Intel Corporation
6  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
7  *
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public
11  *  License as published by the Free Software Foundation; either
12  *  version 2.1 of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free Software
21  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  *
23  */
24
25 #include <stdbool.h>
26 #include <stdint.h>
27
28 struct bt_phy;
29
30 struct bt_phy *bt_phy_new(void);
31
32 struct bt_phy *bt_phy_ref(struct bt_phy *phy);
33 void bt_phy_unref(struct bt_phy *phy);
34
35 bool bt_phy_send(struct bt_phy *phy, uint16_t type,
36                                         const void *data, size_t size);
37 bool bt_phy_send_vector(struct bt_phy *phy, uint16_t type,
38                                         const void *data1, size_t size1,
39                                         const void *data2, size_t size2,
40                                         const void *data3, size_t size3);
41
42 typedef void (*bt_phy_callback_func_t)(uint16_t type, const void *data,
43                                                 size_t size, void *user_data);
44
45 bool bt_phy_register(struct bt_phy *phy, bt_phy_callback_func_t callback,
46                                                         void *user_data);
47
48 #define BT_PHY_PKT_NULL         0x0000
49
50 #define BT_PHY_PKT_ADV          0x0001
51 struct bt_phy_pkt_adv {
52         uint8_t  pdu_type;
53         uint8_t  tx_addr_type;
54         uint8_t  tx_addr[6];
55         uint8_t  rx_addr_type;
56         uint8_t  rx_addr[6];
57         uint8_t  adv_data_len;
58         uint8_t  scan_rsp_len;
59 } __attribute__ ((packed));
60
61 #define BT_PHY_PKT_CONN         0x0002
62 struct bt_phy_pkt_conn {
63         uint8_t  link_type;
64         uint8_t  tx_addr_type;
65         uint8_t  tx_addr[6];
66         uint8_t  rx_addr_type;
67         uint8_t  rx_addr[6];
68         uint8_t  features[8];
69         uint8_t  id;
70 } __attribute__ ((packed));