BLE peripheral nimble unable to terminate connection
Posted: Thu Mar 10, 2022 4:53 pm
Hi,
We are working in an IOT device with a ESP32_WROOM using the idf4.3.2 SDK. The ESP32 works as ble peripheral with nimble.
ESP32 needs, as peripheral to be able to expel/terminate/close a bluetooth connection.
I tried with
but does not work. It returns error 0x212 that it comes from HCI errors as BLE_HS_EROLE error, whatever this means (I guess that this function only works for central role).
Which is the best way to force disconnect of a ble connection as peripheral?
We are working in an IOT device with a ESP32_WROOM using the idf4.3.2 SDK. The ESP32 works as ble peripheral with nimble.
ESP32 needs, as peripheral to be able to expel/terminate/close a bluetooth connection.
I tried with
Code: Select all
/**
* Terminates an established connection.
*
* @param conn_handle The handle corresponding to the connection to
* terminate.
* @param hci_reason The HCI error code to indicate as the reason
* for termination.
*
* @return 0 on success;
* BLE_HS_ENOTCONN if there is no connection with
* the specified handle;
* Other nonzero on failure.
*/
int ble_gap_terminate(uint16_t conn_handle, uint8_t hci_reason);
Which is the best way to force disconnect of a ble connection as peripheral?