|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Bluetooth HCI driver API. More...
#include <stdbool.h>#include <stdint.h>#include <zephyr/net_buf.h>#include <zephyr/bluetooth/buf.h>#include <zephyr/bluetooth/addr.h>#include <zephyr/bluetooth/hci_vs.h>#include <zephyr/device.h>Go to the source code of this file.
Data Structures | |
| struct | bt_hci_setup_params |
| struct | bt_hci_driver_api |
| Driver Operations Bluetooth HCI driver operations 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) |
Typedefs | |
| typedef int(* | bt_hci_recv_t) (const struct device *dev, struct net_buf *buf) |
| Deliver HCI data from the controller to the host. | |
| typedef int(* | bt_hci_api_open_t) (const struct device *dev, bt_hci_recv_t recv) |
| 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. | |
Enumerations | |
| enum | { BT_HCI_QUIRK_NO_RESET = BIT(0) , BT_HCI_QUIRK_NO_AUTO_DLE = BIT(1) } |
| enum | bt_hci_bus { BT_HCI_BUS_VIRTUAL = 0 , BT_HCI_BUS_USB = 1 , BT_HCI_BUS_PCCARD = 2 , BT_HCI_BUS_UART = 3 , BT_HCI_BUS_RS232 = 4 , BT_HCI_BUS_PCI = 5 , BT_HCI_BUS_SDIO = 6 , BT_HCI_BUS_SPI = 7 , BT_HCI_BUS_I2C = 8 , BT_HCI_BUS_SMD = 9 , BT_HCI_BUS_VIRTIO = 10 , BT_HCI_BUS_IPC = 11 } |
| Possible values for the 'bus' member of the bt_hci_driver struct. More... | |
Functions | |
| 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. | |
| int | bt_hci_transport_setup (const struct device *dev) |
| Setup the HCI transport, which usually means to reset the Bluetooth IC. | |
| int | bt_hci_transport_teardown (const struct device *dev) |
| Teardown the HCI transport. | |
| struct net_buf * | bt_hci_evt_create (uint8_t evt, uint8_t len) |
| Allocate an HCI event buffer. | |
| struct net_buf * | bt_hci_cmd_complete_create (uint16_t op, uint8_t plen) |
| Allocate an HCI Command Complete event buffer. | |
| struct net_buf * | bt_hci_cmd_status_create (uint16_t op, uint8_t status) |
| Allocate an HCI Command Status event buffer. | |
Bluetooth HCI driver API.
Main header file for Bluetooth HCI driver API.
Copyright (c) 2024 Johan Hedberg
SPDX-License-Identifier: Apache-2.0
Allocate an HCI Command Complete event buffer.
This function allocates a new buffer for HCI Command Complete event. It is given the OpCode (encoded e.g. using the BT_OP macro) and the total length of the parameters. Upon successful return the buffer is ready to have the parameters encoded into it.
| op | HCI command OpCode. |
| plen | Length of command parameters. |
Allocate an HCI Command Status event buffer.
This function allocates a new buffer for HCI Command Status event. It is given the OpCode (encoded e.g. using the BT_OP macro) and the status code. Upon successful return the buffer is ready to have the parameters encoded into it.
| op | HCI command OpCode. |
| status | Status code. |
Allocate an HCI event buffer.
This function allocates a new buffer for an HCI event. It is given the event code and the total length of the parameters. Upon successful return the buffer is ready to have the parameters encoded into it.
| evt | HCI event OpCode. |
| len | Length of event parameters. |
| int bt_hci_transport_setup | ( | const struct device * | dev | ) |
Setup the HCI transport, which usually means to reset the Bluetooth IC.
| dev | The device structure for the bus connecting to the IC |
| int bt_hci_transport_teardown | ( | const struct device * | dev | ) |
Teardown the HCI transport.
| dev | The device structure for the bus connecting to the IC |