Function esp_idf_sys::esp_bt_controller_mem_release
source ยท pub unsafe extern "C" fn esp_bt_controller_mem_release(
mode: esp_bt_mode_t,
) -> esp_err_t
Expand description
@brief Release the Controller memory as per the mode
This function releases the BSS, data and other sections of the Controller to heap. The total size is about 70 KB.
@note
- This function is optional and should be called only if you want to free up memory for other components.
- This function should only be called when the controller is in
ESP_BT_CONTROLLER_STATUS_IDLE
status. - Once Bluetooth Controller memory is released, the process cannot be reversed. This means you cannot use the Bluetooth Controller mode that you have released using this function.
- If your firmware will upgrade the Bluetooth Controller mode later (such as switching from BLE to Classic Bluetooth or from disabled to enabled), then do not call this function.
If you never intend to use Bluetooth in a current boot-up cycle, calling esp_bt_controller_mem_release(ESP_BT_MODE_BTDM)
could release the BSS and data consumed by both Classic Bluetooth and BLE Controller to heap.
If you intend to use BLE only, calling esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT)
could release the BSS and data consumed by Classic Bluetooth Controller. You can then continue using BLE.
If you intend to use Classic Bluetooth only, calling esp_bt_controller_mem_release(ESP_BT_MODE_BLE)
could release the BSS and data consumed by BLE Controller. You can then continue using Classic Bluetooth.
@param[in] mode The Bluetooth Controller mode
@return - ESP_OK: Success - ESP_ERR_INVALID_STATE: Invalid Bluetooth Controller state - ESP_ERR_NOT_FOUND: Requested resource not found