2.8 RNBD451 Multi-Link and Multi-Role Implementation

Multi-Link Implementation

Multi-link in the context of Bluetooth Low Energy (BLE) devices refers to the ability of a BLE central device to simultaneously connect and communicate with multiple peripheral devices. This feature allows for more versatile and efficient communication between devices, making it particularly useful in applications where a central device needs to interact with several peripherals simultaneously.

Setting up Multi-Link Communication with RNBD451 BLE Modules

Prerequisites:

•Three RNBD451 Add On Board modules connected to a PC via USB.

•Serial terminals (e.g: Docklight Scripting tool) for communication with modules.

•Device Manager to identify the communication ports.

Step 1: Prepare the Environment

1. Open the Device Manager to identify the ports used for communication with the RNBD451 modules.

Step 2: Configure Serial Terminals

Open 3 separate instances of Docklight for the 3 different RNBD451 boards connected to the system with below mentioned settings.

•Baud Rate: 115200 (configure in the terminal emulator software).

•Data Bits: 8

•Stop Bits: 1

•Parity: None

•Flow Control: None

Step 3: Enter Command Mode

•In each Docklight instance, send the command $$$ to enter command mode. This will allow you to configure the modules.

Step 4: Set Device Names

  • Set unique device names for each module using the SN command(Set device name (SN, <text>) )
e.g., SN, central, SN, peripheral_1, and SN, peripheral_2.

Step 5: Set Default Services (SS) and Get Local Information(D)

Configure the default services to support device info and UART transparent services using the SS command, e.g., SS, C0.

Use the D command to get local information. You should see the names you set previously (central, peripheral_1, peripheral_2) and the activated services (C0).

Session 1: Peripheral to Central Data Transmission

Step 1: Connect Peripheral to Central

Connect the two peripherals to the central, using the Bluetooth addresses of each peripheral. Use the (C, 0, <address>) command.
Step 2: Data Transfer from Peripheral_1 to Central
  • Each character is sent individually, using the ASCII format: 'd' - 44, 'a' - 61, 't' - 74, 'a' - 61, '1' - 31, Carriage Return (CR) / Enter key - 0D0A.
  • For transmitting clustered characters, enter the data to be sent as a Sequence option on the top left corner.

Step 3: Data Transfer from Peripheral_2 to Central

Below captured screenshot shows the clustered data transfer from Peripheral_2 to Central.

Step 4: Monitor Connection Handles

At the Central side, each peripheral is referred with a connection handle. For example, connection handle associated with Peripheral_1 is 0071 and similarly, the connection handle associated with Peripheral_2 is 0072

Session 2: Central to peripheral data transmission

For transmitting data from the central to the peripherals, the IE command must be used.
For example, if you want to transmit 1234 to the peripheral1 module, the command that has to be written on the terminal which correspond to the central module is as follows:

Here is an example of the multi-link transmission. In which the Central device sends data “1234” to Peripheral_1 device and data “12345”to the Peripheral_2 device.

Notice that the handlers may differ from one connection to another. Below we can see that the handler for the peripheral1 is 0071 and for the peripheral2 it is 0072.

Multi-Role Implementation

Multi-role in Bluetooth Low Energy (BLE) refers to a feature that allows a BLE device to simultaneously perform different roles, such as being a central device (master) and a peripheral device (slave) in the same communication session. This feature enables greater flexibility in BLE applications by allowing a device to both initiate connections with other devices (central role) and accept connections from other devices (peripheral role) concurrently.

Now, let's integrate the multi-role feature into the existing multi-link test environment and provide a step-by-step guide:

In order to test the multi-role feature, connect the central module to the Microchip Bluetooth Data smartphone application. Where the current Central device will act as Central with both existing connection to Peripheral_1 and Periperal_2. At the same time, act as a peripheral role to the Central(mobile device)

At Central Side:

To set the multi-role in the Central device, initiate the command A. This command will make the Central device initiate advertisement and act as both a Central (with connections to Peripheral_1 and Peripheral_2) and a Peripheral (to the Central mobile device).
Open the Microchip Bluetooth Data (MBD) app, go to BLE UART, then PIC32CXBZ and initiate the scanning.
Initiate connection to the “Central” device by clicking on the device name from the scan list. At this moment, the connection will be established between the Mobile device and central device. The associated logs will be displayed in the serial log of Multi-link Multi-role device.
In the mobile application select the “Text mode” and type a text that needs to be transferred to the Multi-Role device. Eg: Hello
The message will be displayed in the Multi-Role device console .

Conclusion

The multi-link feature serves the purpose of sending data from a central module to multiple peripheral modules, allowing the option to selectively choose which peripheral receives specific data.

On the other hand, the multi-role feature proves valuable when we aim to collect data from peripherals, relay that data to the central module, and then forward it to a smartphone app. In this scenario, the central module assumes dual roles: as a central when acquiring data from the peripherals and as a peripheral when transmitting data to the MBD app. This is because the smartphone always functions as a central device. To transmit data from the peripherals to the MBD app, only the handler within the central module needs to be adjusted.