2024-01-15 08:33 AM - edited 2024-01-15 08:33 AM
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.
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
Solved! Go to Solution.
2024-01-19 04:58 AM
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é
2024-01-19 04:58 AM
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é
2024-01-19 06:28 AM
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