1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __ESP_BT_MAIN_H__ 8 #define __ESP_BT_MAIN_H__ 9 10 #include "esp_err.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @brief Bluetooth stack status type, to indicate whether the bluetooth stack is ready. 18 */ 19 typedef enum { 20 ESP_BLUEDROID_STATUS_UNINITIALIZED = 0, /*!< Bluetooth not initialized */ 21 ESP_BLUEDROID_STATUS_INITIALIZED, /*!< Bluetooth initialized but not enabled */ 22 ESP_BLUEDROID_STATUS_ENABLED /*!< Bluetooth initialized and enabled */ 23 } esp_bluedroid_status_t; 24 25 /** 26 * @brief Get bluetooth stack status 27 * 28 * @return Bluetooth stack status 29 * 30 */ 31 esp_bluedroid_status_t esp_bluedroid_get_status(void); 32 33 /** 34 * @brief Enable bluetooth, must after esp_bluedroid_init(). 35 * 36 * @return 37 * - ESP_OK : Succeed 38 * - Other : Failed 39 */ 40 esp_err_t esp_bluedroid_enable(void); 41 42 /** 43 * @brief Disable bluetooth, must prior to esp_bluedroid_deinit(). 44 * 45 * @return 46 * - ESP_OK : Succeed 47 * - Other : Failed 48 */ 49 esp_err_t esp_bluedroid_disable(void); 50 51 /** 52 * @brief Init and alloc the resource for bluetooth, must be prior to every bluetooth stuff. 53 * 54 * @return 55 * - ESP_OK : Succeed 56 * - Other : Failed 57 */ 58 esp_err_t esp_bluedroid_init(void); 59 60 /** 61 * @brief Deinit and free the resource for bluetooth, must be after every bluetooth stuff. 62 * 63 * @return 64 * - ESP_OK : Succeed 65 * - Other : Failed 66 */ 67 esp_err_t esp_bluedroid_deinit(void); 68 69 #ifdef __cplusplus 70 } 71 #endif 72 73 #endif /* __ESP_BT_MAIN_H__ */ 74