1. Introduction
2. Data Throughput
3. Requirements
3.1. Software and system requirements
3.2. Hardware requirements
3.3. Collector applications compatible
4. STM32WBA Data Throughput Server example description
4.1. Project directory
The "BLE_DataThroughput_Server" application is available by downloading STM32CubeWBA MCU Package[1].
Data Throughput Server project directory |
---|
4.2. Project description
4.2.1. Structure
Software project structure with the most important parts:
Data Throughput Server project structure |
---|
4.2.2. Application initialization
The different steps of the application initialization are described below:
Data Throughput Server project initialization |
---|
4.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)
4.3. Build and install
Follow the steps described in Bluetooth® LE Build and Install Application page, applying them for STM32WBA BLE_DataThroughput_Server project.
4.4. How to use
4.5. UART debug trace
5. STM32WBA Data Throughput Client example description
5.1. Project directory
The "BLE_DataThroughput_Client" application is available by downloading STM32CubeWBA MCU Package[1].
Data Throughput Client project directory |
---|
5.2. Project description
5.2.1. Structure
Software project structure with the most important parts:
Data Throughput Client project structure |
---|
5.2.2. Application initialization
The different steps of the application initialization are described below:
5.2.3. GAP and GATT initialization and interaction
5.3. Build and install
Follow the steps described in Bluetooth® LE Build and Install Application page, applying them for STM32WBA BLE_DataThroughput_Client project.