|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Interfaces for Bluetooth Host Controller Interface (HCI). More...
Files | |
| file | bluetooth.h |
| Bluetooth HCI driver API. | |
Data Structures | |
| struct | bt_hci_setup_params |
| struct | bt_hci_driver_config |
| Common Bluetooth HCI driver configuration. More... | |
| struct | bt_hci_driver_data |
| Common Bluetooth HCI driver data. More... | |
| struct | bt_hci_driver_api |
| @driver_ops{Bluetooth HCI} More... | |
Macros | |
| #define | BT_DT_HCI_QUIRK_OR(node_id, prop, idx) |
| #define | BT_DT_HCI_QUIRKS_GET(node_id) |
| #define | BT_DT_HCI_QUIRKS_INST_GET(inst) |
| #define | BT_DT_HCI_NAME_GET(node_id) |
| #define | BT_DT_HCI_NAME_INST_GET(inst) |
| #define | BT_PRIV_HCI_BUS_DEFAULT (0) |
| #define | BT_DT_HCI_BUS_GET(node_id) |
| #define | BT_DT_HCI_BUS_INST_GET(inst) |
| #define | BT_DT_HCI_DRIVER_CONFIG_GET(node_id) |
Static initializer for bt_hci_driver_config struct. | |
| #define | BT_DT_HCI_DRIVER_CONFIG_INST_GET(inst) |
Static initializer for bt_hci_driver_config struct from DT_DRV_COMPAT instance. | |
Enumerations | |
| enum | { BT_HCI_QUIRK_NO_RESET = BIT(0) , BT_HCI_QUIRK_NO_AUTO_DLE = BIT(1) } |
Functions | |
| static int | bt_hci_recv_err (const struct device *dev, struct net_buf *buf) |
| Deliver an HCI packet from the driver. | |
| static void | bt_hci_recv (const struct device *dev, struct net_buf *buf) |
| Deliver an HCI packet from the driver. | |
| static int | bt_hci_open (const struct device *dev, bt_hci_recv_t recv) |
| Open the HCI transport. | |
| static int | bt_hci_close (const struct device *dev) |
| Close the HCI transport. | |
| static int | bt_hci_send (const struct device *dev, struct net_buf *buf) |
| Send HCI buffer to controller. | |
| static int | bt_hci_setup (const struct device *dev, struct bt_hci_setup_params *params) |
| HCI vendor-specific setup. | |
| typedef int(* | bt_hci_recv_t) (const struct device *dev, struct net_buf *buf) |
| @def_driverbackendgroup{Bluetooth HCI,bt_hci_api} | |
| typedef int(* | bt_hci_api_open_t) (const struct device *dev) |
| Callback API to open the HCI transport. | |
| typedef int(* | bt_hci_api_close_t) (const struct device *dev) |
| Callback API to close the HCI transport. | |
| typedef int(* | bt_hci_api_send_t) (const struct device *dev, struct net_buf *buf) |
| Callback API to send an HCI buffer to the controller. | |
| typedef int(* | bt_hci_api_setup_t) (const struct device *dev, const struct bt_hci_setup_params *param) |
| Callback API for HCI vendor-specific setup. | |
Interfaces for Bluetooth Host Controller Interface (HCI).
| #define BT_DT_HCI_BUS_GET | ( | node_id | ) |
#include <bluetooth.h>
| #define BT_DT_HCI_BUS_INST_GET | ( | inst | ) |
#include <bluetooth.h>
| #define BT_DT_HCI_DRIVER_CONFIG_GET | ( | node_id | ) |
#include <bluetooth.h>
Static initializer for bt_hci_driver_config struct.
| node_id | Devicetree node identifier |
| #define BT_DT_HCI_DRIVER_CONFIG_INST_GET | ( | inst | ) |
#include <bluetooth.h>
Static initializer for bt_hci_driver_config struct from DT_DRV_COMPAT instance.
| inst | DT_DRV_COMPAT instance number |
| #define BT_DT_HCI_NAME_GET | ( | node_id | ) |
#include <bluetooth.h>
| #define BT_DT_HCI_NAME_INST_GET | ( | inst | ) |
#include <bluetooth.h>
| #define BT_DT_HCI_QUIRK_OR | ( | node_id, | |
| prop, | |||
| idx ) |
#include <bluetooth.h>
| #define BT_DT_HCI_QUIRKS_GET | ( | node_id | ) |
#include <bluetooth.h>
| #define BT_DT_HCI_QUIRKS_INST_GET | ( | inst | ) |
#include <bluetooth.h>
| #define BT_PRIV_HCI_BUS_DEFAULT (0) |
#include <bluetooth.h>
| typedef int(* bt_hci_api_close_t) (const struct device *dev) |
#include <bluetooth.h>
Callback API to close the HCI transport.
See bt_hci_close() for argument description
| typedef int(* bt_hci_api_open_t) (const struct device *dev) |
#include <bluetooth.h>
Callback API to open the HCI transport.
See bt_hci_open() for argument description
#include <bluetooth.h>
Callback API to send an HCI buffer to the controller.
See bt_hci_send() for argument description
| typedef int(* bt_hci_api_setup_t) (const struct device *dev, const struct bt_hci_setup_params *param) |
#include <bluetooth.h>
Callback API for HCI vendor-specific setup.
See bt_hci_setup() for argument description
#include <bluetooth.h>
@def_driverbackendgroup{Bluetooth HCI,bt_hci_api}
Deliver HCI data from the controller to the host
Registered with bt_hci_open(). The HCI driver invokes this callback from thread context.
| anonymous enum |
#include <bluetooth.h>
| Enumerator | |
|---|---|
| BT_HCI_QUIRK_NO_RESET | |
| BT_HCI_QUIRK_NO_AUTO_DLE | |
|
inlinestatic |
#include <bluetooth.h>
Close the HCI transport.
Closes the HCI transport. This function must not return until the transport is closed.
| dev | HCI device |
|
inlinestatic |
#include <bluetooth.h>
Open the HCI transport.
Opens the HCI transport for operation. This function must not return until the transport is ready for operation, meaning it is safe to start calling the send() handler.
| dev | HCI device |
| recv | This is callback through which the HCI driver provides the host with data from the controller. The callback is expected to be called from thread context, and it may be called already before bt_hci_open() returns. |
| -EALREADY | The HCI transport is already open. |
#include <bluetooth.h>
Deliver an HCI packet from the driver.
This function is the same as bt_hci_recv_err except that it will internally handle error situations and always consume the buffer reference.
| dev | HCI device |
| buf | Buffer containing data received from the controller. |
#include <bluetooth.h>
Deliver an HCI packet from the driver.
This function is called by the HCI driver to deliver data received from the controller to the host. The buffer contains the raw HCI packet, including the packet type prefix encoded in the H:4 format.
If the function returns 0 (success) the reference to buf was moved to the higher layer (e.g. host stack). On error, the caller (HCI driver) still owns the reference and is responsible for eventually calling net_buf_unref on it.
| dev | HCI device |
| buf | Buffer containing data received from the controller. |
| -ENOTCONN | The HCI transport is not open. |
#include <bluetooth.h>
Send HCI buffer to controller.
Send an HCI packet to the controller. The packet type is encoded as H:4, i.e. the UART transport encoding, as a prefix to the actual payload. This means that HCI drivers that use H:4 as their native encoding don't need to do any special handling of the packet type.
If the function returns 0 (success) the reference to buf was moved to the HCI driver. On error, the caller still owns the reference and is responsible for eventually calling net_buf_unref on it.
| dev | HCI device |
| buf | Buffer containing data to be sent to the controller. |
|
inlinestatic |
#include <bluetooth.h>
HCI vendor-specific setup.
Executes vendor-specific commands sequence to initialize BT Controller before BT Host executes Reset sequence. This is normally called directly after bt_hci_open().
CONFIG_BT_HCI_SETUPmust be selected for this field to be available.