summaryrefslogtreecommitdiff
path: root/emulator/phy.h
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-14 05:05:19 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-12-14 05:14:37 +0100
commit03336eed5a314a01187243ecd3598a620f13b8a4 (patch)
treec5054b45b5cb040cbcf95ff7b8abc026d32e211c /emulator/phy.h
parent8470d254636888f0b1fee893b1c5192b240e5c95 (diff)
downloadbluez-03336eed5a314a01187243ecd3598a620f13b8a4.tar.gz
emulator: Add support for simple PHY simulation
Diffstat (limited to 'emulator/phy.h')
-rw-r--r--emulator/phy.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/emulator/phy.h b/emulator/phy.h
index a070e0353..6225bfb3a 100644
--- a/emulator/phy.h
+++ b/emulator/phy.h
@@ -22,9 +22,38 @@
*
*/
+#include <stdbool.h>
+#include <stdint.h>
+
struct bt_phy;
struct bt_phy *bt_phy_new(void);
struct bt_phy *bt_phy_ref(struct bt_phy *phy);
void bt_phy_unref(struct bt_phy *phy);
+
+bool bt_phy_send(struct bt_phy *phy, uint16_t type,
+ const void *data, size_t size);
+bool bt_phy_send_vector(struct bt_phy *phy, uint16_t type,
+ const void *data1, size_t size1,
+ const void *data2, size_t size2,
+ const void *data3, size_t size3);
+
+typedef void (*bt_phy_callback_func_t)(uint16_t type, const void *data,
+ size_t size, void *user_data);
+
+bool bt_phy_register(struct bt_phy *phy, bt_phy_callback_func_t callback,
+ void *user_data);
+
+#define BT_PHY_PKT_NULL 0x0000
+
+#define BT_PHY_PKT_ADV 0x0001
+struct bt_phy_pkt_adv {
+ uint8_t pdu_type;
+ uint8_t tx_addr_type;
+ uint8_t tx_addr[6];
+ uint8_t rx_addr_type;
+ uint8_t rx_addr[6];
+ uint8_t adv_data_len;
+ uint8_t scan_rsp_len;
+} __attribute__ ((packed));