STM32WBA Bluetooth® LE – Peer 2 Peer Applications

Revision as of 16:47, 23 January 2023 by Registered User (→‎STM32WBA Peer to Peer Server application)

1. Peer to Peer Profile

The Peer to Peer Profile is a Generic Attribute Profile (GATT) based low-energy profile defined by STMicroelectronics with proprietary UUIDs(128 bits)
The Peer to Peer Profile, widely used for direct connection, defines the communication between a GATT-server of a Peer to Peer Server device, and a GATT-client Collector device, such as a smartphone, STM32WBA Peer to Peer Client or Peer to Peer Router devices.

  • The Peer to Peer Server:
    • Contains the P2P Service, which expose two characteristics (Notification & Write) in order to create a bi-direction data communication.
    • Is the GATT server.
  • The Collector:
    • Accesses the information exposed by Peer to Peer Server, controls it with the Write characteristics, receives Notification from it.
    • Is the GATT client.

This wiki page is the description of the Peer to Peer Server and Peer to Peer Client projects provided within the STM32CubeWBA MCU Package[1]

Follow this "link" for Peer to Peer Router project explanation.

Bluetooth® LE Peer to Peer Profile & STM32WBA
STM32WBA P2P Profile


1.1. STM32WBA Peer to Peer Server application

The table below describes the structure of Peer to Peer service:

Bluetooth® LE Peer to Peer Service specification
Service Characteristic Mode UUID size
P2P Service 0000FE40-cc7a-482a-984a-7f2ed5b3e58f
LED Write without Response/Read 0000FE41-8e22-4541-9d4c-21edae82ed19 2
SWITCH Notify 0000FE42-8e22-4541-9d4c-21edae82ed19 2

Peer To Peer Server is exported as a Service

  • LED characteristic:
    • Used to control LED1 (Blue) on STM32WBA platform by remote device .
Peer to Peer Service - LED Characteristic
Byte Index 0 1
Name LED Selection LED Level
Value 0x01: blue LED 0x00: LEDoff
0x01: LEDon
  • SWITCH Characteristic:
    • Used to switch LED or Lamp on Collector device.
Peer to Peer Service - SWITCH Characteristic
Byte Index 0 1
Name Button Selection Status
Value 0x01: button1 0x00 or 0x01


Example of flow diagram between STM32WBA & ST BLE Toolbox
STM32WBA P2P Flow Diagram


At start up, Peer To Peer Server application starts Advertising including the Manufacturer Advertising Elements as described below:

0 1 2-3 4 5 6 7 8 9 10-15
Length Manufacturer ID Company BlueSTSDK Version Device ID Firmware ID Option 1 Option 2 Option 3 Device Address
P2P Server 0x0F 0xFF 0x0030 STMicro 0x02 0x8B Nucleo-WBA 0x83 0x00 0x00 0x00 0x08E12Axxxx

Advertising is stopped after 30s, pressing B1 restart it.

1.2. STM32WBA Peer to Peer Client application

No categories assignedEdit