|
Zephyr Project API 4.5.0-rc2
A Scalable Open Source RTOS
|
@driver_ops{Bluetooth HCI} More...
#include <bluetooth.h>
Data Fields | |
| bt_hci_api_open_t | open |
| @driver_ops_mandatory Open the HCI transport. | |
| bt_hci_api_close_t | close |
| @driver_ops_optional Close the HCI transport. | |
| bt_hci_api_send_t | send |
| @driver_ops_mandatory Send HCI buffer to controller. | |
| bt_hci_api_setup_t | setup |
| @driver_ops_optional HCI vendor-specific setup. | |
@driver_ops{Bluetooth HCI}
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.
| bt_hci_api_close_t bt_hci_driver_api::close |
@driver_ops_optional Close the HCI transport.
| bt_hci_api_open_t bt_hci_driver_api::open |
@driver_ops_mandatory Open the HCI transport.
| bt_hci_api_send_t bt_hci_driver_api::send |
@driver_ops_mandatory Send HCI buffer to controller.
| bt_hci_api_setup_t bt_hci_driver_api::setup |
@driver_ops_optional HCI vendor-specific setup.
CONFIG_BT_HCI_SETUP.