Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hci_driver.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_
11#define ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_
12
23#include <stdbool.h>
24#include <zephyr/net_buf.h>
27#include <zephyr/device.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33enum {
34 /* The host should never send HCI_Reset */
36 /* The controller does not auto-initiate a DLE procedure when the
37 * initial connection data length parameters are not equal to the
38 * default data length parameters. Therefore the host should initiate
39 * the DLE procedure after connection establishment. */
41};
42
56__deprecated int bt_recv(struct net_buf *buf);
57
71
72#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
79};
80#endif
81
90 const char *name;
91
94
101
111 int (*open)(void);
112
121 int (*close)(void);
122
135 int (*send)(struct net_buf *buf);
136
137#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
149 int (*setup)(const struct bt_hci_setup_params *params);
150#endif /* defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)*/
151};
152
165__deprecated int bt_hci_driver_register(const struct bt_hci_driver *drv);
166
178int bt_hci_transport_setup(const struct device *dev);
179
191int bt_hci_transport_teardown(const struct device *dev);
192
205
219
233
234#ifdef __cplusplus
235}
236#endif
237
242#endif /* ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_ */
Bluetooth data buffer API.
struct net_buf * bt_hci_evt_create(uint8_t evt, uint8_t len)
Allocate an HCI event buffer.
int bt_hci_driver_register(const struct bt_hci_driver *drv)
Register a new HCI driver to the Bluetooth stack.
struct net_buf * bt_hci_cmd_complete_create(uint16_t op, uint8_t plen)
Allocate an HCI Command Complete event buffer.
bt_hci_driver_bus
Possible values for the 'bus' member of the bt_hci_driver struct.
Definition hci_driver.h:59
struct net_buf * bt_hci_cmd_status_create(uint16_t op, uint8_t status)
Allocate an HCI Command Status event buffer.
int bt_recv(struct net_buf *buf)
Receive data from the controller/HCI driver.
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.
@ BT_QUIRK_NO_RESET
Definition hci_driver.h:35
@ BT_QUIRK_NO_AUTO_DLE
Definition hci_driver.h:40
@ BT_HCI_DRIVER_BUS_PCCARD
Definition hci_driver.h:62
@ BT_HCI_DRIVER_BUS_I2C
Definition hci_driver.h:68
@ BT_HCI_DRIVER_BUS_UART
Definition hci_driver.h:63
@ BT_HCI_DRIVER_BUS_SPI
Definition hci_driver.h:67
@ BT_HCI_DRIVER_BUS_RS232
Definition hci_driver.h:64
@ BT_HCI_DRIVER_BUS_IPM
Definition hci_driver.h:69
@ BT_HCI_DRIVER_BUS_VIRTUAL
Definition hci_driver.h:60
@ BT_HCI_DRIVER_BUS_PCI
Definition hci_driver.h:65
@ BT_HCI_DRIVER_BUS_SDIO
Definition hci_driver.h:66
@ BT_HCI_DRIVER_BUS_USB
Definition hci_driver.h:61
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
Buffer management.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Bluetooth Device Address.
Definition addr.h:40
Abstraction which represents the HCI transport to the controller.
Definition hci_driver.h:88
uint32_t quirks
Specific controller quirks.
Definition hci_driver.h:100
const char * name
Name of the driver.
Definition hci_driver.h:90
int(* open)(void)
Open the HCI transport.
Definition hci_driver.h:111
int(* send)(struct net_buf *buf)
Send HCI buffer to controller.
Definition hci_driver.h:135
enum bt_hci_driver_bus bus
Bus of the transport (BT_HCI_DRIVER_BUS_*)
Definition hci_driver.h:93
int(* close)(void)
Close the HCI transport.
Definition hci_driver.h:121
int(* setup)(const struct bt_hci_setup_params *params)
HCI vendor-specific setup.
Definition hci_driver.h:149
Definition bluetooth.h:34
bt_addr_t public_addr
The public identity address to give to the controller.
Definition bluetooth.h:39
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
Network buffer representation.
Definition net_buf.h:1006
uint16_t len
Length of the data behind the data pointer.
Definition net_buf.h:1035