1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __ESP_NIMBLE_HCI_H__ 8 #define __ESP_NIMBLE_HCI_H__ 9 10 #include "nimble/transport.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 #define BLE_HCI_UART_H4_NONE 0x00 17 #define BLE_HCI_UART_H4_CMD 0x01 18 #define BLE_HCI_UART_H4_ACL 0x02 19 #define BLE_HCI_UART_H4_SCO 0x03 20 #define BLE_HCI_UART_H4_EVT 0x04 21 22 /** 23 * @brief Initialize VHCI transport layer between NimBLE Host and 24 * ESP Bluetooth controller 25 * 26 * This function initializes the transport buffers to be exchanged 27 * between NimBLE host and ESP controller. It also registers required 28 * host callbacks with the controller. 29 * 30 * @return 31 * - ESP_OK if the initialization is successful 32 * - Appropriate error code from esp_err_t in case of an error 33 */ 34 esp_err_t esp_nimble_hci_init(void); 35 36 /** 37 * @brief Deinitialize VHCI transport layer between NimBLE Host and 38 * ESP Bluetooth controller 39 * 40 * @note This function should be called after the NimBLE host is deinitialized. 41 * 42 * @return 43 * - ESP_OK if the deinitialization is successful 44 * - Appropriate error codes from esp_err_t in case of an error 45 */ 46 esp_err_t esp_nimble_hci_deinit(void); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* __ESP_NIMBLE_HCI_H__ */ 53