1. Data Throughput
Data Throughput applications (BLE_DataThroughput_Client and BLE_DataThroughput_Server) are proprietary applications used to measure the throughput between devices according to different parameters, 1M or 2M PHY, different connection intervals.
The Data Throughput Server is the device exposing three characteristics to be controlled by the remote client
- Characteristics DATA_TRANSFER_TX (Notification) to notify data from Server TO Client
- Characteristics DATA_TRANSFER_RX (Write) to Send data from Client TO Server
- Characteristics DATA_TRANSFER_TX_RX_INFO (Notification) to notify throughput measurement of data received
The Central & GATT Client Collector can be three different applications
- Data Throughput Client to measure performances between 2 STM32WBA devices
- Smartphone ST BLE Toolbox to performs Smartphone benchmarking
- Web Bluetooth Interface to use laptop
This wiki page is the description of the Data throughput project provided within the STM32CubeWBA MCU Package[1]
Bluetooth® LE Data Throughput project & STM32WBA |
---|
The table below describes the structure of Data Throughput service:
Bluetooth® LE Data Throughput Service specification | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Example 1 of flow diagram between a Data Throughput server (STM32WBA) & a Client Collector |
---|
Example 2 of flow diagram between a Data Throughput server (STM32WBA) & a Client Collector |
---|
1.1. STMicrolectronics Manufacturer Advertising Data
Data Throughput Sensor STMicroelectronics Manufacturer Advertising data | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
1.2. On board buttons configuration
DT Sensor Application Nucleo-WBA buttons configuration | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2. Requirements
2.1. Software and system requirements
The software required are the following (minimum IDEs version):
- IAR Embedded Workbench for ARM (EWARM) toolchain V9.20.1
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V??
- STM32CubeIDE toolchain V?? [2].
Programmer:
- STM32CubeProgrammer[3] : To flash the board with an already generated binary
2.2. Hardware requirements
NUCLEO-WBA5 [4] is necessary to install the application.
Hardware platform illustration |
---|
|
2.3. Collector applications compatible
The STM32CubeWBA Data Throughput Sensor project is compatible with the following collector:
3. STM32WBA Data Throughput Server example description
3.1. Project directory
The "BLE_DataThroughput_Server" application is available by downloading STM32CubeWBA MCU Package[5].
Data Throughput Server project directory |
---|
3.2. Project description
3.2.1. Structure
Software project structure with the most important parts:
Data Throughput Server project structure |
---|
WARNING: Do not modify the files in Middlewares folder |
3.2.2. Application initialization
The different steps of the application initialization are described below:
Data Throughput Server project initialization |
---|
3.2.3. GAP and GATT initialization and interaction
The Bluetooth LE Data Throughput Server application initialization is done within app_ble.c
- Start the BLE stack - initialize the device as peripheral - configure and start advertising: ADV parameters, local name, UUID - APP_BLE_init()
- Call the services controller initialization SVCCTL_Init() - svc_ctl.c
- Manage the GAP event - SVCCTL_App_Notification()
- EVT_LE_CONN_COMPLETE - provides information of the connection interval, slave latency, supervision timeout
- EVT_LE_CONN_UPDATE_COMPLETE - provides the new information of the connection
- EVT_DISCONN_COMPLETE - informs the application about the link disconnection and the reason
- EVT_ENCRYPT_CHANGE - informs the application weather the link is encrypted
The Services management is done by the service controller - svc_ctl.c
- Call the Initialization function of all the developed services - SVCCTL_SvcInit()
- Data Throughput Service - DT_SERV_Init() - dt_serv.c
- Register Services Event Handler - SVCCTL_RegisterSvcHandler(...)
- Manage events - SVCCTL_UserEvtRx ()- from the BLE Host Stack and redirect them to the services registered - DT_SERV_EventHandler() - or gap event handler - SVCCTL_App_Notification
The Data Throughput Service dt_serv.c manages the specification of the service:
- Service Init - DT_SERV_Init()
- Register Data Throughput Event Handle to Service Controller - SVCCTL_RegisterSvcHandler(DT_SERV_EventHandler);
- Initialize Service UUID – add Data Throughput service as Primary services
TBU
- Update Data Throughput DT_SERV_THROUGH measurement characteristic - DT_SERV_UpdateValue()
- Update Data Throughput DT_SERV_TX characteristic Value - DT_SERV_UpdateValue()
- Manage the GATT event from BLE Stack - DT_SERV_EventHandler()
- ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE
- Reception of a Write Command: DT_SERV_RX Characteristic Value
- ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE
- ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE
- Reception of an attribute modification - DT_SERV_TX Value : ENABLE or DISABLE Notification
- Reception of an attribute modification - DT_SERV_THROUGH Value : ENABLE or DISABLE Notification
- Notify application of the Transmitted Data - DT_SERV_Notification(DT_SERV_TX_CHAR)
- Notify application of the Received Data - DT_SERV_Notification(DT_SERV_THROUGH_CHAR)
- ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE
Data Throughput Server software module interaction |
---|
The application level of the Data Throughput Server is done with dt_serv_app.c:
- Initialization of the context of the application
- TBC
- TBC
- Receive notification from the Data Throughput Service - DT_SERV_Notification()
- When Data Throughput TX characteristic is enabled by the remote, data are sent continuously DT_SERV_UpdateValue(DT_SERV_TX_CHAR)
- When Data Throughput THROUGH characteristic is enabled by the remote, on reception of data (DT_SERV_RX_CHAR) the calculation of received data is done and sent every second DT_SERV_UpdateValue(DT_SERV_THROUGH_CHAR)
3.3. Build and install
Follow the steps described in Bluetooth® LE Build and Install Application page, applying them for STM32WBA BLE_DataThroughput_Server project.
3.4. How to use
3.5. UART debug trace
4. STM32WBA Data Throughput Client example description
4.1. Project directory
The "BLE_DataThroughput_Client" application is available by downloading STM32CubeWBA MCU Package[5].
Data Throughput Client project directory |
---|
4.2. Project description
4.2.1. Structure
Software project structure with the most important parts:
Data Throughput Client project structure |
---|
4.2.2. Application initialization
The different steps of the application initialization are described below:
4.2.3. GAP and GATT initialization and interaction
4.3. Build and install
Follow the steps described in Bluetooth® LE Build and Install Application page, applying them for STM32WBA BLE_DataThroughput_Client project.