Note

There is a newer bugfix release of this version. The latest bugfix release is v5.0.7

BT MAIN API

API Reference

Header File

Functions

esp_bluedroid_status_t esp_bluedroid_get_status(void)

Get bluetooth stack status.

Returns

Bluetooth stack status

esp_err_t esp_bluedroid_enable(void)

Enable bluetooth, must after esp_bluedroid_init().

Returns

  • ESP_OK : Succeed

  • Other : Failed

esp_err_t esp_bluedroid_disable(void)

Disable bluetooth, must prior to esp_bluedroid_deinit().

Returns

  • ESP_OK : Succeed

  • Other : Failed

esp_err_t esp_bluedroid_init(void)

Init and alloc the resource for bluetooth, must be prior to every bluetooth stuff.

Returns

  • ESP_OK : Succeed

  • Other : Failed

esp_err_t esp_bluedroid_deinit(void)

Deinit and free the resource for bluetooth, must be after every bluetooth stuff.

Returns

  • ESP_OK : Succeed

  • Other : Failed

Enumerations

enum esp_bluedroid_status_t

Bluetooth stack status type, to indicate whether the bluetooth stack is ready.

Values:

enumerator ESP_BLUEDROID_STATUS_UNINITIALIZED

Bluetooth not initialized

enumerator ESP_BLUEDROID_STATUS_INITIALIZED

Bluetooth initialized but not enabled

enumerator ESP_BLUEDROID_STATUS_ENABLED

Bluetooth initialized and enabled