Zephyr API Documentation 4.5.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Driver Operations Bluetooth HCI driver operations More...

#include <zephyr/drivers/bluetooth.h>

Data Fields

bt_hci_api_open_t open
  REQ Open the HCI transport.
bt_hci_api_close_t close
  OPT Close the HCI transport.
bt_hci_api_send_t send
  REQ Send HCI buffer to controller.
bt_hci_api_setup_t setup
  OPT HCI vendor-specific setup.

Detailed Description

Driver Operations Bluetooth HCI driver operations

This is the driver API structure any Bluetooth HCI driver needs to define. It contains function pointers to the operations the driver implements, as well as any other driver-specific constant data.

Members marked with REQ MUST be set by the driver, whereas those marked with OPT are optional.

See also
DEVICE_DT_INST_DEFINE()
DEVICE_DT_DEFINE()
DEVICE_API()

The operations serve any user of this API, of which the Bluetooth Host is only one: a controller-only application or a test opens, closes and sends in the same way. With the exception of setup(), they therefore do not use the Host's HCI command APIs (bt_hci_cmd_alloc(), bt_hci_cmd_send(), bt_hci_cmd_send_sync()). The allocators of the buffer API, bt_hci_recv() and bt_hci_recv_err() are what a driver delivers its data with, and not meant by that. A driver that has HCI commands of its own to exchange with its controller does so over its own transport, for which the Bluetooth HCI packet helpers and the Bluetooth HCI lockstep command helper exist, and only inside open() and close(), while the transport is not in the hands of its user.

bt_hci_open(), bt_hci_close() and bt_hci_send() are not safe to call concurrently for the same device: none of them may be called while another one, or another call of the same one, is in progress. A transport has one user, the one that opened it, which is the Bluetooth Host or, in a build without one, the application. That user makes its calls one at a time and within the limits that the three functions document, and a driver need not defend against anything else.

Field Documentation

◆ close

bt_hci_api_close_t bt_hci_driver_api::close

OPT Close the HCI transport.

◆ open

bt_hci_api_open_t bt_hci_driver_api::open

REQ Open the HCI transport.

◆ send

bt_hci_api_send_t bt_hci_driver_api::send

REQ Send HCI buffer to controller.

◆ setup

bt_hci_api_setup_t bt_hci_driver_api::setup

OPT HCI vendor-specific setup.

Attention
Available only when the following Kconfig option is enabled: CONFIG_BT_HCI_SETUP.
Deprecated
See bt_hci_setup().

The documentation for this struct was generated from the following file: