Zephyr API Documentation  3.6.99
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
54int bt_recv(struct net_buf *buf);
55
68};
69
70#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
77};
78#endif
79
88 const char *name;
89
92
99
109 int (*open)(void);
110
119 int (*close)(void);
120
133 int (*send)(struct net_buf *buf);
134
135#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
147 int (*setup)(const struct bt_hci_setup_params *params);
148#endif /* defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)*/
149};
150
162
174int bt_hci_transport_setup(const struct device *dev);
175
187int bt_hci_transport_teardown(const struct device *dev);
188
201
215
229
230#ifdef __cplusplus
231}
232#endif
233
238#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:57
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:60
@ BT_HCI_DRIVER_BUS_I2C
Definition: hci_driver.h:66
@ BT_HCI_DRIVER_BUS_UART
Definition: hci_driver.h:61
@ BT_HCI_DRIVER_BUS_SPI
Definition: hci_driver.h:65
@ BT_HCI_DRIVER_BUS_RS232
Definition: hci_driver.h:62
@ BT_HCI_DRIVER_BUS_IPM
Definition: hci_driver.h:67
@ BT_HCI_DRIVER_BUS_VIRTUAL
Definition: hci_driver.h:58
@ BT_HCI_DRIVER_BUS_PCI
Definition: hci_driver.h:63
@ BT_HCI_DRIVER_BUS_SDIO
Definition: hci_driver.h:64
@ BT_HCI_DRIVER_BUS_USB
Definition: hci_driver.h:59
#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:86
uint32_t quirks
Specific controller quirks.
Definition: hci_driver.h:98
const char * name
Name of the driver.
Definition: hci_driver.h:88
int(* open)(void)
Open the HCI transport.
Definition: hci_driver.h:109
int(* send)(struct net_buf *buf)
Send HCI buffer to controller.
Definition: hci_driver.h:133
enum bt_hci_driver_bus bus
Bus of the transport (BT_HCI_DRIVER_BUS_*)
Definition: hci_driver.h:91
int(* close)(void)
Close the HCI transport.
Definition: hci_driver.h:119
int(* setup)(const struct bt_hci_setup_params *params)
HCI vendor-specific setup.
Definition: hci_driver.h:147
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:399
Network buffer representation.
Definition: buf.h:1004
uint16_t len
Length of the data behind the data pointer.
Definition: buf.h:1033