Page 1 of 1

Any way to change the default timeout period for opening a BLE connection?

Posted: Wed Mar 07, 2018 1:15 pm
by ThePetest
Hi,
When I call esp_ble_gattc_open in the client and the server is not available, it takes 30 seconds until I get an ESP_GATTC_DISCONNECT_EVT event followed by an ESP_GATTC_OPEN_EVT event with the status parameter being ESP_GATT_ERROR. During these 30 seconds I can't do anything else related to BLE such as scanning but time efficiency would be very important for me. Is it possible to reduce this period? It would be just as fine to cancel the open command when I want but I haven't found a way to do this.

Re: Any way to change the default timeout period for opening a BLE connection?

Posted: Sun Mar 11, 2018 4:53 pm
by ThePetest
Nobody has the same problem?

Re: Any way to change the default timeout period for opening a BLE connection?

Posted: Mon Mar 12, 2018 3:30 am
by kolban
It might be that this link might be of some value to you. It talks about a function called esp_ble_gap_set_prefer_conn_params() that appears to allow one to set configuration parameter prior to requesting a connection.

Re: Any way to change the default timeout period for opening a BLE connection?

Posted: Mon Mar 12, 2018 3:45 pm
by ThePetest
Thanks for the hint. It should probably be effective but only as long as the BLE server complies with the preferred parameters. However in my case it wasn't effective. I think I will try reinitializing the BLE stack.