Skip to main content
Shubham Trivedi
Associate III
March 4, 2020
Question

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

  • March 4, 2020
  • 9 replies
  • 3970 views

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?

This topic has been closed for replies.

9 replies

Remi QUINTIN
Technical Moderator
March 4, 2020

​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.

Shubham Trivedi
Associate III
March 5, 2020

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
November 2, 2020

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
November 2, 2020

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
November 2, 2020

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
November 4, 2020

ACI_GAP_TERMINATE_GAP_PROC shall work.

Attached the screenshot terminating the scanning after 1 second.

0693W000005AGvIQAW.png

Aishwarya
Associate III
November 4, 2020

yes @Winfred LU

Open Winfred LU Preview

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

Winfred LU
ST Employee
November 9, 2020

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 .

Shubham Trivedi
Associate III
November 7, 2020

@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.

Aishwarya
Associate III
November 9, 2020

@Shubham Trivedi​ 

problem statement- need continuous scanning until device is not connected to the server for this, start scanning using function aci_gap_start_general_discovery_proc(0x320, 0x320, 0X00, 1) who stop scanning process after 10.25 seconds, to restart general scanning process if device is not connected with server call function aci_gap_start_general_discovery_proc() again but -

  • In second time aci_gap_start_general_discovery_proc() return status ERR_NOT_ALLOW .
  • For this call function to terminate previous discovery process call function aci_gap_terminate_pro(0x02) .
  • but aci_gap_terminate_pro() function returns status ERR_NOT_ALLOW .

Problem Is Solved -

call Scan_Request() function in SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt ) EVT_BLUE_GAP_PROCEDURE_COMPLETE case .

In this program control not return to the case EVT_BLUE_GAP_PROCEDURE_COMPLETE if device is disconnected with sever.

DEdwi.1
Visitor II
November 26, 2020

@Aish , your understanding is correct, any connected procedure is assumed to be terminated if a disconnection happens in between. Do you get the DISCONNECTED event when the aci_gap_start_general_discovery_proc is running ?

Associate
November 1, 2023

Hi, 
I want to use my NECLEOWB55 as a central scanning device, I am setting the WPAN configuration as P2P server client mode. in the Scan_Request function I am getting 0x00 out of the  aci_gap_start_general_discovry_proc() function now how I can get the scanning result. and how to deal with the aci_gap_complete_event is this a function that require parameters and is there any examples of using this function ?