cancel
Showing results for 
Search instead for 
Did you mean: 

P2P reduce time between CONNECTED and NOTIFICATION ENABLED

PCu1
Senior

Hello,

In a Client(Router)/Server configuration with two STM32WB55 I would like to accelerate the transmission of data at starting of the server.

The server address is know in advance and stored in the client then in the HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE client event I added aci_gap_terminate_gap_proc(GAP_GENERAL_DISCOVERY_PROC); which works well.

It connects immediately!

 

But between the Connection and the NOTIFICATION ENABLED, it takes 10 seconds, see the log:

 

 

15:35:57.717> ==>> aci_gap_set_discoverable - Success
15:35:57.717> ==>> Success: Start Fast Advertising 
15:35:58.009> 
15:35:58.009> >>== HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE - Connection handle: 0x801
15:35:58.009>      - Connection established with Central: @:00:80:e1:26:61:13
15:35:58.009>      - Connection Interval:    ms
15:35:58.009>      - Connection latency:    0
15:35:58.009>      - Supervision Timeout: 2100 ms
15:36:08.785> 
15:36:08.785> -- P2P APPLICATION SERVER : NOTIFICATION ENABLED

 

 

This post below suggests a solution, but important thing for me, the server will be disconnected from the power supply when it is not used. Then the handle is not rusable in my opinion.

https://community.st.com/t5/stm32-mcus-wireless/stm32wb-p2p-server-client-reducing-reconnection-time/m-p/304300

It means that it needs a little more than 10 seconds to send the first data and it is possible for the final application (until 4-5 seconds is acceptable)

I'm not sure that I can accelerate the discovery service! Does anyone have an idea?

Thank you,

Pierre

1 ACCEPTED SOLUTION

Accepted Solutions
_Joe_
ST Employee

Hi PCU1,
An easy way to boost the discovery process would be to change the connection interval (fastest = 7.5ms) during that time.
To do this from the server side, you can use the aci_l2cap_connection_parameter_update_req().
Or from the client side : aci_gap_start_connection_update().

Let me know if it is a relevant solution for your project ;)

BR, Joé

View solution in original post

2 REPLIES 2
_Joe_
ST Employee

Hi PCU1,
An easy way to boost the discovery process would be to change the connection interval (fastest = 7.5ms) during that time.
To do this from the server side, you can use the aci_l2cap_connection_parameter_update_req().
Or from the client side : aci_gap_start_connection_update().

Let me know if it is a relevant solution for your project ;)

BR, Joé

Hi @_Joe_ 

Thank you for your answer.

Indeed it is a solution with these parameters:

aci_gap_start_connection_update(pNotification->ConnectionHandle, 6, 6, 0, SUPERV_TIMEOUT, CONN_L1, CONN_L2);

it reduces the connection time from 10 seconds to ~5 seconds.

This gave me an idea for changing the time directly at the connection:

 

result = aci_gap_create_connection(SCAN_P,
                                       SCAN_L,
                                       GAP_PUBLIC_ADDR,
                                       P2P_SERVER1_BDADDR,
                                       GAP_PUBLIC_ADDR,
                                       /*CONN_P1*/6,
                                       /*CONN_P2*/10,
                                       0,
                                       SUPERV_TIMEOUT,
                                       CONN_L1,
                                       CONN_L2);

 

If I consider the client SUPERV_TIMEOUT has fired, the connection time is now less than 0.5 seconds after the connection to the power supply. It is exactly what I need 8)

Pierre