|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Interfaces for Bluetooth Host Controller Interface (HCI). More...
Topics | |
| Bluetooth HCI Driver Backend API | |
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... | |
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. | |
Interfaces for Bluetooth Host Controller Interface (HCI).
| #define BT_DT_HCI_BUS_GET | ( | node_id | ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_BUS_INST_GET | ( | inst | ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_DRIVER_CONFIG_GET | ( | node_id | ) |
#include <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_NAME_INST_GET | ( | inst | ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_QUIRK_OR | ( | node_id, | |
| prop, | |||
| idx ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_QUIRKS_GET | ( | node_id | ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_DT_HCI_QUIRKS_INST_GET | ( | inst | ) |
#include <zephyr/drivers/bluetooth.h>
| #define BT_PRIV_HCI_BUS_DEFAULT (0) |
#include <zephyr/drivers/bluetooth.h>
| anonymous enum |
#include <zephyr/drivers/bluetooth.h>
| Enumerator | |
|---|---|
| BT_HCI_QUIRK_NO_RESET | |
| BT_HCI_QUIRK_NO_AUTO_DLE | |
|
inlinestatic |
#include <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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_SETUP must be selected for this field to be available.