A Bluetooth Low Energy device may need to connect to several peers while also making its own services available to another Central. The PSoC 6 BLE multi-connection code example demonstrates this arrangement with three Central connections and one Peripheral connection operating at the same time. Its Battery Service-based design offers engineers and system integrators a concrete way to examine BLE roles, GATT data exchange, and application task structure in a single project.
The example is built for PSoC 6 MCU devices with BLE connectivity and uses PSoC Creator, the Peripheral Driver Library, and FreeRTOS. It is a development reference rather than a complete industrial application: adapting it to a product requires checking the target device’s resources, application requirements, and hardware configuration.
How the PSoC 6 BLE multi-connection design works
The project combines two different link-layer roles in one device. Acting as a BLE Central, the PSoC 6 connects to as many as three Peripheral devices. Acting as a BLE Peripheral, it advertises a service that a separate Central—such as a phone or PC-based test tool—can access.
The application uses the Generic Attribute Profile (GATT) to organize the data exchanged over those connections. In the Central role, the PSoC 6 operates as a GATT Client and communicates with peer GATT Servers that provide a Battery Service. In its Peripheral role, the PSoC 6 operates as a GATT Server and exposes three Battery Services. These services represent the battery levels of the three Peripherals to which the device is connected.
This arrangement demonstrates how a single embedded device can collect service data from multiple peers and make data available through its own GATT server. The example focuses on Battery Service values and notifications; it does not define a general-purpose industrial data model or prescribe how application data should be processed.
Application structure: BLE, UART, and status tasks
The firmware is organized into three FreeRTOS tasks, separating connectivity and user-interface responsibilities:
- BLE task: Initializes the BLE host and processes general BLE events. A stack event handler receives general events, while a Battery Service callback handles events associated with service attribute operations.
- UART task: Provides the terminal interface used to enter commands and view status messages.
- Status LED task: Controls the state of the board’s status LEDs.
This division makes the example’s main responsibilities easier to follow: BLE event handling is distinct from terminal interaction and LED control. The project also uses a UART connection to present available commands and connection feedback, which is useful when observing behavior during development.
Setting up and testing the example
The documented hardware setup uses the CY8CKIT-062-BLE PSoC 6 BLE Pioneer Kit in its default configuration. The software requirements include PSoC Creator 4.2 and Peripheral Driver Library 3.0.3. A terminal emulator is required for the UART interface, and CySmart can act as the test Central. The example can be tested with the CySmart mobile application or the CySmart Host Emulation Tool on a PC.
To exercise the three Central connections, program another PSoC 6 or PSoC 4 device with the BLE Battery Level example and have it advertise. Open a serial terminal on the development kit’s KitProg2 COM port using the documented settings of 115200 baud, 8 data bits, no parity, and one stop bit. Build and program the multi-connection project, then use its terminal commands to scan for nearby devices and select one to connect. Repeat the connection process for additional Battery Service devices, up to the example’s maximum of three Peripheral connections.
To test the PSoC 6 device’s Peripheral role, use CySmart on a phone or PC. Start advertising from the terminal, scan for the device, and connect. In the client tool, inspect the Battery Service and enable notifications to observe characteristic values. The PC Host Emulation Tool workflow also supports pairing, attribute discovery, and enabling notifications. These steps let a developer verify both sides of the design: connections initiated by the PSoC 6 and connections accepted by it.
Configuration and adaptation considerations
The BLE component is configured for three Central roles and one Peripheral role. Other project components include UART and firmware-controlled digital output pins for status LEDs. The example’s pin assignments are intended for the CY8CKIT-062-BLE, so a different board may require changes in the Design Wide Resources pin settings.
When moving the project to another PSoC 6 device or kit, select the target device and review its supported hardware resources. The example documentation cautions that some resources used by a project may not exist on another device; targeting an unsupported resource can result in build errors. Engineers should therefore verify the device datasheet and update pin assignments as needed before treating a successful build as evidence that the full application is ready for deployment.
For additional visibility during debugging, the example provides a UART debug option. Setting the UART_DEBUG_ENABLE macro in uart_debug.h to true and rebuilding enables more verbose messages. This can help developers inspect the example’s runtime behavior while bringing up connections and service interactions.
Practical implications
The PSoC 6 BLE multi-connection example is useful for understanding how Central and Peripheral roles can coexist in one BLE application, and how GATT clients, servers, callbacks, and RTOS tasks fit into that design. Its three-Central, one-Peripheral configuration provides a defined starting point for prototyping multi-peer communication—not a guarantee that a particular application’s connection, timing, or resource needs will be met.
For engineering teams, the practical next step is to use the example to validate the intended BLE interaction, then assess device resources, board-specific pin assignments, service data, and application behavior against the actual design. Keeping those checks explicit helps turn a reference project into a better-informed foundation for a product implementation.