Multi-Master Topology


Since Bluetooth 4.1, a slave device can connect to multiple masters. Silicon Labs Bluetooth stack supports connection to multiple masters simultaneously, with a maximum number of 8 masters. This document shows how to handle multiple connections in your Bluetooth application.

Multi-Slave Topology

Establishing Multiple Connections

Connections are initiated by master devices. For example, when a smartphone connects to your device, the smartphone will be the master and your device will be the slave.

To make connections possible, the slave device has to advertise itself with a connectable advertisement. A connectable advertisement can be started with the following command:


See the detailed description here: gecko_cmd_le_gap_start_advertising().

After the advertising is started, a master device can discover the slave, and it can send a connection request to it. When a connection request is received, the advertising is immediately stopped by the Bluetooth stack to avoid unintended multiple connections, and the connection is opened. This is signaled by a gecko_evt_le_connection_opened event. In case you want to enable connections for multiple masters, you have to re-start advertising upon receiving this event, with the very same command as before.

It is worth keeping count of the live connections, and not re-starting advertising after the limit of maximum number of connections is reached.

Saving Connection Handles

When a connection is opened, the stack returns a connection handle. Later, this handle can be used to differentiate between simultaneous connections. All connection-related commands require a connection handle and all connection-related events provide a connection handle. As a result, save the connection handles for future use, e.g., in a global variable.

struct {
    bd_addr device_address;
    uint8_t address_type;
    uint8_t connection_handle;
} connections[8];
uint8_t live_connections = 0;


  case gecko_evt_le_connection_opened_id:

    connections[live_connections].device_address = evt->data.evt_le_connection_opened.address;
    connections[live_connections].address_type = evt->data.evt_le_connection_opened.address_type;
    connections[live_connections].connection_handle = evt->data.evt_le_connection_opened.connection;



This guide has a related code example, here: Multi-Slave Multi-Master Dual Topology Example