phy.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2011-2012 Intel Corporation
  7. * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
  8. *
  9. *
  10. */
  11. #include <stdbool.h>
  12. #include <stdint.h>
  13. struct bt_phy;
  14. struct bt_phy *bt_phy_new(void);
  15. struct bt_phy *bt_phy_ref(struct bt_phy *phy);
  16. void bt_phy_unref(struct bt_phy *phy);
  17. bool bt_phy_send(struct bt_phy *phy, uint16_t type,
  18. const void *data, size_t size);
  19. bool bt_phy_send_vector(struct bt_phy *phy, uint16_t type,
  20. const void *data1, size_t size1,
  21. const void *data2, size_t size2,
  22. const void *data3, size_t size3);
  23. typedef void (*bt_phy_callback_func_t)(uint16_t type, const void *data,
  24. size_t size, void *user_data);
  25. bool bt_phy_register(struct bt_phy *phy, bt_phy_callback_func_t callback,
  26. void *user_data);
  27. #define BT_PHY_PKT_NULL 0x0000
  28. #define BT_PHY_PKT_ADV 0x0001
  29. struct bt_phy_pkt_adv {
  30. uint8_t chan_idx;
  31. uint8_t pdu_type;
  32. uint8_t tx_addr_type;
  33. uint8_t tx_addr[6];
  34. uint8_t rx_addr_type;
  35. uint8_t rx_addr[6];
  36. uint8_t adv_data_len;
  37. uint8_t scan_rsp_len;
  38. } __attribute__ ((packed));
  39. #define BT_PHY_PKT_CONN 0x0002
  40. struct bt_phy_pkt_conn {
  41. uint8_t chan_idx;
  42. uint8_t link_type;
  43. uint8_t tx_addr_type;
  44. uint8_t tx_addr[6];
  45. uint8_t rx_addr_type;
  46. uint8_t rx_addr[6];
  47. uint8_t features[8];
  48. uint8_t id;
  49. } __attribute__ ((packed));