Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Enable multiple Bluetooth® LE connections in code example – KBA239611

lock attach
Attachments are accessible only for community members.

Enable multiple Bluetooth® LE connections in code example – KBA239611

Infineon_Team
Employee
Employee
50 replies posted 25 likes received 25 replies posted

Version: *A

This article describes how to simultaneously enable multiple Bluetooth® LE connections in code example (CE) using ModusToolbox™.

Note:  The following changes are made with reference to the code example, mtb-example-btstack-freertos-hello-sensor tested with the CYW43012 board. By default, the number of connections in the application is set to ‘1’.

Do the following to enable multiple connections, based on the number of connections supported by the device.


1.1 Changes in Bluetooth® Configurator

  1. Change the number of maximum client connections in Bluetooth® Configurator
  2. Set the value of maximum remote client/server connections as per the requirement.
Infineon_Team_3-1713173240662.png

Figure 1        Setting the value of maximum remote client/server connections

Figure 1 shows that the number of remote client connections is changed to ‘4’.


1.2 Start Advertisement


Start the Advertisement after every connection until the maximum number of connections is achieved.

In the GATT CONNECTION EVENT, start the advertisement after connection using the wiced_bt_start_advertisements() command.

Infineon_Team_2-1713173166767.png

Figure 2        Start Advertisement

1.3 Connection/Advertisement parameters

Follow the below steps if issues are encountered while connecting multiple number of supported devices:

1.3.1 Changing Advertisement and connection parameters.

Advertisement parameters can be changed in GAP Settings in the Bluetooth® Configurator.

Infineon_Team_1-1713173044887.png

Figure 3        Advertisement parameters

An update request can be sent to the central for connection parameters update using the wiced_bt_l2cap_update_ble_conn_params() command. It is up to the central to accept these recommendations or update the parameters to accommodate them.

Infineon_Team_0-1713172979048.png

Figure 4        Connection parameter update request

Note:  You can connect upto 15 Bluetooth® devices, but the constraints are memory limit, connection parameters including connection interval, length of connection event, and so on.

Note: For example, if you have multiple LE connections with a connection interval of 40 ms and each connection event is with 4 pairs of Tx/Rx (that is 5 ms CE), the maximum number of LE connections will be 40/5=8. If you want to perform other actions (such as maintaining a synchronous connection oriented(SCO) connection, doing advertisement, and so on), you will have the LE connections that are less than 8, even for the LE connection with the same connection parameters.

Note: Similar changes can also be made in the Linux code examples while enabling multiple simultaneous connections.

Sample project with changes (Bluetooth® Hello Sensor)

Note :  A sample code example to enable simultaneous multiple Bluetooth® connection is provided along with this document in the Hello_Sensor_Multiconnect.zip folder.

Attachments
184 Views