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

ThePetest
Posts: 6
Joined: Thu Dec 07, 2017 7:37 pm

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

Postby ThePetest » Wed Mar 07, 2018 1:15 pm

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.

ThePetest
Posts: 6
Joined: Thu Dec 07, 2017 7:37 pm

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

Postby ThePetest » Sun Mar 11, 2018 4:53 pm

Nobody has the same problem?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Mon Mar 12, 2018 3:30 am

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ThePetest
Posts: 6
Joined: Thu Dec 07, 2017 7:37 pm

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

Postby ThePetest » Mon Mar 12, 2018 3:45 pm

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.

Who is online

Users browsing this forum: Baidu [Spider] and 70 guests