cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the default timeout(10 seconds) of ACI_GAP_START_GENERAL_DISCOVERY_PROC event?

Shubham Trivedi
Associate III

I have successfully configuration P-NULCEO-WB55 as central(beacon observer) device using \STM32Cube_FW_WB_V1.4.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_p2pClient example. ACI_GAP_START_GENERAL_DISCOVERY_PROC event ends after 10 seconds. Is there any way to reduce this 10 seconds time?

12 REPLIES 12
Remi QUINTIN
ST Employee

​The aci_gap_start_general_discovery_proc function has 2 parameters: SCAN_P, SCAN_L which are both set to 500 ms (0x320 = 800) : 800 x 0.625ms (app_conf .h)

For more info you can look at AN5270 that lists all the BLE ACI functions.

From this AN5270:

The procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command ACI_GAP_TERMINATE_GAP_PROC with the procedure code set to 0x02 or a timeout happens. When the procedure is terminated due to any of the above reasons, ACI_GAP_PROC_COMPLETE_EVENT event is

returned with the procedure code set to 0x02

The timeout described here is 10s and is not configurable.

Thank you for this information. May i know this non configuration of timeout problem from BLUETOOTH SIG end or from ST end?

Aishwarya
Associate III

Hello Shubham,

I have the same issue , device stop scanning after 10 second, how to restart BLE scanning process after 10 seconds are more.

Shubham Trivedi
Associate III

Hi Aish,

You have to handle the general discovery process complete(GAP_GENERAL_DISCOVERY_PROC) event which belongs to EVT_BLUE_GAP_PROCEDURE_COMPLETE event code in SVCCTL_App_Notification function. upon receiving this event you should again start the discovery process.

Aishwarya
Associate III

Thanks Shubham,

I tried,but function (GAP_GENERAL_DISCOVERY_PROC) returns status ERR_NOT_ALLOW, also try aci_gap_terminate_pro(0x02) to terminate general discovery process but function(aci_gap_terminate_pro(0x02)) returns same status ERR_NOT_ALLOW.

Winfred LU
ST Employee

ACI_GAP_TERMINATE_GAP_PROC shall work.

Attached the screenshot terminating the scanning after 1 second.

0693W000005AGvIQAW.png

Aishwarya
Associate III

yes @Winfred LU

Open Winfred LU Preview

 I fallow the same steps but aci_gap_terminate_pro(0x02)  function returns status ERR_NOT_ALLOW.

Shubham Trivedi
Associate III

@Aishwarya​ Just curious to know that are you facing this problem while using STM32CubeMonRF software or while writing the code in STM32CubeIDE and executing on hardware? I have solutions for both.

Please refer to AN5270 - STM32WB Bluetooth® Low Energy (BLE) wireless interface

https://www.st.com/resource/en/application_note/dm00571230-stm32wb-bluetooth-low-energy-ble-wireless-interface-stmicroelectronics.pdf

section 2.4.23 ACI_GAP_START_GENERAL_DISCOVERY_PROC

The procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command ACI_GAP_TERMINATE_GAP_PROC with the procedure code set to 0x02 or a timeout happens (the timeout value is fixed at 10.24 s).

Please note that there is different ACI called ACI_GAP_TERMINATE, which is used to terminate the connection. Don't get confused with ACI_GAP_TERMINATE_GAP_PROC .