Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
bt_hci_driver Struct Reference

Abstraction which represents the HCI transport to the controller. More...

#include <hci_driver.h>

Data Fields

const char * name
 
enum bt_hci_driver_bus bus
 
uint32_t quirks
 
int(* open )(void)
 Open the HCI transport. More...
 
int(* send )(struct net_buf *buf)
 Send HCI buffer to controller. More...
 

Detailed Description

Abstraction which represents the HCI transport to the controller.

This struct is used to represent the HCI transport to the Bluetooth controller.

Field Documentation

◆ bus

enum bt_hci_driver_bus bt_hci_driver::bus

Bus of the transport (BT_HCI_DRIVER_BUS_*)

◆ name

const char* bt_hci_driver::name

Name of the driver

◆ open

int(* bt_hci_driver::open) (void)

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.

If the driver uses its own RX thread, i.e. CONFIG_BT_RECV_IS_RX_THREAD is set, then this function is expected to start that thread.

Returns
0 on success or negative error number on failure.

◆ quirks

uint32_t bt_hci_driver::quirks

Specific controller quirks. These are set by the HCI driver and acted upon by the host. They can either be statically set at buildtime, or set at runtime before the HCI driver's open() callback returns.

◆ send

int(* bt_hci_driver::send) (struct net_buf *buf)

Send HCI buffer to controller.

Send an HCI command or ACL data to the controller. The exact type of the data can be checked with the help of bt_buf_get_type().

Note
This function must only be called from a cooperative thread.
Parameters
bufBuffer containing data to be sent to the controller.
Returns
0 on success or negative error number on failure.

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