BLE File Transfer Example
Source code path: example/ble/file_transfer
Supported Platforms
All platforms
Overview
This example demonstrates how to implement a GAP peripheral role on this platform to receive files sent from a mobile device.
Example Usage
The Finsh commands for this example can be displayed by entering
diss help
to show command usage.When operating as a peripheral device, it will start advertising on boot with the name format: SIFLI_APP-xx-xx-xx-xx-xx-xx, where xx represents the device’s Bluetooth address. You can connect using a mobile BLE app.
The sifli ble serial transport protocol can be used to send files from the mobile device to the target device, supporting one or multiple files in a single transfer.
Hardware Requirements
Before running this example, you need to prepare:
A development board supported by this example (Supported Platforms).
A mobile device.
Compilation and Flashing
Navigate to the example’s project/common directory and run the scons command to compile:
> scons --board=eh-lb525 -j32
Navigate to the example’s project/common/build_xx
directory and run uart_download.bat
, then select the port as prompted to download:
$ ./uart_download.bat
Uart Download
please input the serial port num:5
For detailed compilation and downloading steps, please refer to the relevant sections in Quick Start.
Expected Results
After the example starts:
It can be discovered and connected by a mobile BLE app.
Compress the files to be transferred into a single .zip file and transfer this file to your mobile device.
Use the SIFLI BLE app to search for and connect to the device, then on the watchface interface, select custom file and choose the file to transfer it to the device.
Mobile app operation steps:
Transfer interface: Set file type to 3 (custom file) Check the withByteAlign option Future development can define different processing for various file types
Mobile SDK Integration
https://github.com/OpenSiFli/SiFli_OTA_APP SiFli-SDK file transfer
Troubleshooting
When the development board returns an error, check the ble_watchface_status_id_t enumeration in bf0_sibles_watchface.h
Reference Documentation
Update History
Version |
Date |
Release Notes |
---|---|---|
0.0.1 |
07/2025 |
Initial version |
No newline at end of right file. |